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

Changeset 2:71e5fa25b8a2 (2017-09-30)
Previous changeset 1:e4d28c94242d (2015-11-11) Next changeset 3:8611b80a14d6 (2019-11-01)
Commit message:
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/galaxy_sequence_utils/fastq_groomer commit f2582539542b33240234e8ea6093e25d0aee9b6a
modified:
fastq_groomer.xml
added:
test-data/sanger_full_range_as_cssanger.fastqcssanger.bz2
test-data/sanger_full_range_original_sanger.fastqsanger.gz
removed:
fastq_groomer.py
tool_dependencies.xml
b
diff -r e4d28c94242d -r 71e5fa25b8a2 fastq_groomer.py
--- a/fastq_groomer.py Wed Nov 11 12:40:56 2015 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
[
@@ -1,42 +0,0 @@
-#Dan Blankenberg
-import sys
-from galaxy_utils.sequence.fastq import fastqReader, fastqVerboseErrorReader, fastqAggregator, fastqWriter
-
-def main():
-    input_filename = sys.argv[1]
-    input_type = sys.argv[2]
-    output_filename = sys.argv[3]
-    output_type = sys.argv[4]
-    force_quality_encoding = sys.argv[5]
-    summarize_input = sys.argv[6] == 'summarize_input'
-    if force_quality_encoding == 'None':
-        force_quality_encoding = None
-    
-    aggregator = fastqAggregator()
-    out = fastqWriter( open( output_filename, 'wb' ), format = output_type, force_quality_encoding = force_quality_encoding )
-    read_count = None
-    if summarize_input:
-        reader = fastqVerboseErrorReader
-    else:
-        reader = fastqReader
-    for read_count, fastq_read in enumerate( reader( open( input_filename ), format = input_type, apply_galaxy_conventions = True ) ):
-        if summarize_input:
-            aggregator.consume_read( fastq_read )
-        out.write( fastq_read )
-    out.close()
-    
-    if read_count is not None:
-        print "Groomed %i %s reads into %s reads." % ( read_count + 1, input_type, output_type )
-        if input_type != output_type and 'solexa' in [ input_type, output_type ]:
-            print "Converted between Solexa and PHRED scores."
-        if summarize_input:
-            print "Based upon quality and sequence, the input data is valid for: %s" % ( ", ".join( aggregator.get_valid_formats() )  or "None" )
-            ascii_range = aggregator.get_ascii_range()
-            decimal_range =  aggregator.get_decimal_range()
-            print "Input ASCII range: %s(%i) - %s(%i)" % ( repr( ascii_range[0] ), ord( ascii_range[0] ), repr( ascii_range[1] ), ord( ascii_range[1] ) ) #print using repr, since \x00 (null) causes info truncation in galaxy when printed
-            print "Input decimal range: %i - %i" % ( decimal_range[0], decimal_range[1] )        
-    else:
-        print "No valid FASTQ reads were provided."
-
-
-if __name__ == "__main__": main()
b
diff -r e4d28c94242d -r 71e5fa25b8a2 fastq_groomer.xml
--- a/fastq_groomer.xml Wed Nov 11 12:40:56 2015 -0500
+++ b/fastq_groomer.xml Sat Sep 30 14:58:07 2017 -0400
[
b'@@ -1,342 +1,377 @@\n-<tool id="fastq_groomer" name="FASTQ Groomer" version="1.0.4">\n-  <description>convert between various FASTQ quality formats</description>\n-  <requirements>\n-    <requirement type="package" version="1.0.0">galaxy_sequence_utils</requirement>\n-  </requirements>\n-  <command interpreter="python">fastq_groomer.py \'$input_file\' \'$input_type\' \'$output_file\'\n-#if str( $options_type[\'options_type_selector\'] ) == \'basic\':\n-#if str( $input_type ) == \'cssanger\':\n-\'cssanger\'\n+<tool id="fastq_groomer" name="FASTQ Groomer" version="1.1.1">\n+    <description>convert between various FASTQ quality formats</description>\n+    <requirements>\n+        <requirement type="package" version="1.1.1">galaxy_sequence_utils</requirement>\n+    </requirements>\n+    <command><![CDATA[\n+gx-fastq-groomer \'$input_file\'\n+#if $input_file.extension.endswith(".gz"):\n+    #set $suffix = ".gz"\n+#elif $input_file.extension.endswith(".bz2"):\n+    #set $suffix = ".bz2"\n #else:\n-\'sanger\'\n+#set $suffix = ""\n #end if\n-\'ascii\' \'summarize_input\'\n+$input_type$suffix \'$output_file\'\n+#if $options_type[\'options_type_selector\'] == \'basic\':\n+    #if str($input_type) == \'cssanger\':\n+        cssanger\n+    #else:\n+        sanger\n+    #end if\n+    ascii summarize_input\n #else:\n-\'${options_type.output_type}\' \'${options_type.force_quality_encoding}\' \'${options_type.summarize_input}\'\n+    ${options_type.output_type} ${options_type.force_quality_encoding} ${options_type.summarize_input}\n #end if\n-</command>\n-  <inputs>\n-    <param name="input_file" type="data" format="fastq" label="File to groom" />\n-    <param name="input_type" type="select" label="Input FASTQ quality scores type">\n-      <option value="solexa">Solexa</option>\n-      <option value="illumina">Illumina 1.3-1.7</option>\n-      <option value="sanger" selected="True">Sanger &amp; Illumina 1.8+</option>\n-      <option value="cssanger">Color Space Sanger</option>\n-    </param>\n-    <conditional name="options_type">\n-    <param name="options_type_selector" type="select" label="Advanced Options">\n-      <option value="basic" selected="True">Hide Advanced Options</option>\n-      <option value="advanced">Show Advanced Options</option>\n-    </param>\n-    <when value="basic">\n-      <!-- no options -->\n-    </when>\n-    <when value="advanced">\n-      <param name="output_type" type="select" label="Output FASTQ quality scores type" help="Galaxy tools are designed to work with the Sanger Quality score format.">\n-        <option value="solexa">Solexa</option>\n-        <option value="illumina">Illumina 1.3-1.7</option>\n-        <option value="sanger" selected="True">Sanger (recommended)</option>\n-        <option value="cssanger">Color Space Sanger</option>\n-      </param>\n-      <param name="force_quality_encoding" type="select" label="Force Quality Score encoding">\n-        <option value="None">Use Source Encoding</option>\n-        <option value="ascii" selected="True">ASCII</option>\n-        <option value="decimal">Decimal</option>\n-      </param>\n-      <param name="summarize_input" type="select" label="Summarize input data">\n-        <option value="summarize_input" selected="True">Summarize Input</option>\n-        <option value="dont_summarize_input">Do not Summarize Input (faster)</option>\n-      </param>\n-    </when>\n-  </conditional>\n-  </inputs>\n-  <outputs>\n-    <data name="output_file" format="fastqsanger">\n-      <change_format>\n-        <when input="input_type" value="cssanger" format="fastqcssanger" />\n-        <when input="options_type.output_type" value="solexa" format="fastqsolexa" />\n-        <when input="options_type.output_type" value="illumina" format="fastqillumina" />\n-        <when input="options_type.output_type" value="sanger" format="fastqsanger" />\n-        <when input="options_type.output_type" value="cssanger" format="fastqcssanger" />\n-      </change_format>\n-    </data>\n-  </outputs>\n-  <tests>\n-    <!-- These tests include test files adapted from supplemental material in Cock PJ, Field'..b'est>\n+            <param name="input_file" value="solexa_full_range_original_solexa.fastqsolexa" ftype="fastq" />\n+            <param name="input_type" value="solexa" />\n+            <param name="options_type_selector" value="advanced" />\n+            <param name="output_type" value="solexa" />\n+            <param name="force_quality_encoding" value="decimal" />\n+            <param name="summarize_input" value="summarize_input" />\n+            <output name="output_file" file="solexa_full_range_as_decimal_solexa.fastqsolexa" />\n+        </test>\n+        <!-- compressed formats -->\n+        <test>\n+            <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger.gz" ftype="fastq.gz" />\n+            <param name="input_type" value="sanger" />\n+            <param name="options_type_selector" value="basic" />\n+            <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" decompress="true" />\n+        </test>\n+        <test>\n+            <param name="input_file" value="sanger_full_range_as_cssanger.fastqcssanger.bz2" ftype="fastq.bz2" />\n+            <param name="input_type" value="cssanger" />\n+            <param name="options_type_selector" value="basic" />\n+            <output name="output_file" file="sanger_full_range_as_cssanger.fastqcssanger" decompress="true" />\n+        </test>\n+    </tests>\n+    <help><![CDATA[\n **What it does**\n \n This tool offers several conversions options relating to the FASTQ format.\n \n When using *Basic* options, the output will be *sanger* formatted or *cssanger* formatted (when the input is Color Space Sanger).\n \n-When converting, if a quality score falls outside of the target score range, it will be coerced to the closest available value (i.e. the minimum or maximum). \n+When converting, if a quality score falls outside of the target score range, it will be coerced to the closest available value (i.e. the minimum or maximum).\n \n When converting between Solexa and the other formats, quality scores are mapped between Solexa and PHRED scales using the equations found in `Cock PJ, Fields CJ, Goto N, Heuer ML, Rice PM. The Sanger FASTQ file format for sequences with quality scores, and the Solexa/Illumina FASTQ variants. Nucleic Acids Res. 2009 Dec 16.`_\n \n@@ -351,10 +386,10 @@\n     SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS\n     ...............................IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII\n     ..........................XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n-    !"#$%&amp;\'()*+,-./0123456789:;&lt;=&gt;?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\n+    !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\n     |                         |    |        |                              |                     |\n    33                        59   64       73                            104                   126\n-  \n+\n    S - Sanger       Phred+33,  93 values  (0, 93) (0 to 60 expected in raw reads)\n    I - Illumina 1.3 Phred+64,  62 values  (0, 62) (0 to 40 expected in raw reads)\n    X - Solexa       Solexa+64, 67 values (-5, 62) (-5 to 40 expected in raw reads)\n@@ -367,12 +402,9 @@\n \n ------\n \n-\n-.. _Cock PJ, Fields CJ, Goto N, Heuer ML, Rice PM. The Sanger FASTQ file format for sequences with quality scores, and the Solexa/Illumina FASTQ variants. Nucleic Acids Res. 2009 Dec 16.: http://www.ncbi.nlm.nih.gov/pubmed/20015970\n-\n-  </help>\n-  <citations>\n-    <citation type="doi">10.1093/bioinformatics/btq281</citation>\n-  </citations>\n-  \n+.. _Cock PJ, Fields CJ, Goto N, Heuer ML, Rice PM. The Sanger FASTQ file format for sequences with quality scores, and the Solexa/Illumina FASTQ variants. Nucleic Acids Res. 2009 Dec 16.: https://doi.org/10.1093/nar/gkp1137\n+    ]]></help>\n+    <citations>\n+        <citation type="doi">10.1093/bioinformatics/btq281</citation>\n+    </citations>\n </tool>\n'
b
diff -r e4d28c94242d -r 71e5fa25b8a2 test-data/sanger_full_range_as_cssanger.fastqcssanger.bz2
b
Binary file test-data/sanger_full_range_as_cssanger.fastqcssanger.bz2 has changed
b
diff -r e4d28c94242d -r 71e5fa25b8a2 test-data/sanger_full_range_original_sanger.fastqsanger.gz
b
Binary file test-data/sanger_full_range_original_sanger.fastqsanger.gz has changed
b
diff -r e4d28c94242d -r 71e5fa25b8a2 tool_dependencies.xml
--- a/tool_dependencies.xml Wed Nov 11 12:40:56 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>