renamed reg_cols_extraction.R to colnames_clinical_meds.R

This commit is contained in:
Tanushree Tunstall 2020-11-18 16:11:35 +00:00
parent 66f49a0eed
commit 702ff4e327
4 changed files with 5 additions and 29 deletions

View file

@ -20,31 +20,7 @@ source("data_extraction_formatting_clinical.R")
outfile_name_clinical = paste0("flu_stats_clinical_unpaired.csv")
outfile_clinical_unpaired = paste0(outdir_stats, outfile_name_clinical)
outfile_clinical_unpaired
#===============================
# data assignment for stats
#================================
wf = npa_wf[npa_wf$flustat == 1,]
lf = npa_lf[npa_lf$flustat == 1,]
lf$timepoint = paste0("t", lf$timepoint)
lf = lf[!lf$mediator == "vitd",]
########################################################################
# clear variables
rm(sam_lf, sam_wf
, serum_lf, serum_wf)
rm(colnames_sam_df, expected_rows_sam_lf
, colnames_serum_df, expected_rows_serum_lf)
rm(pivot_cols)
# sanity checks
table(lf$timepoint)
#if (table(lf$flustat) == table(npa_lf$flustat)[[2]]){
# cat("Analysing Flu positive patients for:", my_sample_type)
#}else{
# cat("FAIL: problem with subsetting data for:", my_sample_type)
# quit()
#}
########################################################################
# Unpaired stats for clinical data b/w groups: wilcoxon UNpaired analysis
# No correction required
@ -73,9 +49,9 @@ gathercols <- c("age", "los", "onset2final", "onsfindeath", "onset_2_initial", "
clinical_lf = gather_(clinical_df_numerical, keycol, valuecol, gathercols)
#==============
# unpaired: t1
#==============
#====================
# unpaired: clinical
#====================
sum(is.na(clinical_lf$value))
foo = clinical_lf[which(is.na(clinical_lf$value)),]