changeset 31:7e767425bb3d draft

planemo upload commit ced723993fbc474096bdd48de30b8a6d3d510dd9
author mingchen0919
date Fri, 05 Oct 2018 23:04:17 -0400
parents 231de8741468
children a0dd6296f935
files command-line-arguments.csv rmarkdown_report.Rmd rmarkdown_report.xml
diffstat 3 files changed, 31 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/command-line-arguments.csv	Fri Sep 14 16:35:24 2018 -0400
+++ b/command-line-arguments.csv	Fri Oct 05 23:04:17 2018 -0400
@@ -1,12 +1,13 @@
-short flag,argument mask,data type,variable name
-o,1,character,report
-d,1,character,report.files_path
-A,1,character,count_data
-B,1,character,column_data
-C,1,character,design_formula
-D,1,character,treatment_name
-E,1,character,treated
-F,1,character,untreated
-H,1,character,fit_type
-I,1,character,alpha
-J,1,character,significant_genes
+short flag,argument mask,data type,variable name
+o,1,character,report
+d,1,character,report.files_path
+A,1,character,count_data
+B,1,character,column_data
+C,1,character,design_formula
+D,1,character,treatment_name
+E,1,character,treated
+F,1,character,untreated
+T,1,character,test_method
+H,1,character,fit_type
+I,1,character,alpha
+J,1,character,significant_genes
--- a/rmarkdown_report.Rmd	Fri Sep 14 16:35:24 2018 -0400
+++ b/rmarkdown_report.Rmd	Fri Oct 05 23:04:17 2018 -0400
@@ -64,15 +64,24 @@
 ```
 
 ```{r}
+f = gsub('~', '~ 1 +', opt$X_C) # build formula
 dds = DESeqDataSetFromMatrix(countData = count_data,
                              colData = coldata,
-                             design = formula(opt$X_C))
+                             design = formula(f))
+
 
 # prefiltering
 keep <- rowSums(counts(dds)) >= 10
 dds <- dds[keep,]
 
-dds = DESeq(dds, test = opt$X_G, fitType = opt$X_H)
+# Run DESeq
+if (opt$X_T == 'LRT') {
+  reduced_f = gsub(paste0('\\+\\s*', opt$X_D), '', f)
+  dds =  DESeq(dds, test=opt$X_T, fitType = opt$X_H, reduced = formula(reduced_f))
+} else {
+  dds = DESeq(dds, test=opt$X_T, fitType = opt$X_H)
+}
+
 ## Differential expression test results
 res = results(dds, contrast = c(opt$X_D, opt$X_E, opt$X_F), alpha = opt$X_I)
 res
--- a/rmarkdown_report.xml	Fri Sep 14 16:35:24 2018 -0400
+++ b/rmarkdown_report.xml	Fri Oct 05 23:04:17 2018 -0400
@@ -38,6 +38,7 @@
             -D '$treatment_name'
             -E '$treated'
             -F '$untreated'
+            -T '$test_method'
             -H '$fit_type'
             -I '$alpha'
             -J '$significant_genes'
@@ -69,6 +70,12 @@
         <param type="text" name="untreated" label="Untreated"
                help="A level from the specified treatment column that will be used as the untreated group in the DESeq2 analysis."
                optional="False"/>
+        <param type="select" name="test_method" label="Test method"
+               help="either 'Wald' or 'LRT', which will then use either Wald significance tests (defined by nbinomWaldTest),
+               or the likelihood ratio test on the difference in deviance between a full and reduced model formula (defined by nbinomLRT)">
+            <option value="Wald" selected="true">Wald</option>
+            <option value="LRT">LRT</option>
+        </param>
         <param type="select" name="fit_type" label="Fitting of dispersions"
                help="either &quot;parametric&quot;, &quot;local&quot;, or &quot;mean&quot; for the type of fitting of dispersions to the mean intensity"
                optional="False">