Merge pull request #3869 from nsoranzo/trimmer

Use detect_errors="exit_code" in Trim tool
This commit is contained in:
Björn Grüning
2017-04-04 23:27:12 +02:00
committed by GitHub
2 changed files with 16 additions and 17 deletions
+1 -2
View File
@@ -6,8 +6,7 @@ import sys
def stop_err( msg ):
sys.stderr.write( msg )
sys.exit()
sys.exit(msg)
def main():
+15 -15
View File
@@ -1,20 +1,20 @@
<tool id="trimmer" name="Trim" version="0.0.1">
<description>leading or trailing characters</description>
<command>
<command detect_errors="exit_code">
<![CDATA[
python $__tool_directory__/trimmer.py -a -f '$input1' -c $col -s $start -e $end -i '$ignore' $fastq > '$out_file1'
python '$__tool_directory__/trimmer.py' -a -f '$input1' -c $col -s $start -e $end -i '$ignore' $fastq > '$out_file1'
]]>
</command>
<inputs>
<param format="tabular,txt" name="input1" type="data" label="this dataset"/>
<param name="input1" type="data" format="tabular,txt" label="Input dataset" />
<param name="col" type="integer" value="0" label="Trim this column only" help="0 = process entire line" />
<param name="start" type="integer" size="10" value="1" label="Trim from the beginning up to this position" help="Only positive positions allowed. 1 = do not trim the beginning"/>
<param name="end" type="integer" size="10" value="0" label="Remove everything from this position to the end" help="Use negative position to indicate position starting from the end. 0 = do not trim the end"/>
<param name="fastq" type="select" label="Is input dataset in fastq format?" help="If set to YES, the tool will not trim evenly numbered lines (0, 2, 4, etc...). This allows for trimming the seq and qual lines, only if they are not spread over multiple lines (see warning below).">
<option selected="true" value="">No</option>
<param name="start" type="integer" value="1" label="Trim from the beginning up to this position" help="Only positive positions allowed. 1 = do not trim the beginning"/>
<param name="end" type="integer" value="0" label="Remove everything from this position to the end" help="Use negative position to indicate position starting from the end. 0 = do not trim the end"/>
<param name="fastq" type="select" label="Is input dataset in FASTQ format?" help="If set to 'Yes', the tool will not trim evenly numbered lines (0, 2, 4, etc...). This allows for trimming the seq and qual lines, only if they are not spread over multiple lines (see warning below)">
<option value="" selected="true">No</option>
<option value="-q">Yes</option>
</param>
<param name="ignore" type="select" display="checkboxes" multiple="True" label="Ignore lines beginning with these characters" help="lines beginning with these are not trimmed">
<param name="ignore" type="select" display="checkboxes" multiple="true" label="Ignore lines beginning with these characters" help="Lines beginning with these are not trimmed">
<option value="62">&gt;</option>
<option value="64">@</option>
<option value="43">+</option>
@@ -31,7 +31,7 @@ python $__tool_directory__/trimmer.py -a -f '$input1' -c $col -s $start -e $end
<option value="37">%</option>
<option value="94">^</option>
<option value="35">&#35;</option>
</param>
</param>
</inputs>
<outputs>
<data name="out_file1" format_source="input1" metadata_source="input1"/>
@@ -63,7 +63,7 @@ python $__tool_directory__/trimmer.py -a -f '$input1' -c $col -s $start -e $end
<param name="ignore" value="62"/>
<param name="fastq" value="No"/>
<output name="out_file1" file="trimmer_a_f_c2_s2_e-2_i62.dat"/>
</test>
</test>
</tests>
<help>
@@ -117,24 +117,24 @@ by setting **Trim content of this column only** to *2*, **Trim from the beginnin
**Trimming FASTQ datasets**
This tool can be used to trim sequences and quality strings in fastq datasets. This is done by selected *Yes* from the **Is input dataset in fastq format?** dropdown. If set to *Yes*, the tool will skip all even numbered lines (see warning below). For example, trimming last 5 bases of this dataset::
This tool can be used to trim sequences and quality strings in FASTQ datasets. This is done by selected *Yes* from the **Is input dataset in FASTQ format?** dropdown. If set to *Yes*, the tool will skip all even numbered lines (see warning below). For example, trimming last 5 bases of this dataset::
@081017-and-081020:1:1:1715:1759
GGACTCAGATAGTAATCCACGCTCCTTTAAAATATC
+
II#IIIIIII$5+.(9IIIIIII$%*$G$A31I&amp;&amp;B
cab done by setting **Remove everything from this position to the end** to 31::
@081017-and-081020:1:1:1715:1759
GGACTCAGATAGTAATCCACGCTCCTTTAAA
+
II#IIIIIII$5+.(9IIIIIII$%*$G$A3
II#IIIIIII$5+.(9IIIIIII$%*$G$A3
**Note** that headers are skipped.
.. class:: warningmark
**WARNING:** This tool will only work on properly formatted fastq datasets where (1) each read and quality string occupy one line and (2) '@' (read header) and "+" (quality header) lines are evenly numbered like in the above example.
**WARNING:** This tool will only work on properly formatted FASTQ datasets where (1) each read and quality string occupy one line and (2) '@' (read header) and "+" (quality header) lines are evenly numbered like in the above example.
</help>
</tool>