1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/2a43d292c097/ changeset: 2a43d292c097 user: joachimjacob date: 2013-01-30 10:38:58 summary: Adjusted trimming tool to include negative positions. Modified help and test. affected #: 2 files
diff -r 301d7447dd22fcfcbd7c4f5c5737fd0fdc82690b -r 2a43d292c0977e0fe82088ac106c119ffd866baa tools/filters/trimmer.py --- a/tools/filters/trimmer.py +++ b/tools/filters/trimmer.py @@ -88,6 +88,9 @@ if col == 0: if int( options.end ) > 0: line = line[ int( options.start )-1 : int( options.end ) ] + elif int( options.end ) < 0: + endposition = len(line)+int( options.end ) + line = line[ int( options.start )-1 : endposition ] else: line = line[ int( options.start )-1 : ] else: @@ -97,6 +100,9 @@
if int( options.end ) > 0: fields[col - 1] = fields[col - 1][ int( options.start )-1 : int( options.end ) ] + elif int( options.end ) < 0: + endposition = len(fields[col - 1])+int( options.end ) + fields[col - 1] = fields[col - 1][ int( options.start )-1 : endposition ] else: fields[col - 1] = fields[col - 1][ int( options.start )-1 : ] line = '\t'.join(fields)
diff -r 301d7447dd22fcfcbd7c4f5c5737fd0fdc82690b -r 2a43d292c0977e0fe82088ac106c119ffd866baa tools/filters/trimmer.xml --- a/tools/filters/trimmer.xml +++ b/tools/filters/trimmer.xml @@ -6,9 +6,9 @@ <inputs><param format="tabular,txt" name="input1" type="data" label="this 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 to this position" help="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="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...)"> + <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><option value="-q">Yes</option></param> @@ -53,7 +53,15 @@ <param name="fastq" value="No"/><output name="out_file1" file="trimmer_a_f_c2_s1_e2_i62.dat"/></test> - + <test> + <param name="input1" value="trimmer_tab_delimited.dat"/> + <param name="col" value="2"/> + <param name="start" value="2"/> + <param name="end" value="-2"/> + <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></tests><help> @@ -72,7 +80,7 @@ 1234567890 abcdefghijk
-by setting **Trim from the beginning to this position** to *2* and **Remove everything from this position to the end** to *6* will produce:: +by setting **Trim from the beginning up to this position** to *2* and **Remove everything from this position to the end** to *6* will produce::
23456 bcdef @@ -86,13 +94,27 @@ abcde 12345 fghij 67890 fghij 67890 abcde 12345
-by setting **Trim content of this column only** to *2*, **Trim from the beginning to this position** to *2*, and **Remove everything from this position to the end** to *4* will produce:: +by setting **Trim content of this column only** to *2*, **Trim from the beginning up to this position** to *2*, and **Remove everything from this position to the end** to *4* will produce::
abcde 234 fghij 67890 fghij 789 abcde 12345
-----
+**Example 3** + +Trimming column 2 of this dataset:: + + abcde 12345 fghij 67890 + fghij 67890 abcde 12345 + +by setting **Trim content of this column only** to *2*, **Trim from the beginning up to this position** to *2*, and **Remove everything from this position to the end** to *-2* will produce:: + + abcde 23 fghij 67890 + fghij 78 abcde 12345 + +---- + **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::
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.