Repository 'fastq_trimmer'
hg clone https://toolshed.g2.bx.psu.edu/repos/devteam/fastq_trimmer

Changeset 2:430b9da91435 (2017-09-30)
Previous changeset 1:e0cfb5a703ce (2015-11-11) Next changeset 3:2d0d13b0b0f1 (2017-11-21)
Commit message:
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/galaxy_sequence_utils/fastq_trimmer commit f2582539542b33240234e8ea6093e25d0aee9b6a
modified:
fastq_trimmer.xml
removed:
fastq_trimmer.py
tool_dependencies.xml
b
diff -r e0cfb5a703ce -r 430b9da91435 fastq_trimmer.py
--- a/fastq_trimmer.py Wed Nov 11 12:42:58 2015 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
@@ -1,41 +0,0 @@
-#Dan Blankenberg
-import sys
-from galaxy_utils.sequence.fastq import fastqReader, fastqWriter
-
-def main():
-    input_filename = sys.argv[1]
-    output_filename = sys.argv[2]
-    left_offset = sys.argv[3]
-    right_offset = sys.argv[4]
-    percent_offsets = sys.argv[5] == 'offsets_percent'
-    input_type = sys.argv[6] or 'sanger'
-    keep_zero_length = sys.argv[7] == 'keep_zero_length'
-    
-    out = fastqWriter( open( output_filename, 'wb' ), format = input_type )
-    num_reads_excluded = 0
-    num_reads = None
-    for num_reads, fastq_read in enumerate( fastqReader( open( input_filename ), format = input_type ) ):
-        if percent_offsets:
-            left_column_offset = int( round( float( left_offset ) / 100.0 * float( len( fastq_read ) ) ) )
-            right_column_offset = int( round( float( right_offset ) / 100.0 * float( len( fastq_read ) ) ) )
-        else:
-            left_column_offset = int( left_offset )
-            right_column_offset = int( right_offset )
-        if right_column_offset > 0:
-            right_column_offset = -right_column_offset
-        else:
-            right_column_offset = None
-        fastq_read = fastq_read.slice( left_column_offset, right_column_offset )
-        if keep_zero_length or len( fastq_read ):
-            out.write( fastq_read )
-        else:
-            num_reads_excluded += 1
-    out.close()
-    if num_reads is None:
-        print "No valid fastq reads could be processed."
-    else:
-        print "%i fastq reads were processed." % ( num_reads + 1 )
-    if num_reads_excluded:
-        print "%i reads of zero length were excluded from the output." % num_reads_excluded
-
-if __name__ == "__main__": main()
b
diff -r e0cfb5a703ce -r 430b9da91435 fastq_trimmer.xml
--- a/fastq_trimmer.xml Wed Nov 11 12:42:58 2015 -0500
+++ b/fastq_trimmer.xml Sat Sep 30 13:55:56 2017 -0400
[
b'@@ -1,125 +1,112 @@\n-<tool id="fastq_trimmer" name="FASTQ Trimmer" version="1.0.0">\n-  <description>by column</description>\n-  <requirements>\n-    <requirement type="package" version="1.0.0">galaxy_sequence_utils</requirement>\n-  </requirements>\n-  <command interpreter="python">fastq_trimmer.py \'$input_file\' \'$output_file\' \'${offset_type[\'left_column_offset\']}\' \'${offset_type[\'right_column_offset\']}\' \'${offset_type[\'base_offset_type\']}\' \'${input_file.extension[len( \'fastq\' ):]}\' \'$keep_zero_length\'</command>\n-  <inputs>\n-    <param name="input_file" type="data" format="fastqsanger,fastqcssanger" label="FASTQ File"/>\n-    <conditional name="offset_type">\n-      <param name="base_offset_type" type="select" label="Define Base Offsets as" help="Use Absolute for fixed length reads (Illumina, SOLiD)&lt;br&gt;Use Percentage for variable length reads (Roche/454)">\n-        <option value="offsets_absolute" selected="true">Absolute Values</option>\n-        <option value="offsets_percent">Percentage of Read Length</option>\n-      </param>\n-      <when value="offsets_absolute">\n-        <param name="left_column_offset" label="Offset from 5\' end" value="0" type="integer" help="Values start at 0, increasing from the left">\n-          <validator type="in_range" message="Base Offsets must be positive" min="0" max="inf"/>\n-          <validator type="expression" message="An integer is required.">int( float( value ) ) == float( value )</validator>\n-        </param>\n-        <param name="right_column_offset" label="Offset from 3\' end" value="0" type="integer" help="Values start at 0, increasing from the right">\n-          <validator type="in_range" message="Base Offsets must be positive" min="0" max="inf"/>\n-          <validator type="expression" message="An integer is required.">int( float( value ) ) == float( value )</validator>\n-        </param>\n-      </when>\n-      <when value="offsets_percent">\n-        <param name="left_column_offset" label="Offset from 5\' end" value="0" type="float">\n-          <validator type="in_range" message="Base Offsets must be between 0 and 100" min="0" max="100"/>\n-        </param>\n-        <param name="right_column_offset" label="Offset from 3\' end" value="0" type="float">\n-          <validator type="in_range" message="Base Offsets must be between 0 and 100" min="0" max="100"/>\n-        </param>\n-      </when>\n-    </conditional>\n-  <param name="keep_zero_length" label="Keep reads with zero length" type="boolean" truevalue="keep_zero_length" falsevalue="exclude_zero_length" selected="False"/>\n-  </inputs>\n-  <outputs>\n-    <data name="output_file" format="input" />\n-  </outputs>\n-  <tests>\n-    <test>\n-      <!-- Do nothing trim -->\n-      <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />\n-      <param name="base_offset_type" value="offsets_absolute"/>\n-      <param name="left_column_offset" value="0"/>\n-      <param name="right_column_offset" value="0"/>\n-      <param name="keep_zero_length" value="keep_zero_length" />\n-      <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" />\n-    </test>\n-    <!-- Trim to empty File -->\n-    <test>\n-      <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />\n-      <param name="base_offset_type" value="offsets_absolute"/>\n-      <param name="left_column_offset" value="30"/>\n-      <param name="right_column_offset" value="64"/>\n-      <param name="keep_zero_length" value="exclude_zero_length" />\n-      <output name="output_file" file="empty_file.dat" />\n-    </test>\n-    <test>\n-      <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />\n-      <param name="base_offset_type" value="offsets_percent"/>\n-      <param name="left_column_offset" value="50"/>\n-      <param name="right_column_offset" value="50"/>\n-      <param name="keep_zero_length" value="exclude_zero_length" />\n-      <output name="output_'..b'         <param name="left_column_offset" value="0"/>\n+            <param name="right_column_offset" value="0"/>\n+            <param name="keep_zero_length" value="keep_zero_length" />\n+            <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />\n+        </test>\n+        <!-- Trim to empty File -->\n+        <test>\n+            <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />\n+            <param name="base_offset_type" value="offsets_absolute"/>\n+            <param name="left_column_offset" value="30"/>\n+            <param name="right_column_offset" value="64"/>\n+            <param name="keep_zero_length" value="exclude_zero_length" />\n+            <output name="output_file" file="empty_file.dat" ftype="fastqsanger" />\n+        </test>\n+        <test>\n+            <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />\n+            <param name="base_offset_type" value="offsets_percent"/>\n+            <param name="left_column_offset" value="50"/>\n+            <param name="right_column_offset" value="50"/>\n+            <param name="keep_zero_length" value="exclude_zero_length" />\n+            <output name="output_file" file="empty_file.dat" ftype="fastqsanger" />\n+        </test>\n+        <!-- Trim to 4 inner-most bases -->\n+        <test>\n+            <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />\n+            <param name="base_offset_type" value="offsets_absolute"/>\n+            <param name="left_column_offset" value="45"/>\n+            <param name="right_column_offset" value="45"/>\n+            <param name="keep_zero_length" value="exclude_zero_length" />\n+            <output name="output_file" file="fastq_trimmer_out1.fastqsanger" ftype="fastqsanger" />\n+        </test>\n+        <test>\n+            <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />\n+            <param name="base_offset_type" value="offsets_percent"/>\n+            <param name="left_column_offset" value="47.87"/>\n+            <param name="right_column_offset" value="47.87"/>\n+            <param name="keep_zero_length" value="exclude_zero_length" />\n+            <output name="output_file" file="fastq_trimmer_out1.fastqsanger" ftype="fastqsanger" />\n+        </test>\n+    </tests>\n+    <help><![CDATA[\n **What is does**\n-    \n+\n This tool allows you to trim the ends of reads.\n \n-You can specify either absolute or percent-based offsets. Offsets are calculated, starting at 0, from the respective end to be trimmed. When using the percent-based method, offsets are rounded to the nearest integer. \n+You can specify either absolute or percent-based offsets. Offsets are calculated, starting at 0, from the respective end to be trimmed. When using the percent-based method, offsets are rounded to the nearest integer.\n \n For example, if you have a read of length 36::\n-  \n+\n   @Some FASTQ Sanger Read\n   CAATATGTNCTCACTGATAAGTGGATATNAGCNCCA\n   +\n-  =@@.@;B-%?8&gt;CBA@&gt;7@7BBCA4-48%&lt;;;%&lt;B@\n-  \n+  =@@.@;B-%?8>CBA@>7@7BBCA4-48%<;;%<B@\n+\n And you set absolute offsets of 2 and 9::\n-  \n+\n   @Some FASTQ Sanger Read\n   ATATGTNCTCACTGATAAGTGGATA\n   +\n-  @.@;B-%?8&gt;CBA@&gt;7@7BBCA4-4\n-  \n+  @.@;B-%?8>CBA@>7@7BBCA4-4\n+\n Or you set percent offsets of 6% and 20% (corresponds to absolute offsets of 2,7 for a read length of 36)::\n-  \n+\n   @Some FASTQ Sanger Read\n   ATATGTNCTCACTGATAAGTGGATATN\n   +\n-  @.@;B-%?8&gt;CBA@&gt;7@7BBCA4-48%\n-  \n+  @.@;B-%?8>CBA@>7@7BBCA4-48%\n+\n -----\n \n .. class:: warningmark\n \n Trimming a color space read will cause any adapter base to be lost.\n-\n-------\n-\n-  </help>\n-  \n-  <citations>\n-    <citation type="doi">10.1093/bioinformatics/btq281</citation>\n-  </citations>\n-  \n+    ]]></help>\n+    <citations>\n+        <citation type="doi">10.1093/bioinformatics/btq281</citation>\n+    </citations>\n </tool>\n'
b
diff -r e0cfb5a703ce -r 430b9da91435 tool_dependencies.xml
--- a/tool_dependencies.xml Wed Nov 11 12:42:58 2015 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -1,6 +0,0 @@
-<?xml version="1.0"?>
-<tool_dependency>
-  <package name="galaxy_sequence_utils" version="1.0.0">
-      <repository changeset_revision="0643676ad5f7" name="package_galaxy_utils_1_0" owner="devteam" toolshed="https://toolshed.g2.bx.psu.edu" />
-    </package>
-</tool_dependency>