changeset 3:edae148b2dd4

Add tool-test.
author mvdbeek
date Tue, 27 Jan 2015 17:44:42 +0100
parents 2417a9361d1a
children dd09eada7b78
files mismatch_frequencies.xml test-data/3mismatches_ago2ip_ovary.bam test-data/3mismatches_ago2ip_s2.bam test-data/mismatch.pdf test-data/mismatch.tab
diffstat 5 files changed, 36 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/mismatch_frequencies.xml	Tue Jan 27 05:57:44 2015 -0500
+++ b/mismatch_frequencies.xml	Tue Jan 27 17:44:42 2015 +0100
@@ -1,11 +1,11 @@
 <tool id="mismatch_frequencies" name="Mismatch Frequencies" version="0.0.3" hidden="false" >
-	<description>Analyze mismatch frequencies in BAM/SAM alignments</description>
-        <requirements>
-    	    <requirement type="package" version="0.7.7">pysam</requirement>
-    	    <requirement type="package" version="0.14">pandas</requirement>
-    	    <requirement type="package" version="1.4">matplotlib</requirement>
-        </requirements>
-	<command interpreter="python">mismatch_frequencies.py --input 
+  <description>Analyze mismatch frequencies in BAM/SAM alignments</description>
+  <requirements>
+    <requirement type="package" version="0.7.7">pysam</requirement>
+    <requirement type="package" version="0.14">pandas</requirement>
+    <requirement type="package" version="1.4">matplotlib</requirement>
+  </requirements>
+  <command interpreter="python">mismatch_frequencies.py --input 
 		#for i in $rep
 			"$i.input_file" 
 		#end for
@@ -17,20 +17,30 @@
                  --n_mm $number_of_mismatches
                  --five_p $five_p
                  --three_p $three_p
-        </command>
-	<inputs>
-            <repeat name="rep" title="alignment files">
-        	<param name="input_file" type="data" format="bam,sam" label="Alignment file" help="The input alignment file(s) for which to analyze the mismatches."/>
-            </repeat>
-          <param name="number_of_mismatches" label="Maximum number of allowed mismatches per read" help="Discard reads with more than the chosen number of mismatches from the frequency calculation" type="integer" value="3"/>
-          <param name="min_length" label="Minumum read length to analyse" type="integer" value="21"/>
-	  <param name="max_length" label="Maximum read length to analyse" type="integer" value="21"/>
-	  <param name="five_p" label="Ignore mismatches in the first N nucleotides of a read" type="integer" value="0"/>
-	  <param name="three_p" label="Ignore mismatches in the last N nucleotides of a read" help="useful to discriminate between tailing events and editing events" type="integer" value="3"/>
-	</inputs>
-        <outputs>
-                <data format="pdf" name="output_pdf" />
-                <data format="tabular" name="output_tab" />
-        </outputs>
-
+  </command>
+  <inputs>
+    <repeat name="rep" title="alignment files">
+      <param name="input_file" type="data" format="bam,sam" label="Alignment file" help="The input alignment file(s) for which to analyze the mismatches."/>
+    </repeat>
+    <param name="number_of_mismatches" label="Maximum number of allowed mismatches per read" help="Discard reads with more than the chosen number of mismatches from the frequency calculation" type="integer" value="3"/>
+    <param name="min_length" label="Minumum read length to analyse" type="integer" value="21"/>
+    <param name="max_length" label="Maximum read length to analyse" type="integer" value="21"/>
+    <param name="five_p" label="Ignore mismatches in the first N nucleotides of a read" type="integer" value="0"/>
+    <param name="three_p" label="Ignore mismatches in the last N nucleotides of a read" help="useful to discriminate between tailing events and editing events" type="integer" value="3"/>
+  </inputs>
+  <outputs>
+    <data format="tabular" name="output_tab" />
+    <data format="pdf" name="output_pdf" />
+  </outputs>
+  <tests>
+    <test>
+      <param name="rep_0|input_file" value="3mismatches_ago2ip_s2.bam" ftype="bam" />
+      <param name="rep_1|input_file" value="3mismatches_ago2ip_s2.bam" ftype="bam" />
+      <param name="number_of_mismatches" value="1" />
+      <param name="min_length" value="21" />
+      <param name="max_length" value="21" />
+      <output name="tabular" file="mismatch.tab" ftype="tabular"/>
+      <output name="pdf" file="mismatch.pdf" ftype="pdf"/>
+    </test>
+  </tests>
 </tool>
Binary file test-data/3mismatches_ago2ip_ovary.bam has changed
Binary file test-data/3mismatches_ago2ip_s2.bam has changed
Binary file test-data/mismatch.pdf has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/mismatch.tab	Tue Jan 27 17:44:42 2015 +0100
@@ -0,0 +1,3 @@
+library	readsize	A to C	A to G	A to T	C to A	C to G	C to T	G to A	G to C	G to T	T to A	T to C	T to G	total_mapped
+3mismatches_ago2ip_s2.bam	21	31	5484	69	25	40	137	156	109	188	51	196	29	43881
+3mismatches_ago2ip_ovary.bam	21	293	879	411	452	231	872	845	191	473	384	818	324	138649