changeset 10:5108a91b93fe

Uploaded
author boris
date Fri, 20 Apr 2012 15:23:31 -0400
parents 20b654fe58e2
children 8a56e45f925f
files MDtag_filter.xml
diffstat 1 files changed, 35 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/MDtag_filter.xml	Fri Apr 20 15:23:12 2012 -0400
+++ b/MDtag_filter.xml	Fri Apr 20 15:23:31 2012 -0400
@@ -1,13 +1,28 @@
 <tool id="MDtag_filter" name="Filter mapped reads">
   <description>on MD tag string</description>
-  <command interpreter="python">MDtag_filter.py $in_sam $n $m $out_sam</command>
+  <command interpreter="python">MDtag_filter.py $in_sam $n $m $out_sam ${create.choice} $discarded_sam</command>
   <inputs>
     <param format="sam" name="in_sam" type="data" label="Input SAM file"/>
-    <param name="n" type="integer" value='0' label="Number of bases to look at the start of the mapped read (n)"/>
-    <param name="m" type="integer" value='0' label="Number of bases to look at the end of the mapped read (m)"/>
+    <param name="n" type="integer" value='0' label="5' end window (n)" help="Any number of mismatches within this window will cause the read to be discarded"/>
+    <param name="m" type="integer" value='0' label="3' end window (m)" help="Any number of mismatches within this window will cause the read to be discarded"/>
+    <conditional name="create">
+      <param name="choice" type="select" label="Create additional SAM file for discarded reads?">
+	<option value="no" selected="true">No</option>
+	<option value="yes">Yes</option>
+      </param>
+      <when value="no">
+      <!-- do nothing here -->
+      </when>
+      <when value="yes">
+      <!-- do nothing here -->
+      </when>
+    </conditional>
   </inputs>
   <outputs>
-    <data format="sam" name="out_sam" metadata_source="in_sam" />
+    <data format="sam" name="out_sam" label="MDtag_filter_(selected)_from_${in_sam.name}" metadata_source="in_sam"/>
+    <data format="sam" name="discarded_sam" label="MDtag_filter_(discarded)_from_${in_sam.name}" metadata_source="in_sam">
+      <filter> (create['choice']=='yes') </filter>
+    </data>  
   </outputs>
   <tests>
     <test>
@@ -16,11 +31,20 @@
       <param name="m" value="5"/>
       <output name="out_sam" file="test_md_filtered.sam"/>
     </test>
+    <test>
+      <param name="in_sam" value="test_for_md_filter.sam"/>
+      <param name="n" value="5"/>
+      <param name="m" value="5"/>
+      <param name="choice" value="yes"/>
+      <output name="out_sam" file="test_md_selected.sam"/>
+      <output name="discarded_sam" file="test_md_discarded.sam"/>
+    </test>
   </tests>
 
   <help>
-Mismatches at the start and end of a mapped read are most likely sequencing errors.
-This tool aims to control the variation noise due to sequencing errors.
+    
+Mismatches at either end of a mapped read are most likely sequencing errors.
+This tool aims to control the variation noise due to potential sequencing errors. 
 
 -----
 
@@ -28,8 +52,10 @@
 
 **What it does**
 
-This tool reads the MD tag string of mapped reads. It discards mapped reads that contain variation at either end.
-The user defines n and m. The mapped read is discarded if it contains any number of mismatches within **n** bases of the read start and within **m** bases of the read end.
+This tool reads the MD tag of mapped reads (see SAM format specification). The user defines the 5' and 3' windows **n** and **m** (in bp), respectively.
+The mapped read is discarded if it contains any number of mismatches within **n** bases of the read 5' end and within **m** bases of the read 3' end.
+The resulting SAM file is enriched for mapped reads that show internal variation (if any) over reads whose variation is found within the read ends.
+The user might also want to keep the discarded reads in an additional file.
 
 -----
 
@@ -37,7 +63,7 @@
 
 **Note**
 
-Mapped reads without an MD tag will be removed from the output SAM file.
+Mapped reads without an MD tag will be removed from the output SAM file(s).
 
 -----