changeset 3:3f4f192666f4 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/chopper commit f25e203bf4e1d06d021b9a12007431c6e1a33347
author iuc
date Thu, 11 Dec 2025 19:38:48 +0000
parents 08a6063d8c7c
children
files chopper.xml test-data/wrapping_as_sanger.fastqsanger test-data/wrapping_as_sanger.fastqsanger.gz
diffstat 3 files changed, 134 insertions(+), 102 deletions(-) [+]
line wrap: on
line diff
--- a/chopper.xml	Mon Nov 17 12:23:42 2025 +0000
+++ b/chopper.xml	Thu Dec 11 19:38:48 2025 +0000
@@ -1,52 +1,52 @@
 <tool id="chopper" name="Chopper" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="23.2">
-	<description>Filtering and trimming of long reads.</description>
-	<macros>
-		<token name="@TOOL_VERSION@">0.12.0</token>
-		<token name="@VERSION_SUFFIX@">0</token>
-	</macros>
-	<requirements>
-		<requirement type="package" version="@TOOL_VERSION@">chopper</requirement>
-	</requirements>
-	<version_command>chopper --version</version_command>
-	<command detect_errors="exit_code"><![CDATA[
+    <description>Filtering and trimming of long reads.</description>
+    <macros>
+        <token name="@TOOL_VERSION@">0.12.0</token>
+        <token name="@VERSION_SUFFIX@">1</token>
+    </macros>
+    <requirements>
+        <requirement type="package" version="@TOOL_VERSION@">chopper</requirement>
+    </requirements>
+    <version_command>chopper --version</version_command>
+    <command detect_errors="exit_code"><![CDATA[
  chopper
 
  --input $input
 
  #if $contam
-	--contam $contam	
+    --contam $contam    
  #end if
 
  #if $option_params.quality
-	--quality $option_params.quality.value
+    --quality $option_params.quality.value
  #end if
 
  #if $option_params.maxqual
-	--maxqual $option_params.maxqual.value
+    --maxqual $option_params.maxqual.value
  #end if
 
  #if $option_params.minlength
-	--minlength $option_params.minlength.value
+    --minlength $option_params.minlength.value
  #end if
 
  #if $option_params.maxlength
-	--maxlength $option_params.maxlength.value
+    --maxlength $option_params.maxlength.value
  #end if
 
  #if $option_params.headcrop
-	--headcrop $option_params.headcrop.value
+    --headcrop $option_params.headcrop.value
  #end if
 
  #if $option_params.tailcrop
-	--tailcrop $option_params.tailcrop.value
+    --tailcrop $option_params.tailcrop.value
  #end if
 
  #if $option_params.mingc
-	--mingc $option_params.mingc.value
+    --mingc $option_params.mingc.value
  #end if
 
  #if $option_params.maxgc
-	--maxgc $option_params.maxgc.value
+    --maxgc $option_params.maxgc.value
  #end if
 
  ##output capture
@@ -54,90 +54,110 @@
     $output_params.inverse
  #end if 
 
- #if $output_params.gzip == "no"
-	> $fq_filt 
+
+ #if str($input.ext).endswith("gz")
+    | gzip > $fq_filt
  #else
-	| gzip > $fq_filt_gz
+    > $fq_filt
  #end if
 
  ]]></command>
-	<inputs>
-		<param argument="--input" type="data" label="FASTQ file to check" format="fastq,fastq.gz,fastqsanger.gz,fastqsanger" />
-		<param argument="--contam" type="data" format="fasta" optional="True" label="Reference FASTA" help="FASTA file with reference to check potential contaminants against."/>	
-
-		<section name="option_params" title="Optional Parameters" expanded="True">
-			<param argument="--quality" type="integer" label="Minimal quality score" value="0" min="0" max="60" help="Sets a minimum Phred average quality score."/>
-			<param argument="--maxqual" type="integer" label="Maximal quality score" value="60" min="0" max="60" help="Sets a maximum Phred average quality score."/>
-			<param argument="--minlength" type="integer" label="Sets a minimum read length" value="1" min="1"  help="Minimal length of read to keep."  optional="True"/>
-			<param argument="--maxlength" type="integer" label="Sets a maximum read length" help="Maximal length of read to keep" optional="True"/>
-			<param argument="--headcrop" type="integer" optional="True" label="Headcrop" value="0" min="0" help="Trim N nucleotides from the start of a read."/>
-			<param argument="--tailcrop" type="integer" optional="True" label="Tailcrop" value="0" min="0" help="Trim N nucleotides from the end of a read."/>
-			<param argument="--mingc" type="float" optional="True" label="Minimum GC content" value="0.0" min="0.0" max="1.0" help="Sets a minimum GC content for reads to keep."/>
-			<param argument="--maxgc" type="float" optional="True" label="Maximum GC content" value="1.0" min="0.0" max="1.0" help="Sets a maximum GC content for reads to keep."/>
-			<param argument="--trim" type="integer" label="Q-score cutoff to trim read ends" value="0" min="0" max="60" help="Takes a quality score and will trim the ends of the reads if they are below the specified cut-off (window-size = 1)."/>
-		</section>
-
-		<section name="output_params" title="Output Parameters" expanded="False">
-			<param argument="--inverse" type="boolean" checked="false" truevalue="--inverse" falsevalue="" label="Output the opposite of the normal results" help="Reverse the output results (aka, the 'failed reads')"/>
-			<param name="gzip" type="boolean" checked="true" truevalue="yes" falsevalue="no" label="Gzip output data" help="Set to 'no' to NOT gzip the output file [default gzip output]."/>
-		</section>
-	</inputs>
+    <inputs>
+        <param argument="--input" type="data" label="FASTQ file to check" format="fastqsanger.gz,fastqsanger" />
+        <param argument="--contam" type="data" format="fasta" optional="True" label="Reference FASTA" help="FASTA file with reference to check potential contaminants against."/>    
 
-	<outputs>
-		<data name="fq_filt_gz" format="fastq.gz" label="${tool.name} on ${input.name} ($on_string), gzipped" >
-			<filter> output_params['gzip'] is True </filter>
-		</data>
-		<data name="fq_filt" format="fastq" label="${tool.name} on ${input.name} ($on_string)" >
-			<filter> output_params['gzip'] is False </filter>
-		</data>
-	</outputs>
-	
-	<tests>
-		<test expect_num_outputs="1">
-			<param name="input" value="other-test.fastq"/>
-			<section name="output_params">
-				<param name="gzip" value="false"/>
-			</section>
-			<output name="fq_filt">
-				<assert_contents>
-					<has_text text="@35febf09-dcbc-424c-987e-9f3f80fe73a5"/>
-					<has_text text="@3fda06e9-62ef-4448-9993-b90124a793d5"/>
-					<has_text text="@19d9337f-4fb6-46e5-b484-14d05f562506"/>
-				</assert_contents>
-			</output>
-		</test>
-		<test expect_num_outputs="1">
-			<param name="input" value="other-test.fastq"/>
-			<param name="contam" value="random_contam.fa"/>
-			<output name="fq_filt" ftype="fastq.gz" decompress="true"> <!-- file="out2.fq.gz"/> -->
-				<assert_contents>
-					<has_text text="@35febf09-dcbc-424c-987e-9f3f80fe73a5"/>
-					<has_text text="@3fda06e9-62ef-4448-9993-b90124a793d5"/>
-					<has_text text="@19d9337f-4fb6-46e5-b484-14d05f562506"/>
-				</assert_contents>
-			</output>
-		</test>
-		<test expect_num_outputs="1">
-			<param name="input" value="testGC.fastq"/>
-			<section name="option_params">
-				<param name="mingc" value="0.3"/>
-				<param name="maxgc" value="0.8"/>
-			</section>
-			<section name="output_params">
-				<param name="gzip" value="false"/>
-			</section>
-			<output name="fq_filt" > 
-				<assert_contents>
-					<not_has_text text='@GC20'/>
-					<not_has_text text='@GC0'/>
-					<not_has_text text='@GC100'/>
-					<has_text text='@GC50'/>
-					<has_text text='@GC80'/>
-				</assert_contents>
-			</output>
-		</test>
-	</tests>
-	<help><![CDATA[
+        <section name="option_params" title="Optional Parameters" expanded="True">
+            <param argument="--quality" type="integer" label="Minimal quality score" value="0" min="0" max="60" help="Sets a minimum Phred average quality score."/>
+            <param argument="--maxqual" type="integer" label="Maximal quality score" value="60" min="0" max="60" help="Sets a maximum Phred average quality score."/>
+            <param argument="--minlength" type="integer" label="Sets a minimum read length" value="1" min="1"  help="Minimal length of read to keep."  optional="True"/>
+            <param argument="--maxlength" type="integer" label="Sets a maximum read length" help="Maximal length of read to keep" optional="True"/>
+            <param argument="--headcrop" type="integer" optional="True" label="Headcrop" value="0" min="0" help="Trim N nucleotides from the start of a read."/>
+            <param argument="--tailcrop" type="integer" optional="True" label="Tailcrop" value="0" min="0" help="Trim N nucleotides from the end of a read."/>
+            <param argument="--mingc" type="float" optional="True" label="Minimum GC content" value="0.0" min="0.0" max="1.0" help="Sets a minimum GC content for reads to keep."/>
+            <param argument="--maxgc" type="float" optional="True" label="Maximum GC content" value="1.0" min="0.0" max="1.0" help="Sets a maximum GC content for reads to keep."/>
+            <param argument="--trim" type="integer" label="Q-score cutoff to trim read ends" value="0" min="0" max="60" help="Takes a quality score and will trim the ends of the reads if they are below the specified cut-off (window-size = 1)."/>
+        </section>
+        <section name="output_params" title="Output Parameters" expanded="False">
+            <param argument="--inverse" type="boolean" checked="false" truevalue="--inverse" falsevalue="" label="Output the opposite of the normal results" help="Reverse the output results (aka, the 'failed reads')"/>
+        </section>
+    </inputs>
+    <outputs>
+	    <data name="fq_filt" format_source="input" label="${tool.name} on ${on_string}" />
+    </outputs>
+    <tests>
+        <!-- 1) -->
+        <test expect_num_outputs="1">
+            <param name="input" ftype="fastqsanger" value="other-test.fastq"/>
+            <output name="fq_filt" ftype="fastqsanger">
+                <assert_contents>
+                    <has_text text="@35febf09-dcbc-424c-987e-9f3f80fe73a5"/>
+                    <has_text text="@3fda06e9-62ef-4448-9993-b90124a793d5"/>
+                    <has_text text="@19d9337f-4fb6-46e5-b484-14d05f562506"/>
+                </assert_contents>
+            </output>
+        </test>
+        <!-- 2) -->
+        <test expect_num_outputs="1">
+            <param name="input" ftype="fastqsanger" value="other-test.fastq"/>
+            <param name="contam" value="random_contam.fa"/>
+            <output name="fq_filt" ftype="fastqsanger">
+                <assert_contents>
+                    <has_text text="@35febf09-dcbc-424c-987e-9f3f80fe73a5"/>
+                    <has_text text="@3fda06e9-62ef-4448-9993-b90124a793d5"/>
+                    <has_text text="@19d9337f-4fb6-46e5-b484-14d05f562506"/>
+                </assert_contents>
+            </output>
+        </test>
+        <!-- 3) -->
+        <test expect_num_outputs="1">
+            <param name="input" ftype="fastqsanger" value="testGC.fastq"/>
+            <section name="option_params">
+                <param name="mingc" value="0.3"/>
+                <param name="maxgc" value="0.8"/>
+            </section>
+            <output name="fq_filt" ftype="fastqsanger"> 
+                <assert_contents>
+                    <not_has_text text='@GC20'/>
+                    <not_has_text text='@GC0'/>
+                    <not_has_text text='@GC100'/>
+                    <has_text text='@GC50'/>
+                    <has_text text='@GC80'/>
+                </assert_contents>
+            </output>
+        </test>
+        <!-- 4) fastqsanger -->
+        <test expect_num_outputs="1">
+            <param name="input" ftype="fastqsanger" value="wrapping_as_sanger.fastqsanger"/>
+            <section name="option_params">
+                <param name="maxlength" value="136"/>
+            </section>
+            <output name="fq_filt" ftype="fastqsanger"> 
+                <assert_contents>
+                    <not_has_text text='@SRR014849.203935'/>
+                    <has_text text='@SRR014849.50939'/>
+                    <has_text text='@SRR014849.110027'/>
+                </assert_contents>
+            </output>
+        </test>
+        <!-- 5) fastqsanger.gz -->
+        <test expect_num_outputs="1">
+            <param name="input" ftype="fastqsanger.gz" value="wrapping_as_sanger.fastqsanger.gz"/>
+            <section name="option_params">
+                <param name="maxlength" value="136"/>
+            </section>
+            <output name="fq_filt" ftype="fastqsanger.gz" decompress="true">
+                <assert_contents>
+                    <not_has_text text='@SRR014849.203935'/>
+                    <has_text text='@SRR014849.50939'/>
+                    <has_text text='@SRR014849.110027'/>
+                </assert_contents>
+            </output>
+            <assert_stderr>
+                <has_text text="Kept 2 reads out of 3 reads"/>
+            </assert_stderr>
+        </test>
+    </tests>
+    <help><![CDATA[
 **Chopper**
 
 Rust implementation of NanoFilt+NanoLyse, both originally written in Python. This tool, intended for long read sequencing such as PacBio or ONT, filters and trims a fastq file.
@@ -151,8 +171,8 @@
 
 .. _Chopper on GitHub: https://github.com/wdecoster/chopper
 
-	]]></help>
-	<citations>
-		<citation type="doi">10.1093/bioinformatics/btad311</citation>
-	</citations>
+    ]]></help>
+    <citations>
+        <citation type="doi">10.1093/bioinformatics/btad311</citation>
+    </citations>
 </tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/wrapping_as_sanger.fastqsanger	Thu Dec 11 19:38:48 2025 +0000
@@ -0,0 +1,12 @@
+@SRR014849.50939 EIXKN4201BA2EC length=135
+GAAATTTCAGGGCCACCTTTTTTTTGATAGAATAATGGAGAAAATTAAAAGCTGTACATATACCAATGAACAATAAATCAATACATAAAAAAGGAGAAGTTGGAACCGAAAGGGTTTGAATTCAAACCCTTTCGG
++
+;C?-EA/=<EA/B;<B;D>60,)%"<=:5<@8<B;=B;<;EA4'@8FB6*<:=<<===<=;=B:A9<<B;=B;=EA0:<B:<<=<<FA81+$?6;<A9=<3>5@7@8<A<(B=*A=)<<2?57B=*B=*D?-:=4
+@SRR014849.110027 EIXKN4201APUB0 length=131
+CTTCAAATGATTCCGGGACTGTTGGAACCGAAAGGGTTTGAATTCAAACCCTTTTCGGTTCCAACTCGCCGTCCGAATAATCCGTTCAAAATCTTGGCCTGTCAAAACGACTTTACGACCAGAACGATCCG
++
+=B::@<':=5A9?7EA0:=<<?6@7<3?5<@;%D?-B=)::0=4<D?-EA/D@2";B;B:B:A9;;=<B;;<B;<B;<B;:A;<A;8FB7+=<B;B:A9<1:=FB6(<=<<EA0956;<2==A8===:@8=
+@SRR014849.203935 EIXKN4201B4HU6 length=144
+AACCCGTCCCATCAAAGATTTTGGTTGGAACCCGAAAGGGTTTTGAATTCAAACCCCTTTCGGTTCCAACTATTCAATTGTTTAACTTTTTTTAAATTGATGGTCTGTTGGACCATTTGTAATAATCCCCATCGGAATTTCTTT
++
+A;@;%75?:#<<9EA1;=EA3%B;B;A;B;@;%9EA1EA1EA3%<B;A;8EA0D@3$EA1=B;A;B;B;:=:B;:B:A9:EA0A9<FA81+&"D?-B;4<::/<;=:A98-5?6=C>+8<<3;=4:DA3%<;=8-9.A=):B=*
Binary file test-data/wrapping_as_sanger.fastqsanger.gz has changed