changeset 2:db04ba860dab draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/masigpro commit 54ebbdebc9861af600371928cb9915095941c231
author iuc
date Thu, 13 Jul 2017 18:23:17 -0400
parents cc96abdef027
children 83f8b5ceff43
files masigpro.R masigpro.xml test-data/masigpro_out.tab test-data/masigpro_out_no_cluster.tab
diffstat 4 files changed, 108 insertions(+), 45 deletions(-) [+]
line wrap: on
line diff
--- a/masigpro.R	Thu Jun 01 11:10:22 2017 -0400
+++ b/masigpro.R	Thu Jul 13 18:23:17 2017 -0400
@@ -92,6 +92,7 @@
  make_option("--significant_intercept", type="character", default="dummy"),
  make_option("--cluster_data", type="integer", default=1),
  make_option(c("-k", "--k"), type="integer", default=9),
+ make_option("--print_cluster", type="logical", default=FALSE),
  make_option("--cluster_method", type="character", default="hclust"),
  make_option("--distance", type="character", default="cor"),
  make_option("--agglo_method", type="character", default="ward.D"),
@@ -143,6 +144,17 @@
          show.lines = opt$show_lines, cexlab = opt$cexlab,
          legend = opt$legend)
 
+if (opt$print_cluster) {
+    for (i in 1:length(results$sig.genes)) {
+    
+    colname <- paste(names(results$sig.genes)[i], "cluster", sep = "_")
+    
+    results$summary[colname] <- ""
+    results$summary[[colname]][1:length(results$sig.genes[[i]]$sig.profiles$`cluster$cut`)] <-
+        results$sig.genes[[i]]$sig.profiles$`cluster$cut`
+    }
+}
+
 filename <- opt$outfile
 
 write.table((results$summary), file=filename, sep="\t", quote=FALSE,
--- a/masigpro.xml	Thu Jun 01 11:10:22 2017 -0400
+++ b/masigpro.xml	Thu Jul 13 18:23:17 2017 -0400
@@ -1,4 +1,4 @@
-<tool id="masigpro" name="maSigPro" version="1.49.3.0">
+<tool id="masigpro" name="maSigPro" version="1.49.3.1">
     <description>Significant Gene Expression Profile Differences in Time Course Gene Expression Data</description>
     <requirements>
         <requirement type="package" version="1.49.3">bioconductor-masigpro</requirement>
@@ -70,6 +70,7 @@
     #if $pdf.pdf_selector:
         --cluster_data $pdf.seeGenes.clusterData
         -k $pdf.seeGenes.k
+        --print_cluster $pdf.seeGenes.print_cluster
         --cluster_method $pdf.seeGenes.clustering.clusterMethod
         #if str($pdf.seeGenes.clustering.clusterMethod) == "hclust":
             --distance $pdf.seeGenes.clustering.distance
@@ -277,6 +278,9 @@
                             ‘c(sig.profiles,coefficients,t.score)’ of their list
                             position (1,2 or 3)." />
                     <param name="k" type="integer" label="Number of clusters for data partioning" value="9" />
+                    <param name="print_cluster" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="true"
+                        label="Add cluster information to summary file?"
+                        help="Adds columns with the cluster assignment for each gene." />
                     <conditional name="clustering">
                         <param name="clusterMethod" label="Cluster Method" type="select"
                             help="clustering method for data partioning. Currently
@@ -313,6 +317,8 @@
                             <param name="iterMax" type="integer" label="Maximum number of iterations" value="500"
                                 help="Maximum number of iterations when ‘cluster.method’ is ‘kmeans’" />
                         </when>
+                        <when value="Mclust">
+                        </when>
                     </conditional>
                     <param name="colorMode" label="Color Mode" type="select" help="Color scale for plotting profiles. Can be either ‘rainbow’ or ‘gray’">
                         <option selected="True" value="rainbow">Rainbow</option>
@@ -328,10 +334,18 @@
                         help="Indicating whether legend must be added when plotting profiles" />
                 </section>
             </when>
+            <when value="0">
+            </when>
         </conditional>
     </inputs>
     <outputs>
-        <data format="tabular" name="masigpro_out" label="maSigPro result file on ${on_string}">
+        <data format="txt" name="data_out" label="maSigPro data file on ${on_string}">
+            <filter>
+                ((
+                    source['source_selector'] == 'advanced' and
+                    source['enable_output'] == True
+                ))
+            </filter>
         </data>
         <data format="txt" name="edesign_out" label="maSigPro edesign file on ${on_string}">
             <filter>
@@ -341,14 +355,6 @@
                 ))
             </filter>
         </data>
-        <data format="txt" name="data_out" label="maSigPro data file on ${on_string}">
-            <filter>
-                ((
-                    source['source_selector'] == 'advanced' and
-                    source['enable_output'] == True
-                ))
-            </filter>
-        </data>
         <data format="pdf" name="pdf_out" from_work_dir="Results.pdf" label="maSigPro Plot file on ${on_string}">
             <filter>
                 ((
@@ -356,6 +362,8 @@
                 ))
             </filter>
         </data>
+        <data format="tabular" name="masigpro_out" label="maSigPro result file on ${on_string}">
+        </data>
     </outputs>
     <tests>
         <test>
@@ -397,6 +405,14 @@
             <output name="masigpro_out" file="masigpro_out.tab" />
             <output name="pdf_out" file="Results.pdf" />
         </test>
+        <test>
+            <param name="source_selector" value="defaults" />
+            <param name="edesign" value="edesign_out.txt" />
+            <param name="data" value="data_out.txt" />
+            <param name="print_cluster" value="FALSE" />
+            <output name="masigpro_out" file="masigpro_out_no_cluster.tab" />
+            <output name="pdf_out" file="Results.pdf" />
+        </test>
     </tests>
     <help>
 <![CDATA[
--- a/test-data/masigpro_out.tab	Thu Jun 01 11:10:22 2017 -0400
+++ b/test-data/masigpro_out.tab	Thu Jul 13 18:23:17 2017 -0400
@@ -1,35 +1,35 @@
-Control	TreatmentvsControl
-FBgn0003358	FBgn0001112
-FBgn0004188	FBgn0003358
-FBgn0029723	FBgn0004188
-FBgn0030449	FBgn0013276
-FBgn0030769	FBgn0020299
-FBgn0032180	FBgn0020639
-FBgn0032860	FBgn0029723
-FBgn0033834	FBgn0029817
-FBgn0036494	FBgn0030449
-FBgn0041336	FBgn0030769
-FBgn0041337	FBgn0030952
-FBgn0050239	FBgn0031082
-FBgn0263626	FBgn0031945
-FBgn0264482	FBgn0032180
- 	FBgn0032860
- 	FBgn0032913
- 	FBgn0033640
- 	FBgn0033834
- 	FBgn0034197
- 	FBgn0034459
- 	FBgn0036494
- 	FBgn0038163
- 	FBgn0038468
- 	FBgn0039373
- 	FBgn0041336
- 	FBgn0041337
- 	FBgn0045479
- 	FBgn0047338
- 	FBgn0050239
- 	FBgn0261613
- 	FBgn0262146
- 	FBgn0263084
- 	FBgn0263626
- 	FBgn0264482
+Control	TreatmentvsControl	Control_cluster	TreatmentvsControl_cluster
+FBgn0003358	FBgn0001112	1	1
+FBgn0004188	FBgn0003358	1	2
+FBgn0029723	FBgn0004188	1	2
+FBgn0030449	FBgn0013276	2	3
+FBgn0030769	FBgn0020299	1	4
+FBgn0032180	FBgn0020639	1	1
+FBgn0032860	FBgn0029723	3	2
+FBgn0033834	FBgn0029817	4	1
+FBgn0036494	FBgn0030449	1	5
+FBgn0041336	FBgn0030769	5	2
+FBgn0041337	FBgn0030952	6	1
+FBgn0050239	FBgn0031082	7	1
+FBgn0263626	FBgn0031945	8	6
+FBgn0264482	FBgn0032180	9	2
+ 	FBgn0032860		5
+ 	FBgn0032913		1
+ 	FBgn0033640		1
+ 	FBgn0033834		7
+ 	FBgn0034197		1
+ 	FBgn0034459		1
+ 	FBgn0036494		2
+ 	FBgn0038163		1
+ 	FBgn0038468		1
+ 	FBgn0039373		8
+ 	FBgn0041336		9
+ 	FBgn0041337		2
+ 	FBgn0045479		1
+ 	FBgn0047338		1
+ 	FBgn0050239		2
+ 	FBgn0261613		1
+ 	FBgn0262146		1
+ 	FBgn0263084		1
+ 	FBgn0263626		2
+ 	FBgn0264482		2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/masigpro_out_no_cluster.tab	Thu Jul 13 18:23:17 2017 -0400
@@ -0,0 +1,35 @@
+Control	TreatmentvsControl
+FBgn0003358	FBgn0001112
+FBgn0004188	FBgn0003358
+FBgn0029723	FBgn0004188
+FBgn0030449	FBgn0013276
+FBgn0030769	FBgn0020299
+FBgn0032180	FBgn0020639
+FBgn0032860	FBgn0029723
+FBgn0033834	FBgn0029817
+FBgn0036494	FBgn0030449
+FBgn0041336	FBgn0030769
+FBgn0041337	FBgn0030952
+FBgn0050239	FBgn0031082
+FBgn0263626	FBgn0031945
+FBgn0264482	FBgn0032180
+ 	FBgn0032860
+ 	FBgn0032913
+ 	FBgn0033640
+ 	FBgn0033834
+ 	FBgn0034197
+ 	FBgn0034459
+ 	FBgn0036494
+ 	FBgn0038163
+ 	FBgn0038468
+ 	FBgn0039373
+ 	FBgn0041336
+ 	FBgn0041337
+ 	FBgn0045479
+ 	FBgn0047338
+ 	FBgn0050239
+ 	FBgn0261613
+ 	FBgn0262146
+ 	FBgn0263084
+ 	FBgn0263626
+ 	FBgn0264482