Skip to content

Commit 6133106

Browse files
committed
Created option to pass date specific order
1 parent a3d8231 commit 6133106

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

bu_isciii/templates/rnaseq/ANALYSIS/DATE_ANALYSIS01_RNASEQ/02-differential_expression/time_series_differential_expression.R

+11-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ option_list <- list(
4141
make_option(c("-c", "--clinical_data" ), type="character" , default='../clinical_data.txt' , metavar="path" , help="Path to clinical data file" ),
4242
make_option(c("-g", "--group_col" ), type="character" , default='Group' , metavar="string" , help="Colname with the sample classes in sample_data of the experiment for the DE." ),
4343
make_option(c("-n", "--norm_counts" ), type="logical" , default=FALSE , metavar="boolean", help="Create table with normalized counts" ),
44-
make_option(c("-q", "--quality_plots" ), type="logical" , default=TRUE , metavar="boolean", help="Create quality plots or not." )
44+
make_option(c("-q", "--quality_plots" ), type="logical" , default=TRUE , metavar="boolean", help="Create quality plots or not." ),
45+
make_option(c("-t", "--time_order" ), type="character" , default=NULL , metavar="string" , help="Order to plot the dates as list, eg: 15D,45D,3M." )
4546
)
4647

4748
opt_parser <- OptionParser(option_list=option_list)
@@ -51,6 +52,14 @@ cat(blue$bold("########################\nRunning analysis with the following par
5152
cat(blue("-Path to RNAseq input folder: ")) + cat(blue(opt$rnaseq_dir))+cat(blue("\n"))
5253
cat(blue("-Path to samples clinical data: ")) + cat(blue(opt$clinical_data))+cat(blue("\n"))
5354
cat(blue("-Column with the group info: ")) + cat(blue(opt$group_col))+cat(blue("\n"))
55+
56+
if (is.null(opt$time_order)) {
57+
print_help(opt_parser)
58+
stop("You need to specify the order for the dates.", call.=FALSE)
59+
} else {
60+
time_order <- unlist(strsplit(opt$time_order, ","))
61+
}
62+
5463
if (opt$norm_counts) {
5564
cat(blue("-Saving normalized counts to file\n"))
5665
} else{
@@ -62,6 +71,7 @@ if (opt$quality_plots) {
6271
cat(blue("-Skipping quality plots\n"))
6372
}
6473

74+
cat(blue("Time order: ")) + cat(blue(time_order)) +cat(blue("\n"))
6575

6676
################################################
6777
################################################

0 commit comments

Comments
 (0)