diff small_rna_maps.xml @ 5:12c14642e6ac draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_maps commit 24a21619d79d83b38cef7f1a7b858c621e4c8449
author artbio
date Sun, 08 Oct 2017 17:56:13 -0400
parents a6b9a081064b
children a3be3601bcb3
line wrap: on
line diff
--- a/small_rna_maps.xml	Fri Aug 25 12:22:03 2017 -0400
+++ b/small_rna_maps.xml	Sun Oct 08 17:56:13 2017 -0400
@@ -1,11 +1,11 @@
-<tool id="small_rna_maps" name="small_rna_maps" version="1.1.0">
+<tool id="small_rna_maps" name="small_rna_maps" version="2.0.0">
   <description></description>
   <requirements>
         <requirement type="package" version="1.11.2=py27_0">numpy</requirement>
         <requirement type="package" version="0.11.2.1=py27_0">pysam</requirement>
-        <requirement type="package" version="1.3.2=r3.3.1_0">r-optparse</requirement>
-        <requirement type="package" version="0.6_28=r3.3.1_0">r-latticeextra</requirement>
-        <requirement type="package" version="2.2.1=r3.3.1_0">r-gridextra</requirement>
+        <requirement type="package" version="1.3.2=r3.3.2_0">r-optparse</requirement>
+        <requirement type="package" version="0.6_28=r3.3.2_0">r-latticeextra</requirement>
+        <requirement type="package" version="2.2.1=r3.3.2_0">r-gridextra</requirement>
   </requirements>
   <stdio>
       <exit_code range="1:" level="fatal" description="Tool exception" />
@@ -23,27 +23,65 @@
       #for $sample in $inputs
           '$sample.name'
       #end for
-          --plot_methods Counts '$extra_plot'
+      #if str($plots_options.plots_options_selector ) == "two_plot":
+          --plot_methods '${plots_options.first_plot}' '${plots_options.extra_plot}'
           --outputs '$output_tab' '$extra_output_tab' &&
+      #else:
+          --plot_methods '${plots_options.first_plot}'
+          --outputs '$output_tab' &&
+      #end if
       Rscript '$__tool_directory__'/small_rna_maps.r
           --first_dataframe '$output_tab' 
           --extra_dataframe '$extra_output_tab'
-          --extra_plot_method '$extra_plot'
+          #if str($plots_options.plots_options_selector ) == "two_plot":
+              --first_plot_method '${plots_options.first_plot}'
+              --extra_plot_method '${plots_options.extra_plot}'
+          #else:
+              --first_plot_method '${plots_options.first_plot}'
+              --extra_plot_method ''
+          #end if
           --output_pdf '$output_pdf'
   ]]></command>
  <inputs>
-   <param name="inputs" type="data" format="bam" label="Select multiple alignments to parse" multiple="True"/> 
-   <param name="extra_plot" type="select" label="select the type of extra plot in addition to read map">
-       <option value="Coverage">Coverage</option> 
-       <option value="Mean">Mean Sizes</option> 
-       <option value="Median">Median Sizes</option>
-       <option value="Size">Size Distributions</option>
-    </param>
+    <param name="inputs" type="data" format="bam" label="Select multiple alignments to parse" multiple="True"/>
+    <conditional name="plots_options">
+        <param name="plots_options_selector" type="select" label="Number of plots per chromosome">
+            <option value="one_plot">Just one plot per chromosome</option>
+            <option value="two_plot" selected="True">Two plots per chromosome</option>
+        </param>
+        <when value="two_plot">
+            <param name="first_plot" type="select" label="select the type of the first plot">
+                <option value="Counts">Counts</option> 
+                <option value="Coverage">Coverage</option> 
+                <option value="Mean">Mean Sizes</option> 
+                <option value="Median">Median Sizes</option>
+                <option value="Size">Size Distributions</option>
+            </param>
+            <param name="extra_plot" type="select" label="select the type of the second plot">
+                <option value="Counts">Counts</option> 
+                <option value="Coverage">Coverage</option> 
+                <option value="Mean">Mean Sizes</option> 
+                <option value="Median">Median Sizes</option>
+                <option value="Size">Size Distributions</option>
+            </param>
+        </when>
+        <when value="one_plot">
+            <param name="first_plot" type="select" label="select the type of the first plot">
+                <option value="Counts">Counts</option> 
+                <option value="Coverage">Coverage</option> 
+                <option value="Mean">Mean Sizes</option> 
+                <option value="Median">Median Sizes</option>
+                <option value="Size">Size Distributions</option>
+            </param>
+        </when>
+    </conditional>
  </inputs>
 
  <outputs>
    <data format="tabular" name="output_tab" label="Read Count dataframe" />
-   <data format="tabular" name="extra_output_tab" label="$extra_plot dataframe" />
+   <data format="tabular" name="extra_output_tab" label="$plots_options.extra_plot dataframe">
+    <filter>plots_options['plots_options_selector'] == 'two_plot'</filter>
+   </data> 
    <data format="pdf" name="output_pdf" label="PDF file" />
 
 </outputs>
@@ -51,38 +89,78 @@
     <tests>
         <test>
             <param name="inputs" value="input1.bam,input2.bam" ftype="bam"/>
+            <param name="plots_options_selector" value="two_plot" />
+            <param name="first_plot" value="Counts" />
             <param name="extra_plot" value="Mean" />
-            <output file="readmap.tab" name="output_tab" />
+            <output file="count.tab" name="output_tab" />
             <output file="mean.tab" name="extra_output_tab" />
-            <output file="mean.pdf" name="output_pdf" />
+            <output file="count-mean.pdf" name="output_pdf" />
         </test>
         <test>
             <param name="inputs" value="input1.bam,input1.bam" ftype="bam"/>
+            <param name="plots_options_selector" value="two_plot" />
+            <param name="first_plot" value="Counts" />
             <param name="extra_plot" value="Mean" />
-            <output file="doubled_readmap.tab" name="output_tab" />
-            <output file="double_mean.tab" name="extra_output_tab" />
-            <output file="doubled_mean.pdf" name="output_pdf" />
+            <output file="doubled_count.tab" name="output_tab" />
+            <output file="doubled_mean.tab" name="extra_output_tab" />
+            <output file="doubled_count-mean.pdf" name="output_pdf" />
+        </test>
+        <test>
+            <param name="inputs" value="input1.bam,input2.bam" ftype="bam"/>
+            <param name="plots_options_selector" value="two_plot" />
+            <param name="first_plot" value="Counts" />
+            <param name="extra_plot" value="Median" />
+            <output file="count.tab" name="output_tab" />
+            <output file="median.tab" name="extra_output_tab" />
+            <output file="count-median.pdf" name="output_pdf" />
+        </test>
+        <test>
+            <param name="inputs" value="input1.bam,input2.bam" ftype="bam"/>
+            <param name="plots_options_selector" value="two_plot" />
+            <param name="first_plot" value="Counts" />
+            <param name="extra_plot" value="Coverage" />
+            <output file="count.tab" name="output_tab" />
+            <output file="coverage.tab" name="extra_output_tab" />
+            <output file="count-coverage.pdf" name="output_pdf" />
         </test>
         <test>
             <param name="inputs" value="input1.bam,input2.bam" ftype="bam"/>
-            <param name="extra_plot" value="Median" />
-            <output file="readmap.tab" name="output_tab" />
-            <output file="median.tab" name="extra_output_tab" />
-            <output file="median.pdf" name="output_pdf" />
+            <param name="plots_options_selector" value="two_plot" />
+            <param name="first_plot" value="Counts" />
+            <param name="extra_plot" value="Size" />
+            <output file="count.tab" name="output_tab" />
+            <output file="size.tab" name="extra_output_tab" />
+            <output file="count-size.pdf" name="output_pdf" />
+        </test>
+        <test>
+            <param name="inputs" value="input1.bam,input2.bam" ftype="bam"/>
+            <param name="plots_options_selector" value="two_plot" />
+            <param name="first_plot" value="Size" />
+            <param name="extra_plot" value="Counts" />
+            <output file="size.tab" name="output_tab" />
+            <output file="count.tab" name="extra_output_tab" />
+            <output file="size-count.pdf" name="output_pdf" />
         </test>
         <test>
             <param name="inputs" value="input1.bam,input2.bam" ftype="bam"/>
-            <param name="extra_plot" value="Coverage" />
-            <output file="readmap.tab" name="output_tab" />
-            <output file="coverage.tab" name="extra_output_tab" />
-            <output file="coverage.pdf" name="output_pdf" />
+            <param name="plots_options_selector" value="one_plot" />
+            <param name="first_plot" value="Counts" />
+            <output file="count.tab" name="output_tab" />
+            <output file="count.pdf" name="output_pdf" />
         </test>
         <test>
             <param name="inputs" value="input1.bam,input2.bam" ftype="bam"/>
-            <param name="extra_plot" value="Size" />
-            <output file="readmap.tab" name="output_tab" />
-            <output file="size.tab" name="extra_output_tab" />
-            <output file="sizes.pdf" name="output_pdf" />
+            <param name="plots_options_selector" value="one_plot" />
+            <param name="first_plot" value="Size" />
+            <output file="size.tab" name="output_tab" />
+            <output file="size.pdf" name="output_pdf" />
+        </test>
+        <test>
+            <param name="inputs" value="input1.bam,input2.bam" ftype="bam"/>
+            <param name="plots_options_selector" value="one_plot" />
+            <param name="first_plot" value="Coverage" />
+            <output file="coverage.tab" name="output_tab" />
+            <output file="coverage.pdf" name="output_pdf" />
         </test>
     </tests>