From ae1e663caf99c1664111fdcc3c6ec1aaf004eb70 Mon Sep 17 00:00:00 2001 From: Tanushree Tunstall Date: Mon, 26 Oct 2020 16:18:20 +0000 Subject: [PATCH] name generation for output files for other stats --- stats_unpaired_npa.R | 10 +++++----- stats_unpaired_sam.R | 10 +++++----- stats_unpaired_serum.R | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/stats_unpaired_npa.R b/stats_unpaired_npa.R index 54016bf..560ffb4 100755 --- a/stats_unpaired_npa.R +++ b/stats_unpaired_npa.R @@ -18,10 +18,12 @@ rm(colnames_sam_df, expected_rows_sam_lf rm(pivot_cols) +my_sample_type = "npa" #============= # Output: unpaired analysis of time for npa #============= -stats_time_unpaired_npa = paste0(outdir_stats, "stats_time_unpaired_npa.csv") +outfile_name = paste0("stats_time_unpaired_", my_sample_type, ".csv") +stats_time_unpaired = paste0(outdir_stats, outfile_name) #%%======================================================== # data assignment for stats wf = npa_df_adults_clean @@ -30,8 +32,6 @@ lf = npa_adults_lf table(lf$timepoint) lf$timepoint = paste0("t", lf$timepoint) -my_sample_type = "npa" - ######################################################################## # Unpaired stats at each timepoint b/w groups: wilcoxon UNpaired analysis with correction ####################################################################### @@ -311,5 +311,5 @@ colnames(combined_unpaired_stats_f) #****************** # write output file #****************** -cat("UNpaired stats for groups will be:", stats_time_unpaired_npa) -write.csv(combined_unpaired_stats_f, stats_time_unpaired_npa, row.names = FALSE) +cat("UNpaired stats for groups will be:", stats_time_unpaired) +write.csv(combined_unpaired_stats_f, stats_time_unpaired, row.names = FALSE) diff --git a/stats_unpaired_sam.R b/stats_unpaired_sam.R index 8808fe9..0c624ac 100755 --- a/stats_unpaired_sam.R +++ b/stats_unpaired_sam.R @@ -18,10 +18,12 @@ rm(colnames_npa_df, expected_rows_npa_lf rm(pivot_cols) +my_sample_type = "sam" #============= # Output: unpaired analysis of time for sam #============= -stats_time_unpaired_sam = paste0(outdir_stats, "stats_time_unpaired_sam.csv") +outfile_name = paste0("stats_time_unpaired_", my_sample_type, ".csv") +stats_time_unpaired = paste0(outdir_stats, outfile_name) #%%======================================================== # data assignment for stats wf = sam_df_adults_clean @@ -30,8 +32,6 @@ lf = sam_adults_lf table(lf$timepoint) lf$timepoint = paste0("t", lf$timepoint) -my_sample_type = "sam" - ######################################################################## # Unpaired stats at each timepoint b/w groups: wilcoxon UNpaired analysis with correction ####################################################################### @@ -315,5 +315,5 @@ colnames(combined_unpaired_stats_f) #****************** # write output file #****************** -cat("UNpaired stats for groups will be:", stats_time_unpaired_sam) -write.csv(combined_unpaired_stats_f, stats_time_unpaired_sam, row.names = FALSE) +cat("UNpaired stats for groups will be:", stats_time_unpaired) +write.csv(combined_unpaired_stats_f, stats_time_unpaired, row.names = FALSE) diff --git a/stats_unpaired_serum.R b/stats_unpaired_serum.R index 857668e..2d4b096 100755 --- a/stats_unpaired_serum.R +++ b/stats_unpaired_serum.R @@ -18,10 +18,12 @@ rm(colnames_sam_df, expected_rows_sam_lf rm(pivot_cols) +my_sample_type = "serum" #============= # Output: unpaired analysis of time for serum #============= -stats_time_unpaired_serum = paste0(outdir_stats, "stats_time_unpaired_serum.csv") +outfile_name = paste0("stats_time_unpaired_", my_sample_type, ".csv") +stats_time_unpaired = paste0(outdir_stats, outfile_name) #%%======================================================== # data assignment for stats wf = serum_df_adults_clean @@ -30,8 +32,6 @@ lf = serum_adults_lf table(lf$timepoint) lf$timepoint = paste0("t", lf$timepoint) -my_sample_type = "serum" - ######################################################################## # Unpaired stats at each timepoint b/w groups: wilcoxon UNpaired analysis with correction ####################################################################### @@ -312,5 +312,5 @@ colnames(combined_unpaired_stats_f) #****************** # write output file #****************** -cat("UNpaired stats for groups will be:", stats_time_unpaired_serum) -write.csv(combined_unpaired_stats_f, stats_time_unpaired_serum, row.names = FALSE) +cat("UNpaired stats for groups will be:", stats_time_unpaired) +write.csv(combined_unpaired_stats_f, stats_time_unpaired, row.names = FALSE)