# HG changeset patch
# User iuc
# Date 1582131330 0
# Node ID 4fda2184efa54ea9a1b8d325667b9476ce1e0193
# Parent  dafabb4c20376490700df75951c8e304614e8ba9
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/galaxy_sequence_utils/fastq_groomer commit d4ced60a941c4c4a2fe95de9c09a10086810b387"

diff -r dafabb4c2037 -r 4fda2184efa5 fastq_groomer.xml
--- a/fastq_groomer.xml	Fri Nov 01 13:16:58 2019 -0400
+++ b/fastq_groomer.xml	Wed Feb 19 16:55:30 2020 +0000
@@ -1,8 +1,9 @@
-<tool id="fastq_groomer" name="FASTQ Groomer" version="1.1.1">
+<tool id="fastq_groomer" name="FASTQ Groomer" version="@TOOL_VERSION@">
     <description>convert between various FASTQ quality formats</description>
-    <requirements>
-        <requirement type="package" version="1.1.1">galaxy_sequence_utils</requirement>
-    </requirements>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <expand macro="requirements"/>
     <edam_topics>
         <edam_topic>topic_0622</edam_topic>
     </edam_topics>
@@ -16,10 +17,10 @@
 #elif $input_file.extension.endswith(".bz2"):
     #set $suffix = ".bz2"
 #else:
-#set $suffix = ""
+    #set $suffix = ""
 #end if
 $input_type$suffix '$output_file'
-#if $options_type['options_type_selector'] == 'basic':
+#if $options_type.options_type_selector == 'basic':
     #if str($input_type) == 'cssanger':
         cssanger
     #else:
@@ -27,7 +28,7 @@
     #end if
     ascii summarize_input
 #else:
-    ${options_type.output_type} ${options_type.force_quality_encoding} ${options_type.summarize_input}
+    ${options_type.output_type} ${options_type.force_quality_encoding} ${options_type.summarize_input} ${options_type.fix_id}
 #end if
     ]]></command>
     <inputs>
@@ -68,6 +69,9 @@
                     <option value="summarize_input" selected="true">Summarize Input</option>
                     <option value="dont_summarize_input">Do not Summarize Input (faster)</option>
                 </param>
+                <param name="fix_id" type="boolean" label="Fix inconsistent identifiers" 
+                    truevalue="--fix-id" falsevalue="--no-fix-id" checked="true">
+                </param>
             </when>
         </conditional>
     </inputs>
@@ -91,6 +95,28 @@
         </data>
     </outputs>
     <tests>
+        <!-- Test fix-id by default -->
+        <test>
+            <param name="input_file" value="fastq_invalid-line3" ftype="fastq" />
+            <param name="input_type" value="sanger" />
+            <param name="options_type_selector" value="basic" />
+            <output name="output_file" file="fastq_invalid-line3_fixed" />
+        </test>
+        <!-- Test fix-id by setting the option -->
+        <test>
+            <param name="input_file" value="fastq_invalid-line3" ftype="fastq" />
+            <param name="input_type" value="sanger" />
+            <param name="options_type_selector" value="advanced" />
+            <param name="fix_id" value="--fix-id" />
+            <output name="output_file" file="fastq_invalid-line3_fixed" />
+        </test>
+        <!-- Test fix-id / option not set; expect failure -->
+        <test expect_failure="true">
+            <param name="input_file" value="fastq_invalid-line3" ftype="fastq" />
+            <param name="input_type" value="sanger" />
+            <param name="options_type_selector" value="advanced" />
+            <param name="fix_id" value="--no-fix-id" />
+        </test>
         <!-- These tests include test files adapted from supplemental material 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. -->
         <!-- Test basic options -->
         <test>
@@ -375,7 +401,7 @@
 
 This tool offers several conversions options relating to the FASTQ format.
 
-When using *Basic* options, the output will be *sanger* formatted or *cssanger* formatted (when the input is Color Space Sanger).
+When using *Basic* options, the output will be *sanger* formatted or *cssanger* formatted (when the input is Color Space Sanger). Inconsistent identifiers are fixed by default.
 
 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).
 
diff -r dafabb4c2037 -r 4fda2184efa5 macros.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/macros.xml	Wed Feb 19 16:55:30 2020 +0000
@@ -0,0 +1,9 @@
+<macros>
+    <token name="@TOOL_VERSION@">1.1.5</token>
+    <xml name="requirements">
+        <requirements>
+            <requirement type="package" version="@TOOL_VERSION@">galaxy_sequence_utils</requirement>
+            <yield/>
+        </requirements>
+    </xml>>
+</macros>
diff -r dafabb4c2037 -r 4fda2184efa5 test-data/fastq_invalid-line3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/fastq_invalid-line3	Wed Feb 19 16:55:30 2020 +0000
@@ -0,0 +1,8 @@
+@FAKE-1
+ACGTACGTAC
++invalid line
+!##$%&&()*
+@FAKE-2
+CATGCATGCA
++
+~}|{zyxwvu
diff -r dafabb4c2037 -r 4fda2184efa5 test-data/fastq_invalid-line3_fixed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/fastq_invalid-line3_fixed	Wed Feb 19 16:55:30 2020 +0000
@@ -0,0 +1,8 @@
+@FAKE-1
+ACGTACGTAC
++
+!##$%&&()*
+@FAKE-2
+CATGCATGCA
++
+~}|{zyxwvu