|
54 | 54 | $output_params.inverse |
55 | 55 | #end if |
56 | 56 |
|
57 | | - #if $output_params.gzip == "no" |
58 | | - > $fq_filt |
| 57 | +
|
| 58 | + #if str($input.ext).endswith("gz") |
| 59 | + | gzip > $fq_filt |
59 | 60 | #else |
60 | | - | gzip > $fq_filt_gz |
| 61 | + > $fq_filt |
61 | 62 | #end if |
62 | 63 |
|
63 | 64 | ]]></command> |
|
79 | 80 |
|
80 | 81 | <section name="output_params" title="Output Parameters" expanded="False"> |
81 | 82 | <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]."/> |
83 | 83 | </section> |
84 | 84 | </inputs> |
85 | 85 |
|
86 | 86 | <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)" /> |
93 | 88 | </outputs> |
94 | 89 |
|
95 | 90 | <tests> |
| 91 | + <!-- 1) --> |
96 | 92 | <test expect_num_outputs="1"> |
97 | 93 | <param name="input" value="other-test.fastq"/> |
98 | | - <section name="output_params"> |
99 | | - <param name="gzip" value="false"/> |
100 | | - </section> |
101 | 94 | <output name="fq_filt"> |
102 | 95 | <assert_contents> |
103 | 96 | <has_text text="@35febf09-dcbc-424c-987e-9f3f80fe73a5"/> |
|
106 | 99 | </assert_contents> |
107 | 100 | </output> |
108 | 101 | </test> |
| 102 | + <!-- 2) --> |
109 | 103 | <test expect_num_outputs="1"> |
110 | 104 | <param name="input" value="other-test.fastq"/> |
111 | 105 | <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"> |
113 | 107 | <assert_contents> |
114 | 108 | <has_text text="@35febf09-dcbc-424c-987e-9f3f80fe73a5"/> |
115 | 109 | <has_text text="@3fda06e9-62ef-4448-9993-b90124a793d5"/> |
116 | 110 | <has_text text="@19d9337f-4fb6-46e5-b484-14d05f562506"/> |
117 | 111 | </assert_contents> |
118 | 112 | </output> |
119 | 113 | </test> |
| 114 | + <!-- 3) --> |
120 | 115 | <test expect_num_outputs="1"> |
121 | 116 | <param name="input" value="testGC.fastq"/> |
122 | 117 | <section name="option_params"> |
123 | 118 | <param name="mingc" value="0.3"/> |
124 | 119 | <param name="maxgc" value="0.8"/> |
125 | 120 | </section> |
126 | | - <section name="output_params"> |
127 | | - <param name="gzip" value="false"/> |
128 | | - </section> |
129 | 121 | <output name="fq_filt" > |
130 | 122 | <assert_contents> |
131 | 123 | <not_has_text text='@GC20'/> |
|
136 | 128 | </assert_contents> |
137 | 129 | </output> |
138 | 130 | </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> |
139 | 160 | </tests> |
140 | 161 | <help><![CDATA[ |
141 | 162 | **Chopper** |
|
0 commit comments