Skip to content

Commit f7f58a3

Browse files
committed
updated chopper!
updated output options. removed gzip flag -> instead auto detection of type
1 parent 4d120e9 commit f7f58a3

File tree

3 files changed

+50
-17
lines changed

3 files changed

+50
-17
lines changed

tools/chopper/chopper.xml

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,11 @@
5454
$output_params.inverse
5555
#end if
5656
57-
#if $output_params.gzip == "no"
58-
> $fq_filt
57+
58+
#if str($input.ext).endswith("gz")
59+
| gzip > $fq_filt
5960
#else
60-
| gzip > $fq_filt_gz
61+
> $fq_filt
6162
#end if
6263
6364
]]></command>
@@ -79,25 +80,17 @@
7980

8081
<section name="output_params" title="Output Parameters" expanded="False">
8182
<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')"/>
82-
<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]."/>
8383
</section>
8484
</inputs>
8585

8686
<outputs>
87-
<data name="fq_filt_gz" format="fastq.gz" label="${tool.name} on ${input.name} ($on_string), gzipped" >
88-
<filter> output_params['gzip'] is True </filter>
89-
</data>
90-
<data name="fq_filt" format="fastq" label="${tool.name} on ${input.name} ($on_string)" >
91-
<filter> output_params['gzip'] is False </filter>
92-
</data>
87+
<data name="fq_filt" format_source="input" label="${tool.name} on ${input.name} ($on_string)" />
9388
</outputs>
9489

9590
<tests>
91+
<!-- 1) -->
9692
<test expect_num_outputs="1">
9793
<param name="input" value="other-test.fastq"/>
98-
<section name="output_params">
99-
<param name="gzip" value="false"/>
100-
</section>
10194
<output name="fq_filt">
10295
<assert_contents>
10396
<has_text text="@35febf09-dcbc-424c-987e-9f3f80fe73a5"/>
@@ -106,26 +99,25 @@
10699
</assert_contents>
107100
</output>
108101
</test>
102+
<!-- 2) -->
109103
<test expect_num_outputs="1">
110104
<param name="input" value="other-test.fastq"/>
111105
<param name="contam" value="random_contam.fa"/>
112-
<output name="fq_filt" ftype="fastq.gz" decompress="true"> <!-- file="out2.fq.gz"/> -->
106+
<output name="fq_filt">
113107
<assert_contents>
114108
<has_text text="@35febf09-dcbc-424c-987e-9f3f80fe73a5"/>
115109
<has_text text="@3fda06e9-62ef-4448-9993-b90124a793d5"/>
116110
<has_text text="@19d9337f-4fb6-46e5-b484-14d05f562506"/>
117111
</assert_contents>
118112
</output>
119113
</test>
114+
<!-- 3) -->
120115
<test expect_num_outputs="1">
121116
<param name="input" value="testGC.fastq"/>
122117
<section name="option_params">
123118
<param name="mingc" value="0.3"/>
124119
<param name="maxgc" value="0.8"/>
125120
</section>
126-
<section name="output_params">
127-
<param name="gzip" value="false"/>
128-
</section>
129121
<output name="fq_filt" >
130122
<assert_contents>
131123
<not_has_text text='@GC20'/>
@@ -136,6 +128,35 @@
136128
</assert_contents>
137129
</output>
138130
</test>
131+
<!-- 4) fastqsanger -->
132+
<test expect_num_outputs="1">
133+
<param name="input" value="wrapping_as_sanger.fastqsanger"/>
134+
<section name="option_params">
135+
<param name="maxlength" value="136"/>
136+
</section>
137+
<output name="fq_filt" >
138+
<assert_contents>
139+
<not_has_text text='@SRR014849.203935'/>
140+
<has_text text='@SRR014849.50939'/>
141+
<has_text text='@SRR014849.110027'/>
142+
</assert_contents>
143+
</output>
144+
</test>
145+
<!-- 5) fastqsanger.gz -->
146+
<test expect_num_outputs="1">
147+
<param name="input" value="wrapping_as_sanger.fastqsanger.gz"/>
148+
<section name="option_params">
149+
<param name="maxlength" value="136"/>
150+
</section>
151+
<output name="fq_filt">
152+
<assert_contents>
153+
<has_size size='1'/>
154+
</assert_contents>
155+
</output>
156+
<assert_stderr>
157+
<has_text text="Kept 2 reads out of 3 reads"/>
158+
</assert_stderr>
159+
</test>
139160
</tests>
140161
<help><![CDATA[
141162
**Chopper**
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@SRR014849.50939 EIXKN4201BA2EC length=135
2+
GAAATTTCAGGGCCACCTTTTTTTTGATAGAATAATGGAGAAAATTAAAAGCTGTACATATACCAATGAACAATAAATCAATACATAAAAAAGGAGAAGTTGGAACCGAAAGGGTTTGAATTCAAACCCTTTCGG
3+
+
4+
;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
5+
@SRR014849.110027 EIXKN4201APUB0 length=131
6+
CTTCAAATGATTCCGGGACTGTTGGAACCGAAAGGGTTTGAATTCAAACCCTTTTCGGTTCCAACTCGCCGTCCGAATAATCCGTTCAAAATCTTGGCCTGTCAAAACGACTTTACGACCAGAACGATCCG
7+
+
8+
=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=
9+
@SRR014849.203935 EIXKN4201B4HU6 length=144
10+
AACCCGTCCCATCAAAGATTTTGGTTGGAACCCGAAAGGGTTTTGAATTCAAACCCCTTTCGGTTCCAACTATTCAATTGTTTAACTTTTTTTAAATTGATGGTCTGTTGGACCATTTGTAATAATCCCCATCGGAATTTCTTT
11+
+
12+
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=*
624 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)