diff small_rna_map.xml @ 5:d65045e976e6 draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/small_rna_map commit b673d39fbe79f5164ba6489b33cfa78ac238ee09
author artbio
date Sat, 22 Jul 2017 11:45:52 -0400
parents 6ff925458e05
children f924a33e1eef
line wrap: on
line diff
--- a/small_rna_map.xml	Tue Jul 18 17:35:52 2017 -0400
+++ b/small_rna_map.xml	Sat Jul 22 11:45:52 2017 -0400
@@ -1,4 +1,4 @@
-<tool id="small_rna_map" name="small rna map" version="0.4.0">
+<tool id="small_rna_map" name="small rna map" version="0.5.0">
   <description></description>
   <requirements>
         <requirement type="package" version="1.11.2=py27_0">numpy</requirement>
@@ -11,37 +11,92 @@
       <exit_code range="1:" level="fatal" description="Tool exception" />
   </stdio>
   <command detect_errors="exit_code"><![CDATA[
+      #for $file in $input
+          samtools index '$file' &&
+      #end for
       python '$__tool_directory__'/small_rna_map.py 
       --input 
       #for $file in $input
-            '$file'
+           '$file'
       #end for
-      --sample_name
+          --sample_name
       #for $sample in $input
           '$sample.name'
       #end for
+      #if $extra_plot == 'Sizes':
+          --sizes '$output_sizes'
+      #end if
       --output '$output_tab' &&
-       Rscript '$__tool_directory__'/lattice_small_rna_map.r --output_tab '$output_tab' --output_pdf '$output_pdf'
+       Rscript '$__tool_directory__'/small_rna_map.r --output_tab '$output_tab' 
+               --output_pdf '$output_pdf'
+      #if $extra_plot != 'Sizes':
+          --extra_plot '$extra_plot'
+      #else
+          --sizes $output_sizes
+      #end if
   ]]></command>
  <inputs>
-   <param name="input" type="data" format="bam" label="Select multiple alignments to parse" multiple="True"/>     
+   <param name="input" 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="Sizes">Size Distributions</option>
+    </param>
  </inputs>
 
  <outputs>
-   <data format="tabular" name="output_tab" label="tabular file" />
+   <data format="tabular" name="output_tab" label="Map dataframe" />
+   <data format="tabular" name="output_sizes" label="Size dataframe" >
+       <filter>extra_plot == "Sizes"</filter>
+   </data>
    <data format="pdf" name="output_pdf" label="PDF file" />
+
 </outputs>
 
     <tests>
         <test>
             <param name="input" value="input1.bam,input2.bam" ftype="bam"/>
+            <param name="extra_plot" value="Mean" />
             <output file="output.tab" name="output_tab" />
-            <output file="output_lattice.pdf" name="output_pdf" />
+            <output file="mean.pdf" name="output_pdf" />
+        </test>
+        <test>
+            <param name="input" value="input1.bam,input1.bam" ftype="bam"/>
+            <param name="extra_plot" value="Mean" />
+            <output file="doubled.tab" name="output_tab" />
+            <output file="doubled_mean.pdf" name="output_pdf" />
+        </test>
+        <test>
+            <param name="input" value="input1.bam,input2.bam" ftype="bam"/>
+            <param name="extra_plot" value="Median" />
+            <output file="output.tab" name="output_tab" />
+            <output file="median.pdf" name="output_pdf" />
         </test>
         <test>
             <param name="input" value="input1.bam,input1.bam" ftype="bam"/>
-            <output file="output_doubled.tab" name="output_tab" />
-            <output file="output_lattice_doubled.pdf" name="output_pdf" />
+            <param name="extra_plot" value="Median" />
+            <output file="doubled.tab" name="output_tab" />
+            <output file="doubled_median.pdf" name="output_pdf" />
+        </test>
+        <test>
+            <param name="input" value="input1.bam,input2.bam" ftype="bam"/>
+            <param name="extra_plot" value="Coverage" />
+            <output file="output.tab" name="output_tab" />
+            <output file="coverage.pdf" name="output_pdf" />
+        </test>
+        <test>
+            <param name="input" value="input1.bam,input1.bam" ftype="bam"/>
+            <param name="extra_plot" value="Coverage" />
+            <output file="doubled.tab" name="output_tab" />
+            <output file="doubled_coverage.pdf" name="output_pdf" />
+        </test>
+        <test>
+            <param name="input" value="input1.bam,input2.bam" ftype="bam"/>
+            <param name="extra_plot" value="Sizes" />
+            <output file="output.tab" name="output_tab" />
+            <output file="sizes.tab" name="output_sizes" />
+            <output file="sizes.pdf" name="output_pdf" />
         </test>
     </tests>
 
@@ -54,10 +109,15 @@
 In addition to the read counts (bars), median size and mean size of reads mapping at a given position are plotted in the graphs.	
 
 **Inputs**
-Bam alignment files. Be carreful to select Bam corresponding to alignments to the same reference
+
+bam alignment files that *must* be
+
+  - sorted
+  - mapping to the same reference
 
 **Output**
-A pdf file generated by the R package ggplot2
+
+A pdf file generated by the R package lattice
 
 </help>