diff geneBody_coverage.xml @ 52:34e4c586e3c0 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/rseqc commit 7f68686cac77df831f1a26a2126a238a2e480316
author iuc
date Tue, 21 Nov 2017 14:55:32 -0500
parents 09846d5169fa
children 5873cd7afb67
line wrap: on
line diff
--- a/geneBody_coverage.xml	Tue Mar 14 10:23:21 2017 -0400
+++ b/geneBody_coverage.xml	Tue Nov 21 14:55:32 2017 -0500
@@ -1,4 +1,4 @@
-<tool id="rseqc_geneBody_coverage" name="Gene Body Converage (BAM)" version="@WRAPPER_VERSION@">
+<tool id="rseqc_geneBody_coverage" name="Gene Body Converage (BAM)" version="@WRAPPER_VERSION@.1">
   <description>
     Read coverage over gene body.
   </description>
@@ -14,24 +14,42 @@
   <version_command><![CDATA[geneBody_coverage.py --version]]></version_command>
 
   <command><![CDATA[
-    #import re
-    #set $input_list = []
-    #for $i, $input in enumerate($inputs):
+    #if str($batch_mode.batch_mode_selector) == "merge":
+        #import re
+        #set $input_list = []
+        #for $i, $input in enumerate($batch_mode.inputs):
+            #set $safename = re.sub('[^\w\-_]', '_', $input.element_identifier)
+            #if $safename in $input_list:
+                #set $safename = str($safename) + "." + str($i)
+            #end if
+            $input_list.append($safename)
+            ln -sf '${input}' '${safename}.bam' &&
+            ln -sf '${input.metadata.bam_index}' '${safename}.bam.bai' &&
+            echo '${safename}.bam' >> 'input_list.txt' &&
+        #end for
+        geneBody_coverage.py -i 'input_list.txt' -r '${refgene}' --minimum_length ${minimum_length} -o output
+    #else
         #set $safename = re.sub('[^\w\-_]', '_', $input.element_identifier)
-        #if $safename in $input_list:
-            #set $safename = str($safename) + "." + str($i)
-        #end if
-        $input_list.append($safename)
         ln -sf '${input}' '${safename}.bam' &&
         ln -sf '${input.metadata.bam_index}' '${safename}.bam.bai' &&
-        echo '${safename}.bam' >> 'input_list.txt' &&
-    #end for
-    geneBody_coverage.py -i 'input_list.txt' -r '${refgene}' --minimum_length ${minimum_length} -o output
+        geneBody_coverage.py -i '${safename}.bam' -r '${refgene}' --minimum_length ${minimum_length} -o output
+    #end if
     ]]>
   </command>
 
   <inputs>
-    <param name="inputs" type="data" label="Input .bam file(s)" format="bam" help="(--input-file)" multiple="true"/>
+    <conditional name="batch_mode">
+        <param name="batch_mode_selector" type="select" label="Run each sample separately, or combine mutiple samples into one plot">
+            <option value="batch" selected="true">Run each sample separately</option>
+            <option value="merge">Combine multiple samples into a single plot</option>
+        </param>
+        <when value="batch">
+            <param name="input" type="data" label="Input .bam file" format="bam" help="(--input-file)"/>
+        </when>
+        <when value="merge">
+            <param name="inputs" type="data" label="Input .bam file(s)" format="bam" help="(--input-file)" multiple="true"/>
+        </when>
+    </conditional>
     <expand macro="refgene_param" />
     <param name="minimum_length" type="integer" value="100" label="Minimum mRNA length (default: 100)" help="Minimum mRNA length in bp, mRNA that are shorter than this value will be skipped (--minimum_length)." />
     <expand macro="rscript_output_param" />
@@ -40,7 +58,7 @@
   <outputs>
     <data name="outputcurvespdf" format="pdf" from_work_dir="output.geneBodyCoverage.curves.pdf" label="${tool.name} on ${on_string} (Curves pdf)" />
     <data name="outputheatmappdf" format="pdf" from_work_dir="output.geneBodyCoverage.heatMap.pdf" label="${tool.name} on ${on_string} (HeatMap pdf)">
-      <filter>len(inputs) >= 3</filter>
+      <filter>batch_mode['batch_mode_selector'] == 'merge' and len(inputs) >= 3</filter>
     </data>
     <expand macro="rscript_output_data" filename="output.geneBodyCoverage.r" />
     <data name="outputtxt" format="txt" from_work_dir="output.geneBodyCoverage.txt" label="${tool.name} on ${on_string} (text)" />
@@ -49,7 +67,10 @@
   <!-- PDF Files contain R version, must avoid checking for diff -->
   <tests>
     <test>
-      <param name="inputs" value="pairend_strandspecific_51mer_hg19_chr1_1-100000.bam" />
+      <conditional name="batch_mode">
+        <param name="batch_mode_selector" value="batch" />
+        <param name="input" value="pairend_strandspecific_51mer_hg19_chr1_1-100000.bam" />
+      </conditional>
       <param name="refgene" value="hg19_RefSeq_chr1_1-100000.bed" />
       <param name="rscript_output" value="true" />
       <output name="outputcurvespdf" file="output.geneBodyCoverage.curves.pdf" compare="sim_size" />
@@ -57,7 +78,10 @@
       <output name="outputtxt" file="output.geneBodyCoverage.txt" />
     </test>
     <test>
-      <param name="inputs" value="pairend_strandspecific_51mer_hg19_chr1_1-100000.bam,pairend_strandspecific_51mer_hg19_chr1_1-100000.bam,pairend_strandspecific_51mer_hg19_chr1_1-100000.bam" />
+      <conditional name="batch_mode">
+        <param name="batch_mode_selector" value="merge" />
+        <param name="inputs" value="pairend_strandspecific_51mer_hg19_chr1_1-100000.bam,pairend_strandspecific_51mer_hg19_chr1_1-100000.bam,pairend_strandspecific_51mer_hg19_chr1_1-100000.bam" />
+      </conditional>
       <param name="refgene" value="hg19_RefSeq_chr1_1-100000.bed" />
       <param name="rscript_output" value="true" />
       <output name="outputcurvespdf" file="output2.geneBodyCoverage.curves.pdf" compare="sim_size" />
@@ -79,8 +103,8 @@
 Coverage skewness was measured by `Pearson’s skewness coefficients <http://en.wikipedia.org/wiki/Skewness#Pearson.27s_skewness_coefficients>`_
 
 .. image:: $PATH_TO_IMAGES/geneBody_workflow.png
-:width: 800 px
-:scale: 80 %
+    :width: 800 px
+    :scale: 80 %
 
 
 ## Inputs
@@ -94,7 +118,7 @@
 Minimum mRNA length
     Minimum mRNA length (bp). mRNA that are shorter than this value will be skipped (default is 100).
 
-    ## Outputs
+## Outputs
 
 Text
     Table that includes the data used to generate the plots
@@ -112,9 +136,9 @@
 :scale: 80 %
 
 .. image:: $PATH_TO_IMAGES/Aug_26.geneBodyCoverage.heatMap.png
-:height: 600 px
-:width: 600 px
-:scale: 80 %
+    :height: 600 px
+    :width: 600 px
+    :scale: 80 %
 
 @ABOUT@