changeset 2:4ce5e195f496 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ngsutils commit 09194687c74a424732f8b0c017cbb942aad89068
author iuc
date Wed, 11 Nov 2015 13:03:30 -0500
parents a0264bbe8682
children 954ad23300ce
files bam_filter.xml macros.xml ngsutils/__init__.pyc ngsutils/bam/__init__.pyc ngsutils/bed/__init__.pyc ngsutils/support/__init__.pyc ngsutils/support/dbsnp.pyc ngsutils/support/ngs_utils.pyc test-data/ngsutils_bam_filter_result4.bam
diffstat 9 files changed, 46 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/bam_filter.xml	Tue Nov 10 15:08:52 2015 -0500
+++ b/bam_filter.xml	Wed Nov 11 13:03:30 2015 -0500
@@ -7,9 +7,22 @@
     <expand macro="stdio" />
     <expand macro="version" />
     <command><![CDATA[
+    ## If the tool is executed with no filtering option,
+    ## the default parameters simply copy over the input file
+    if grep -q "\w" ${parameters};
+    then
         $__tool_directory__/filter.py
         $infile
         $outfile
+        `cat ${parameters}`;
+    else
+        cp $infile $outfile;
+    fi
+]]>
+    </command>
+    <configfiles>
+        <configfile name="parameters">
+<![CDATA[
         #if $minlen:
             -minlen $minlen
         #end if
@@ -21,7 +34,7 @@
         $properpair
         $noproperpair
         #if $mask:
-            -mask $mask
+            -mask "${mask}"
         #end if
         #if int($uniq) > -1:
             -uniq
@@ -30,7 +43,6 @@
             #end if
         #end if
         $uniq_start
-
         #if $mismatch:
             -mismatch $mismatch
         #end if
@@ -38,24 +50,25 @@
         $noqcfail
         $nopcrdup
         #if $excludebed:
-            -excludebed $ignore_strand
+            -excludebed "${excludebed}" $ignore_strand
         #end if
         #if $includebed:
-            -includebed $ignore_strand
+            -includebed "${includebed}" $ignore_strand
         #end if
         #if $includeref:
-            -includeref $includeref
+            -includeref "${includeref}"
         #end if
         #if $excluderef:
-            -excluderef $excluderef
+            -excluderef "${excluderef}"
         #end if
         #if $maximum_mismatch_ratio
             -maximum_mismatch_ratio $maximum_mismatch_ratio
         #end if
-]]>
-    </command>
+    ]]>
+        </configfile>
+    </configfiles>
     <inputs>
-        <param name="infile" type="data" format="bam" label="Select SAM/BAM dataset" />
+        <param name="infile" type="data" format="bam" label="Select BAM dataset" />
         <param argument="-minlen" type="integer" value="" optional="True" min="0"
             label="Remove reads that are smaller than"
             help="in bp"/>
@@ -72,14 +85,15 @@
             label="Keep only properly paired reads"
             help="both mapped, correct orientation, flag set in BAM" />
         <param argument="-noproperpair" truevalue="-noproperpair" type="boolean" falsevalue=""
-            label="Keep only not-properly paired reads"
+            label="Discard properly paired reads"
             help="" />
         <param argument="-mask" type="text" value="" optional="True" label="Remove reads that match the mask"
-            help="base 10/hex based" />
+            help="e.g. 0x400, 0x2" />
 
         <param argument="-uniq" type="integer" value="-1" optional="True" min="-1"
             label="Remove reads that have the same sequence"
-            help="up to an optional length. -1 means do not filter and 0 means check the entire sequence for uniqueness."/>
+            help="up to the Nth nucleotide starting from the 5prime end. -1 means do not filter, 0 means check along the entire read,
+                10 would make filter reads that are unique over the first 10 nucleotides."/>
 
         <param argument="-uniq_start" truevalue="-uniq_start" type="boolean" falsevalue=""
             label="Remove reads that start at the same position"
@@ -90,17 +104,14 @@
             help="Indels always counts as 1 regardless of length. Requires NM tag to be set."/>
 
         <param argument="-nosecondary" truevalue="-nosecondary" type="boolean" falsevalue=""
-            label="Remove reads that have the 0x100 flag set"
-            help="" />
-        <param argument="-nosecondary" truevalue="-nosecondary" type="boolean" falsevalue=""
-            label="Remove reads that have the 0x100 flag set"
-            help="" />
+            label="Remove secondary alignment reads"
+            help="Remove reads flagged with 0x100" />
         <param argument="-noqcfail" truevalue="-noqcfail" type="boolean" falsevalue=""
-            label="Remove reads that have the 0x200 flag set"
-            help="" />
+            label="Remove reads that do not pass the quality control"
+            help="Remove reads flagged with 0x200" />
         <param argument="-nopcrdup" truevalue="-nopcrdup" type="boolean" falsevalue=""
-            label="Remove reads that have the 0x400 flag set"
-            help="" />
+            label="Remove reads that are marked as PCR dupicates "
+            help="Remove reads flagged with 0x400" />
 
         <param argument="-excludebed" type="data" optional="True" format="bed" label="Remove reads that are in any of the regions" />
         <param argument="-includebed" type="data" optional="True" format="bed" label="Remove reads that are NOT any of the regions" />
@@ -142,13 +153,21 @@
             <param name="nopcrdup" value="True"/>
             <output name="outfile" file="ngsutils_bam_filter_result3.bam" ftype="bam" />
         </test>
+        <test>
+            <param name="infile" ftype="bam" value="ngsutils_bam_filter_input1.bam"/>
+            <output name="outfile" file="ngsutils_bam_filter_input1.bam" ftype="bam" />
+        </test>
+        <test>
+            <param name="infile" ftype="bam" value="ngsutils_bam_filter_input1.bam"/>
+            <param name="mask" value="0x40"/>
+            <output name="outfile" file="ngsutils_bam_filter_result4.bam" ftype="bam" />
+        </test>
     </tests>
     <help><![CDATA[
-Removes reads from a BAM file based on criteria
+Removes reads from a BAM file based on criteria.
 
-Given a BAM file, this script will only allow reads that meet filtering
-criteria to be written to output. The output is another BAM file with the
-reads not matching the criteria removed.
+Given a BAM file, this tool will discard reads that did not meet the selected filtering criteria
+The output is another BAM file with the reads not matching the criteria removed.
 
 Note: this does not adjust tag values reflecting any filtering. (for example:
       if a read mapped to two locations (IH:i:2), and one was removed by
@@ -172,7 +191,7 @@
 +--------------------------------+-------------------------------------------------+
 | -noproperpair                  | Keep only not-properly paired reads             |
 +--------------------------------+-------------------------------------------------+
-| -mask bitmask                  | Remove reads that match the mask (base 10/hex)  |
+| -mask bitmask                  | Remove reads that match the mask (e.g. 0x400)   |
 +--------------------------------+-------------------------------------------------+
 | -uniq {length}                 | Remove reads that are have the same sequence    |
 |                                | Note: BAM file should be sorted                 |
--- a/macros.xml	Tue Nov 10 15:08:52 2015 -0500
+++ b/macros.xml	Wed Nov 11 13:03:30 2015 -0500
@@ -2,6 +2,7 @@
     <token name="@WRAPPER_VERSION@">0.5.7</token>
     <xml name="requirements">
         <requirements>
+            <requirement type="package" version="0.7.7">pysam</requirement>
         </requirements>
     </xml>
     <xml name="version">
Binary file ngsutils/__init__.pyc has changed
Binary file ngsutils/bam/__init__.pyc has changed
Binary file ngsutils/bed/__init__.pyc has changed
Binary file ngsutils/support/__init__.pyc has changed
Binary file ngsutils/support/dbsnp.pyc has changed
Binary file ngsutils/support/ngs_utils.pyc has changed
Binary file test-data/ngsutils_bam_filter_result4.bam has changed