added quick summary to see sig meds just before writing file
This commit is contained in:
parent
17aebc26e8
commit
1562a09631
8 changed files with 63 additions and 29 deletions
|
@ -43,12 +43,6 @@ 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 at each timepoint b/w groups: wilcoxon UNpaired analysis
|
||||
# with correction
|
||||
|
@ -366,16 +360,22 @@ colnames(combined_unpaired_stats_f) = c("mediator"
|
|||
|
||||
colnames(combined_unpaired_stats_f)
|
||||
|
||||
#---------------
|
||||
# quick summary
|
||||
#---------------
|
||||
# count how many meds are significant
|
||||
n_sig = length(combined_unpaired_stats_f$mediator[combined_unpaired_stats_f$p_signif<0.05])
|
||||
cat("\nTotal no. of statistically significant mediators in", toupper(my_sample_type)
|
||||
, "are:", n_sig)
|
||||
n_sig = length(combined_unpaired_stats_f$mediator[combined_unpaired_stats_f$p_signif<0.05 & !is.na(combined_unpaired_stats_f$p_signif<0.05)])
|
||||
sig_meds = combined_unpaired_stats_f[(combined_unpaired_stats_f$p_signif<0.05 & !is.na(combined_unpaired_stats_f$p_signif<0.05)),]
|
||||
|
||||
sig_meds = combined_unpaired_stats_f[combined_unpaired_stats_f$p_signif<0.05,]
|
||||
sig_meds$med_time = paste0(sig_meds$mediator, "@", sig_meds$timepoint)
|
||||
|
||||
cat("\nTotal no. of statistically significant mediators in", toupper(my_sample_type)
|
||||
, "are:", n_sig
|
||||
, "\nThese are:", sig_meds$med_time)
|
||||
|
||||
########################################################################
|
||||
#******************
|
||||
# write output file
|
||||
#******************
|
||||
cat("UNpaired stats for groups will be:", flu_stats_time_unpaired_na)
|
||||
write.csv(combined_unpaired_stats_f, flu_stats_time_unpaired_na, row.names = FALSE)
|
||||
cat("\nUNpaired stats for groups will be:", flu_stats_time_unpaired_na)
|
||||
#write.csv(combined_unpaired_stats_f, flu_stats_time_unpaired_na, row.names = FALSE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue