comparison samtools_fastx.xml @ 1:a8d69aee190e draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/samtools/samtools_fastx commit 60257e09a1aadf54bb2f06cbe1e88db6fd835e83
author iuc
date Fri, 28 Sep 2018 04:39:19 -0400
parents a0d039fa9771
children 720217c23995
comparison
equal deleted inserted replaced
0:a0d039fa9771 1:a8d69aee190e
1 <?xml version="1.0"?> 1 <tool id="samtools_fastx" name="Samtools fastx" version="@TOOL_VERSION@+galaxy1">
2 <tool id="samtools_fastx" name="Samtools extract" version="@TOOL_VERSION@"> 2 <description>extract FASTA or FASTQ from alignment files</description>
3 <description>FASTA or FASTQ from a SAM file</description>
4 <macros> 3 <macros>
5 <import>macros.xml</import> 4 <import>macros.xml</import>
6 </macros> 5 </macros>
7 <expand macro="requirements" /> 6 <expand macro="requirements" />
7 <expand macro="stdio"/>
8 <expand macro="version_command" /> 8 <expand macro="version_command" />
9 <command detect_errors="exit_code"> 9 <command><![CDATA[
10 <![CDATA[ 10 @ADDTHREADS@
11 samtools $output.output_format 11 ## name sort input file if neccessary
12 #if $output.output_format == 'fastq': 12 #if not $input.is_of_type('qname_sorted.bam', 'qname_input_sorted.bam'):
13 -v $output.default_quality $output.output_quality 13 samtools sort -@ \$addthreads -n '$input' > input &&
14 #end if 14 #else:
15 #if $reference: 15 ln -s '$input' input &&
16 --reference '$reference' 16 #end if
17 #end if 17
18 $copy_flags $omit_read_number 18 #set command=str($output_fmt_cond.output_fmt_select)[:5]
19 -0 '$nonspecific' 19
20 -1 '$forward' 20 samtools $command
21 -2 '$reverse' 21 #if str($output_fmt_cond.output_fmt_select).startswith('fastq'):
22 #if str($inclusive_filter) != 'None': 22 #if str($output_fmt_cond.default_quality) != '':
23 #set $filter = $inclusive_filter 23 -v $output_fmt_cond.default_quality
24 @FLAGS@ 24 #end if
25 -f $flags 25 $output_fmt_cond.output_quality
26 #end if 26 $output_fmt_cond.ilumina_casava
27 #if str($exclusive_filter) != 'None': 27 #end if
28 #set $filter = $exclusive_filter 28 $copy_tags
29 @FLAGS@ 29 #if str($copy_arb_tags) != '':
30 -F $flags 30 -T '$copy_arb_tags'
31 #end if 31 #end if
32 '$input' 32 $read_numbering
33 #if 'r0' in str($outputs):
34 -0 nonspecific.$output_fmt_cond.output_fmt_select
35 #end if
36 #if 'r1' in str($outputs):
37 -1 forward.$output_fmt_cond.output_fmt_select
38 #end if
39 #if 'r2' in str($outputs):
40 -2 reverse.$output_fmt_cond.output_fmt_select
41 #end if
42 #if str($inclusive_filter) != 'None':
43 #set $filter = $inclusive_filter
44 @FLAGS@
45 -f $flags
46 #end if
47 #if str($exclusive_filter) != 'None':
48 #set $filter = $exclusive_filter
49 @FLAGS@
50 -F $flags
51 #end if
52 #if str($exclusive_filter) != 'None':
53 #set $filter = $exclusive_filter_all
54 @FLAGS@
55 -G $flags
56 #end if
57 #if 's' in str($outputs):
58 -s singletons.$output_fmt_cond.output_fmt_select
59 #end if
60 #if str($idxout_cond.idxout_select) == 'yes':
61 #if str($idxout_cond.write1st) == 'yes':
62 --i1 i1.$output_fmt_cond.output_fmt_select
63 #end if
64 #if str($idxout_cond.write2nd) == 'yes':
65 --i2 i2.$output_fmt_cond.output_fmt_select
66 #end if
67 #if str($idxout_cond.index_format) != '':
68 --index-format $idxout_cond.index_format
69 #end if
70 #if str($idxout_cond.barcode_tag) != '':
71 --barcode-tag $idxout_cond.barcode_tag
72 #end if
73 #if str($idxout_cond.quality_tag) != '':
74 --quality-tag $idxout_cond.quality_tag
75 #end if
76 #end if
77
78 input
79
80 #if str($outputs)=='None' or 'other' in str($outputs):
81 ## since currently stdout in not zipped (samtools doesn't know about the extension)
82 #if str($output_fmt_cond.output_fmt_select).endswith('.gz'):
83 | gzip -
84 #end if
85 > output.$output_fmt_cond.output_fmt_select
86 && ln -s output.$output_fmt_cond.output_fmt_select output
87 #else
88 ## otherwise the remaining sequences would show up in the datasets info box
89 > /dev/null
90 #end if
91 #if 'r0' in str($outputs):
92 && ln -s nonspecific.$output_fmt_cond.output_fmt_select nonspecific
93 #end if
94 #if 'r1' in str($outputs):
95 && ln -s forward.$output_fmt_cond.output_fmt_select forward
96 #end if
97 #if 'r2' in str($outputs):
98 && ln -s reverse.$output_fmt_cond.output_fmt_select reverse
99 #end if
100 #if 's' in str($outputs):
101 && ln -s singletons.$output_fmt_cond.output_fmt_select singletons
102 #end if
103 #if str($idxout_cond.idxout_select) == 'yes':
104 #if str($idxout_cond.write1st) == 'yes':
105 && ln -s i1.$output_fmt_cond.output_fmt_select i1
106 #end if
107 #if str($idxout_cond.write2nd) == 'yes':
108 && ln -s i2.$output_fmt_cond.output_fmt_select i2
109 #end if
110 #end if
33 ]]> 111 ]]>
34 </command> 112 </command>
35 <inputs> 113 <inputs>
36 <param name="input" type="data" format="bam,sam" label="BAM or SAM file to convert" /> 114 <param name="input" type="data" format="sam,bam,cram" label="BAM or SAM file to convert" />
37 <param argument="--reference" type="data" format="fasta" optional="True" label="Reference FASTA" /> 115 <conditional name="output_fmt_cond">
38 <param name="copy_flags" argument="-t" type="boolean" truevalue="-t" falsevalue="" label="Copy RG/BC/QT flags to output header" /> 116 <param name="output_fmt_select" type="select" label="Output format">
39 <param name="omit_read_number" argument="-n" type="boolean" truevalue="-n" falsevalue="" label="Do not append /1 and /2 to read names" /> 117 <option value="fasta" selected="True">FASTA</option>
40 <param name="inclusive_filter" argument="-f" type="select" multiple="True" label="Require that these flags be set"> 118 <option value="fastqsanger">FASTQ</option>
41 <expand macro="filter_options" /> 119 <option value="fasta.gz">compressed FASTA</option>
42 </param> 120 <option value="fastqsanger.gz">compressed FASTQ</option>
43 <param name="exclusive_filter" argument="-F" type="select" multiple="True" label="Exclude reads with the following flags set">
44 <expand macro="filter_options" />
45 </param>
46 <conditional name="output">
47 <param name="output_format" type="select" label="Output format">
48 <option value="fasta">FASTA</option>
49 <option value="fastq">FASTQ</option>
50 </param> 121 </param>
51 <when value="fastq"> 122 <when value="fastqsanger">
52 <param name="default_quality" argument="-v" type="integer" value="1" label="Default quality if none is given" /> 123 <param name="default_quality" argument="-v" type="integer" optional="True" label="Default quality if none is given" />
53 <param name="output_quality" argument="-O" type="boolean" truevalue="-O" falsevalue="" label="Output quality in the OQ tag if available" /> 124 <param name="output_quality" argument="-O" type="boolean" truevalue="-O" falsevalue="" checked="false" label="Output quality in the OQ tag if available" />
125 <param name="ilumina_casava" argument="-i" type="boolean" truevalue="-i" falsevalue="" checked="false" label="add Illumina Casava 1.8 format entry to header (eg 1:N:0:ATCACG)" />
54 </when> 126 </when>
55 <when value="fasta" /> 127 <when value="fasta" />
128 <when value="fastqsanger.gz">
129 <param name="default_quality" argument="-v" type="integer" optional="True" label="Default quality if none is given" />
130 <param name="output_quality" argument="-O" type="boolean" truevalue="-O" falsevalue="" checked="false" label="Output quality in the OQ tag if available" />
131 <param name="ilumina_casava" argument="-i" type="boolean" truevalue="-i" falsevalue="" checked="false" label="add Illumina Casava 1.8 format entry to header (eg 1:N:0:ATCACG)" />
132 </when>
133 <when value="fasta.gz" />
134 </conditional>
135 <param name="outputs" type="select" multiple="true" label="outputs">
136 <option value="other" selected="true">others</option>
137 <option value="r1">READ1</option>
138 <option value="r2">READ2</option>
139 <option value="s">singletons</option>
140 <option value="r0">unspecific</option>
141 <help>disjoint subsets of the reads can be redirected to separate data sets. "READ[12]" are reads for which the READ[12] flag is set and the READ[21] flag is not set. "unspecific" reads are those for which both ore neither of these flags are set. "singletons" are the singleto reads. Note that if selected READ1 and READ2 contain only the paired reads. "other" are the remaining reads. If onlz 'others' or nothing is selected all reads go to a single data set. </help>
142 </param>
143 <param name="copy_tags" argument="-t" type="boolean" truevalue="-t" falsevalue="" label="Copy RG/BC/QT tags to output header" />
144 <param name="copy_arb_tags" argument="-T" type="text" optional="true" label="copy arbitrary tags to the FASTA header line" />
145 <param name="read_numbering" type="select" label="Omit or append read numbers">
146 <option value="" selected="True">no</option>
147 <option value="-n">Do not append /1 and /2 to read names</option>
148 <option value="-N">always append /1 and /2 to read name</option>
149 </param>
150 <param name="inclusive_filter" argument="-f" type="select" multiple="True" label="Require that these flags are set">
151 <expand macro="flag_options" />
152 </param>
153 <param name="exclusive_filter" argument="-F" type="select" multiple="True" label="Exclude reads with any of the following flags set">
154 <expand macro="flag_options" />
155 </param>
156 <param name="exclusive_filter_all" argument="-G" type="select" multiple="True" label="Exclude reads with all of the following flags set">
157 <expand macro="flag_options" />
158 </param>
159
160 <conditional name="idxout_cond">
161 <param name="idxout_select" type="select" label="Write index read files">
162 <option value="no" selected="True">No</option>
163 <option value="yes">Yes (beta: feedback welcome)</option>
164 </param>
165 <when value="no" />
166 <when value="yes">
167 <param name="write1st" argument="--i1" type="boolean" truevalue="yes" falsevalue="no" checked="true" label="write first index reads to extra data set" />
168 <param name="write2nd" argument="--i2" type="boolean" truevalue="yes" falsevalue="no" checked='true' label="write second index reads to extra data set" />
169 <param name="index_format" argument="--index-format" type="text" label="Index format: How to parse barcode and quality tags">
170 <help>
171 The index-format string describes how to parse the barcode and quality tags, for example:
172 i14i8 the first 14 characters are index 1, the next 8 characters are index 2
173 n8i14 ignore the first 8 characters, and use the next 14 characters for index 1
174 If the tag contains a separator, then the numeric part can be replaced with '*' to mean
175 'read until the separator or end of tag', for example:
176 n*i* ignore the left part of the tag until the separator, then use the second part
177 of the tag as index 1
178 </help>
179 </param>
180 <param name="barcode_tag" argument="--barcode-tag" type="text" optional="True" label="Barcode tag [default: BC]"/>
181 <param name="quality_tag" argument="--quality-tag" type="text" optional="True" label="Quality tag [default: QT]"/>
182 </when>
56 </conditional> 183 </conditional>
57 </inputs> 184 </inputs>
58 <outputs> 185 <outputs>
59 <data name="nonspecific" format="fasta" label="${on_string} converted to ${output.output_format} (Neither or both)"> 186 <data name="nonspecific" format="fasta" from_work_dir="nonspecific" label="${on_string} converted to ${output_fmt_cond.output_fmt_select} (nonspecific)">
60 <change_format> 187 <filter>'r0' in str(outputs)</filter>
61 <when input="output_format" value="fastq" format="fastq" /> 188 <actions>
62 </change_format> 189 <action type="format">
63 </data> 190 <option type="from_param" name="output_fmt_cond" param_attribute="output_fmt_select" />
64 <data name="forward" format="fasta" label="${on_string} converted to ${output.output_format} (READ1)"> 191 </action>
65 <change_format> 192 </actions>
66 <when input="output_format" value="fastq" format="fastq" /> 193 </data>
67 </change_format> 194 <data name="forward" format="fasta" from_work_dir="forward" label="${on_string} converted to ${output_fmt_cond.output_fmt_select} (READ1)">
68 </data> 195 <filter>'r1' in str(outputs)</filter>
69 <data name="reverse" format="fasta" label="${on_string} converted to ${output.output_format} (READ2)"> 196 <actions>
70 <change_format> 197 <action type="format">
71 <when input="output_format" value="fastq" format="fastq" /> 198 <option type="from_param" name="output_fmt_cond" param_attribute="output_fmt_select" />
72 </change_format> 199 </action>
200 </actions>
201 </data>
202 <data name="reverse" format="fasta" from_work_dir="reverse" label="${on_string} converted to ${output_fmt_cond.output_fmt_select} (READ2)">
203 <filter>'r2' in str(outputs)</filter>
204 <actions>
205 <action type="format">
206 <option type="from_param" name="output_fmt_cond" param_attribute="output_fmt_select" />
207 </action>
208 </actions>
209 </data>
210 <data name="singletons" format="fasta" from_work_dir="singletons" label="${on_string} converted to ${output_fmt_cond.output_fmt_select} (singletons)">
211 <filter>'s' in str(outputs)</filter>
212 <actions>
213 <action type="format">
214 <option type="from_param" name="output_fmt_cond" param_attribute="output_fmt_select" />
215 </action>
216 </actions>
217 </data>
218 <data name="output" format="fasta" from_work_dir="output" label="${on_string} converted to ${output_fmt_cond.output_fmt_select}">
219 <filter>str(outputs)=='None' or 'other' in str(outputs)</filter>
220 <actions>
221 <action type="format">
222 <option type="from_param" name="output_fmt_cond" param_attribute="output_fmt_select" />
223 </action>
224 </actions>
225 </data>
226 <data name="i1" format="fasta" from_work_dir="i1" label="${on_string} converted to ${output_fmt_cond.output_fmt_select} (1st index)">
227 <filter>idxout_cond['idxout_select']=='yes' and idxout_cond['write1st']</filter>
228 <actions>
229 <action type="format">
230 <option type="from_param" name="output_fmt_cond" param_attribute="output_fmt_select" />
231 </action>
232 </actions>
233 </data>
234 <data name="i2" format="fasta" from_work_dir="i2" label="${on_string} converted to ${output_fmt_cond.output_fmt_select} (2nd index)">
235 <filter>idxout_cond['idxout_select']=='yes' and idxout_cond['write2nd']</filter>
236 <actions>
237 <action type="format">
238 <option type="from_param" name="output_fmt_cond" param_attribute="output_fmt_select" />
239 </action>
240 </actions>
73 </data> 241 </data>
74 </outputs> 242 </outputs>
75 <tests> 243 <tests>
244 <!-- tests from original Galaxy tool -->
76 <test> 245 <test>
77 <param name="input" value="samtools_fastx-in1.bam" ftype="bam" /> 246 <param name="input" value="samtools_fastx-in1.bam" ftype="bam" />
78 <param name="output_format" value="fasta" /> 247 <conditional name="output_fmt_cond">
79 <output name="nonspecific" file="samtools_fastx-out1-1.fasta" /> 248 <param name="output_fmt_select" value="fasta" />
80 <output name="forward" file="samtools_fastx-out1-2.fasta" /> 249 </conditional>
81 <output name="reverse" file="samtools_fastx-out1-3.fasta" /> 250 <param name="outputs" value="other" />
251 <output name="output" file="samtools_fastx-out1.fasta" ftype="fasta" />
82 </test> 252 </test>
83 <test> 253 <test>
84 <param name="input" value="samtools_fastx-in2.bam" ftype="bam" /> 254 <param name="input" value="samtools_fastx-in2.bam" ftype="bam" />
85 <param name="output_format" value="fastq" /> 255 <conditional name="output_fmt_cond">
86 <output name="nonspecific" file="samtools_fastx-out2-1.fastq" /> 256 <param name="output_fmt_select" value="fastqsanger" />
87 <output name="forward" file="samtools_fastx-out2-2.fastq" /> 257 </conditional>
88 <output name="reverse" file="samtools_fastx-out2-3.fastq" /> 258 <param name="outputs" value="r0,r1,r2" />
259 <output name="nonspecific" file="samtools_fastx-out2-1.fastq" ftype="fastqsanger" />
260 <output name="forward" file="samtools_fastx-out2-2.fastq" ftype="fastqsanger" />
261 <output name="reverse" file="samtools_fastx-out2-3.fastq" ftype="fastqsanger" />
89 </test> 262 </test>
90 <test> 263 <test>
91 <param name="input" value="samtools_fastx-in3.sam" ftype="sam" /> 264 <param name="input" value="samtools_fastx-in3.sam" ftype="sam" />
92 <param name="output_format" value="fasta" /> 265 <conditional name="output_fmt_cond">
93 <output name="nonspecific" file="samtools_fastx-out3-1.fasta" /> 266 <param name="output_fmt_select" value="fasta" />
94 <output name="forward" file="samtools_fastx-out3-2.fasta" /> 267 </conditional>
95 <output name="reverse" file="samtools_fastx-out3-3.fasta" /> 268 <param name="outputs" value="r0,r1,r2" />
269 <output name="nonspecific" file="samtools_fastx-out3-1.fasta" ftype="fasta" />
270 <output name="forward" file="samtools_fastx-out3-2.fasta" ftype="fasta" />
271 <output name="reverse" file="samtools_fastx-out3-3.fasta" ftype="fasta" />
272 </test>
273 <!-- tests from original Galaxy tool with gz output. for some reason gzip (which is used
274 for compressing stdout does not give exactly the same file contents .. the other
275 compressed files seem to)-->
276 <test>
277 <param name="input" value="samtools_fastx-in1.bam" ftype="bam" />
278 <conditional name="output_fmt_cond">
279 <param name="output_fmt_select" value="fasta.gz" />
280 </conditional>
281 <param name="outputs" value="other" />
282 <output name="output" file="samtools_fastx-out1.fasta.gz" ftype="fasta.gz" compare="sim_size" />
283 </test>
284 <test>
285 <param name="input" value="samtools_fastx-in2.bam" ftype="bam" />
286 <conditional name="output_fmt_cond">
287 <param name="output_fmt_select" value="fastqsanger.gz" />
288 </conditional>
289 <param name="outputs" value="r0,r1,r2" />
290 <output name="nonspecific" file="samtools_fastx-out2-1.fastq.gz" ftype="fastqsanger.gz" />
291 <output name="forward" file="samtools_fastx-out2-2.fastq.gz" ftype="fastqsanger.gz" />
292 <output name="reverse" file="samtools_fastx-out2-3.fastq.gz" ftype="fastqsanger.gz" />
293 </test>
294 <test>
295 <param name="input" value="samtools_fastx-in3.sam" ftype="sam" />
296 <conditional name="output_fmt_cond">
297 <param name="output_fmt_select" value="fasta.gz" />
298 </conditional>
299 <param name="outputs" value="r0,r1,r2" />
300 <output name="nonspecific" file="samtools_fastx-out3-1.fasta.gz" ftype="fasta.gz" />
301 <output name="forward" file="samtools_fastx-out3-2.fasta.gz" ftype="fasta.gz" />
302 <output name="reverse" file="samtools_fastx-out3-3.fasta.gz" ftype="fasta.gz" />
303 </test>
304 <!-- tests from: https://github.com/samtools/samtools/blob/6d79411685d8f0fbb34e123f52d72b63271f4dcb/test/test.pl#L2313-->
305 <!--# basic 2 output test without singleton tracking-->
306 <!--test_cmd($opts, out=>'bam2fq/1.stdout.expected', out_map=>{'1.fq' => 'bam2fq/1.1.fq.expected', '2.fq' => 'bam2fq/1.2.fq.expected'},cmd=>"$$opts{bin}/samtools fastq @$threads -1 $$opts{path}/1.fq -2 $$opts{path}/2.fq $$opts{path}/dat/bam2fq.001.sam");-->
307 <test>
308 <param name="input" value="bam2fq.001.sam" ftype="sam" />
309 <conditional name="output_fmt_cond">
310 <param name="output_fmt_select" value="fastqsanger" />
311 </conditional>
312 <param name="outputs" value="r1,r2,other" />
313 <output name="forward" file="1.1.fq.expected" ftype="fastqsanger" />
314 <output name="reverse" file="1.2.fq.expected" ftype="fastqsanger" />
315 <output name="output" file="1.stdout.expected" ftype="fastqsanger" />
316 </test>
317 <!--# basic 2 output test with singleton tracking but no singleton-->
318 <!--test_cmd($opts, out=>'bam2fq/2.stdout.expected', out_map=>{'1.fq' => 'bam2fq/2.1.fq.expected', '2.fq' => 'bam2fq/2.2.fq.expected', 's.fq' => 'bam2fq/2.s.fq.expected'}, cmd=>"$$opts{bin}/samtools fastq @$threads -s $$opts{path}/s.fq -1 $$opts{path}/1.fq -2 $$opts{path}/2.fq $$opts{path}/dat/bam2fq.001.sam");-->
319 <test>
320 <param name="input" value="bam2fq.001.sam" ftype="sam" />
321 <conditional name="output_fmt_cond">
322 <param name="output_fmt_select" value="fastqsanger" />
323 </conditional>
324 <param name="outputs" value="r1,r2,s,other" />
325 <output name="forward" file="2.1.fq.expected" ftype="fastqsanger" />
326 <output name="reverse" file="2.2.fq.expected" ftype="fastqsanger" />
327 <output name="singletons" file="2.s.fq.expected" ftype="fastqsanger" />
328 <output name="output" file="2.stdout.expected" ftype="fastqsanger" />
329 </test>
330 <!--# basic 2 output test with singleton tracking with a singleton in the middle-->
331 <!--test_cmd($opts, out=>'bam2fq/2.stdout.expected', out_map=>{'1.fq' => 'bam2fq/3.1.fq.expected', '2.fq' => 'bam2fq/3.2.fq.expected', 's.fq' => 'bam2fq/3.s.fq.expected'}, cmd=>"$$opts{bin}/samtools fastq @$threads -s $$opts{path}/s.fq -1 $$opts{path}/1.fq -2 $$opts{path}/2.fq $$opts{path}/dat/bam2fq.002.sam");-->
332 <test>
333 <param name="input" value="bam2fq.002.sam" ftype="sam" />
334 <conditional name="output_fmt_cond">
335 <param name="output_fmt_select" value="fastqsanger" />
336 </conditional>
337 <param name="outputs" value="r1,r2,s,other" />
338 <output name="forward" file="3.1.fq.expected" ftype="fastqsanger" />
339 <output name="reverse" file="3.2.fq.expected" ftype="fastqsanger" />
340 <output name="singletons" file="3.s.fq.expected" ftype="fastqsanger" />
341 <output name="output" file="3.stdout.expected" ftype="fastqsanger" />
342 </test>
343 <!--# basic 2 output test with singleton tracking with a singleton as last read-->
344 <!--test_cmd($opts, out=>'bam2fq/2.stdout.expected', out_map=>{'1.fq' => 'bam2fq/4.1.fq.expected', '2.fq' => 'bam2fq/4.2.fq.expected', 's.fq' => 'bam2fq/4.s.fq.expected'}, cmd=>"$$opts{bin}/samtools fastq @$threads -s $$opts{path}/s.fq -1 $$opts{path}/1.fq -2 $$opts{path}/2.fq $$opts{path}/dat/bam2fq.003.sam");-->
345 <test>
346 <param name="input" value="bam2fq.003.sam" ftype="sam" />
347 <conditional name="output_fmt_cond">
348 <param name="output_fmt_select" value="fastqsanger" />
349 </conditional>
350 <param name="outputs" value="r1,r2,s,other" />
351 <output name="forward" file="4.1.fq.expected" ftype="fastqsanger" />
352 <output name="reverse" file="4.2.fq.expected" ftype="fastqsanger" />
353 <output name="singletons" file="4.s.fq.expected" ftype="fastqsanger" />
354 <output name="output" file="4.stdout.expected" ftype="fastqsanger" />
355 </test>
356 <!--# tag output test with singleton tracking with a singleton as last read-->
357 <!--test_cmd($opts, out=>'bam2fq/2.stdout.expected', out_map=>{'1.fq' => 'bam2fq/4.1.fq.expected', '2.fq' => 'bam2fq/4.2.fq.expected', 's.fq' => 'bam2fq/4.s.fq.expected', 'bc.fq' => 'bam2fq/bc.fq.expected'}, cmd=>"$$opts{bin}/samtools fastq @$threads \-\-barcode-tag BC \-\-index-format 'n2i2' \-\-i1 $$opts{path}/bc.fq -s $$opts{path}/s.fq -1 $$opts{path}/1.fq -2 $$opts{path}/2.fq $$opts{path}/dat/bam2fq.004.sam");-->
358 <test>
359 <param name="input" value="bam2fq.004.sam" ftype="sam" />
360 <conditional name="output_fmt_cond">
361 <param name="output_fmt_select" value="fastqsanger" />
362 </conditional>
363 <param name="outputs" value="r1,r2,s,other" />
364 <conditional name="idxout_cond">
365 <param name="idxout_select" value="yes"/>
366 <param name="write1st" value="yes"/>
367 <param name="barcode_tag" value="BC"/>
368 <param name="index_format" value="n2i2"/>
369 </conditional>
370 <output name="forward" file="4.1.fq.expected" ftype="fastqsanger" />
371 <output name="reverse" file="4.2.fq.expected" ftype="fastqsanger" />
372 <output name="singletons" file="4.s.fq.expected" ftype="fastqsanger" />
373 <output name="output" file="4.stdout.expected" ftype="fastqsanger" />
374 <output name="i1" file="bc.fq.expected" ftype="fastqsanger" />
375 </test>
376 <!--# test -O flag with no OQ tags-->
377 <!--test_cmd($opts, out=>'bam2fq/2.stdout.expected', out_map=>{'1.fq' => 'bam2fq/4.1.fq.expected', '2.fq' => 'bam2fq/4.2.fq.expected', 's.fq' => 'bam2fq/4.s.fq.expected', 'bc.fq' => 'bam2fq/bc.fq.expected'}, cmd=>"$$opts{bin}/samtools fastq @$threads \-\-barcode-tag BC -O \-\-index-format 'n2i2' \-\-i1 $$opts{path}/bc.fq -s $$opts{path}/s.fq -1 $$opts{path}/1.fq -2 $$opts{path}/2.fq $$opts{path}/dat/bam2fq.004.sam");-->
378 <test>
379 <param name="input" value="bam2fq.010.sam" ftype="sam" />
380 <conditional name="output_fmt_cond">
381 <param name="output_fmt_select" value="fastqsanger" />
382 <param name="output_quality" value="-O" />
383 </conditional>
384 <param name="outputs" value="r1,r2,s,other" />
385 <conditional name="idxout_cond">
386 <param name="idxout_select" value="yes"/>
387 <param name="write1st" value="yes"/>
388 <param name="barcode_tag" value="BC"/>
389 <param name="index_format" value="n2i2"/>
390 </conditional>
391 <output name="forward" file="10.1.fq.expected" ftype="fastqsanger" />
392 <output name="reverse" file="10.2.fq.expected" ftype="fastqsanger" />
393 <output name="singletons" file="10.s.fq.expected" ftype="fastqsanger" />
394 <output name="output" file="2.stdout.expected" ftype="fastqsanger" />
395 <output name="i1" file="bc10.fq.expected" ftype="fastqsanger" />
396 </test>
397 <!--# test -O flag with OQ tags-->
398 <!--test_cmd($opts, out=>'bam2fq/2.stdout.expected', out_map=>{'1.fq' => 'bam2fq/10.1.fq.expected', '2.fq' => 'bam2fq/10.2.fq.expected', 's.fq' => 'bam2fq/10.s.fq.expected', 'bc.fq' => 'bam2fq/bc10.fq.expected'}, cmd=>"$$opts{bin}/samtools fastq @$threads \-\-barcode-tag BC -O \-\-index-format 'n2i2' \-\-i1 $$opts{path}/bc.fq -s $$opts{path}/s.fq -1 $$opts{path}/1.fq -2 $$opts{path}/2.fq $$opts{path}/dat/bam2fq.010.sam");-->
399 <test>
400 <param name="input" value="bam2fq.010.sam" ftype="sam" />
401 <conditional name="output_fmt_cond">
402 <param name="output_fmt_select" value="fastqsanger" />
403 <param name="output_quality" value="-O" />
404 </conditional>
405 <param name="outputs" value="r1,r2,s,other" />
406 <conditional name="idxout_cond">
407 <param name="idxout_select" value="yes"/>
408 <param name="write1st" value="yes"/>
409 <param name="barcode_tag" value="BC"/>
410 <param name="index_format" value="n2i2"/>
411 </conditional>
412 <output name="forward" file="10.1.fq.expected" ftype="fastqsanger" />
413 <output name="reverse" file="10.2.fq.expected" ftype="fastqsanger" />
414 <output name="singletons" file="10.s.fq.expected" ftype="fastqsanger" />
415 <output name="output" file="2.stdout.expected" ftype="fastqsanger" />
416 <output name="i1" file="bc10.fq.expected" ftype="fastqsanger" />
417 </test>
418 <!--# tag output test with separators and -N flag-->
419 <!--test_cmd($opts, out=>'bam2fq/2.stdout.expected', out_map=>{'1.fq' => 'bam2fq/5.1.fq.expected', '2.fq' => 'bam2fq/5.2.fq.expected', 's.fq' => 'bam2fq/5.s.fq.expected', 'bc_split.fq' => 'bam2fq/bc_split.fq.expected'}, cmd=>"$$opts{bin}/samtools fastq @$threads \-\-barcode-tag BC -N \-\-index-format 'n*i*' \-\-i1 $$opts{path}/bc_split.fq -s $$opts{path}/s.fq -1 $$opts{path}/1.fq -2 $$opts{path}/2.fq $$opts{path}/dat/bam2fq.005.sam");-->
420 <test>
421 <param name="input" value="bam2fq.005.sam" ftype="sam" />
422 <conditional name="output_fmt_cond">
423 <param name="output_fmt_select" value="fastqsanger" />
424 </conditional>
425 <param name="outputs" value="r1,r2,s,other" />
426 <param name="read_numbering" value="-N"/>
427 <conditional name="idxout_cond">
428 <param name="idxout_select" value="yes"/>
429 <param name="write1st" value="yes"/>
430 <param name="barcode_tag" value="BC"/>
431 <param name="index_format" value="n*i*"/>
432 </conditional>
433 <output name="forward" file="5.1.fq.expected" ftype="fastqsanger" />
434 <output name="reverse" file="5.2.fq.expected" ftype="fastqsanger" />
435 <output name="singletons" file="5.s.fq.expected" ftype="fastqsanger" />
436 <output name="output" file="2.stdout.expected" ftype="fastqsanger" />
437 <output name="i1" file="bc_split.fq.expected" ftype="fastqsanger" />
438 </test>
439 <!--# -t flag-->
440 <!--test_cmd($opts, out=>'bam2fq/2.stdout.expected', out_map=>{'1.fq' => 'bam2fq/6.1.fq.expected', '2.fq' => 'bam2fq/6.2.fq.expected', 's.fq' => 'bam2fq/6.s.fq.expected'}, cmd=>"$$opts{bin}/samtools fastq @$threads -N -t -s $$opts{path}/s.fq -1 $$opts{path}/1.fq -2 $$opts{path}/2.fq $$opts{path}/dat/bam2fq.005.sam");-->
441 <test>
442 <param name="input" value="bam2fq.005.sam" ftype="sam" />
443 <conditional name="output_fmt_cond">
444 <param name="output_fmt_select" value="fastqsanger" />
445 </conditional>
446 <param name="outputs" value="r1,r2,s,other" />
447 <param name="copy_tags" value="-t" />
448 <param name="read_numbering" value="-N"/>
449 <output name="forward" file="6.1.fq.expected" ftype="fastqsanger" />
450 <output name="reverse" file="6.2.fq.expected" ftype="fastqsanger" />
451 <output name="singletons" file="6.s.fq.expected" ftype="fastqsanger" />
452 <output name="output" file="2.stdout.expected" ftype="fastqsanger" />
453 </test>
454 <!--# -T flag-->
455 <!--test_cmd($opts, out=>'bam2fq/2.stdout.expected', out_map=>{'1.fq' => 'bam2fq/7.1.fq.expected', '2.fq' => 'bam2fq/7.2.fq.expected', 's.fq' => 'bam2fq/7.s.fq.expected'}, cmd=>"$$opts{bin}/samtools fastq @$threads -N -t -T MD,ia -s $$opts{path}/s.fq -1 $$opts{path}/1.fq -2 $$opts{path}/2.fq $$opts{path}/dat/bam2fq.005.sam");-->
456 <test>
457 <param name="input" value="bam2fq.005.sam" ftype="sam" />
458 <conditional name="output_fmt_cond">
459 <param name="output_fmt_select" value="fastqsanger" />
460 </conditional>
461 <param name="outputs" value="r1,r2,s,other" />
462 <param name="copy_tags" value="-t" />
463 <param name="copy_arb_tags" value="MD,ia" />
464 <param name="read_numbering" value="-N"/>
465 <output name="forward" file="7.1.fq.expected" ftype="fastqsanger" />
466 <output name="reverse" file="7.2.fq.expected" ftype="fastqsanger" />
467 <output name="singletons" file="7.s.fq.expected" ftype="fastqsanger" />
468 <output name="output" file="2.stdout.expected" ftype="fastqsanger" />
469 </test>
470 <!--# -i flag with no index-->
471 <!--test_cmd($opts, out=>'bam2fq/2.stdout.expected', out_map=>{'1.fq' => 'bam2fq/7.1.fq.expected', '2.fq' => 'bam2fq/7.2.fq.expected', 's.fq' => 'bam2fq/7.s.fq.expected'}, cmd=>"$$opts{bin}/samtools fastq @$threads -N -t -i -T MD,ia -s $$opts{path}/s.fq -1 $$opts{path}/1.fq -2 $$opts{path}/2.fq $$opts{path}/dat/bam2fq.005.sam");-->
472 <test>
473 <param name="input" value="bam2fq.005.sam" ftype="sam" />
474 <conditional name="output_fmt_cond">
475 <param name="output_fmt_select" value="fastqsanger" />
476 <param name="ilumina_casava" value="-i" />
477 </conditional>
478 <param name="outputs" value="r1,r2,s,other" />
479 <param name="copy_tags" value="-t" />
480 <param name="copy_arb_tags" value="MD,ia" />
481 <param name="read_numbering" value="-N"/>
482 <output name="forward" file="7.1.fq.expected" ftype="fastqsanger" />
483 <output name="reverse" file="7.2.fq.expected" ftype="fastqsanger" />
484 <output name="singletons" file="7.s.fq.expected" ftype="fastqsanger" />
485 <output name="output" file="2.stdout.expected" ftype="fastqsanger" />
486 </test>
487 <!--# -i flag with index-->
488 <!--test_cmd($opts, out=>'bam2fq/2.stdout.expected', out_map=>{'1.fq' => 'bam2fq/8.1.fq.expected', '2.fq' => 'bam2fq/8.2.fq.expected', 's.fq' => 'bam2fq/8.s.fq.expected', 'i.fq' => 'bam2fq/8.i.fq.expected'}, cmd=>"$$opts{bin}/samtools fastq @$threads \-\-barcode-tag BC -i \-\-index-format 'n2i2' \-\-i1 $$opts{path}/i.fq -s $$opts{path}/s.fq -1 $$opts{path}/1.fq -2 $$opts{path}/2.fq $$opts{path}/dat/bam2fq.004.sam");-->
489 <test>
490 <param name="input" value="bam2fq.004.sam" ftype="sam" />
491 <conditional name="output_fmt_cond">
492 <param name="output_fmt_select" value="fastqsanger" />
493 <param name="ilumina_casava" value="-i" />
494 </conditional>
495 <param name="outputs" value="r1,r2,s,other" />
496 <conditional name="idxout_cond">
497 <param name="idxout_select" value="yes"/>
498 <param name="write1st" value="yes"/>
499 <param name="barcode_tag" value="BC"/>
500 <param name="index_format" value="n2i2"/>
501 </conditional>
502 <output name="forward" file="8.1.fq.expected" ftype="fastqsanger" />
503 <output name="reverse" file="8.2.fq.expected" ftype="fastqsanger" />
504 <output name="singletons" file="8.s.fq.expected" ftype="fastqsanger" />
505 <output name="output" file="2.stdout.expected" ftype="fastqsanger" />
506 <output name="i1" file="8.i.fq.expected" ftype="fastqsanger" />
96 </test> 507 </test>
97 </tests> 508 </tests>
98 <help> 509 <help><![CDATA[
99 <![CDATA[ 510 This tool uses `Samtools <http://www.htslib.org/>`_ to extract sequences from a
100 This tool uses `Samtools <http://www.htslib.org/>`_ to extract sequences from a SAM or BAM file in FASTA or FASTQ format. 511 SAM or BAM file in FASTA or FASTQ format.
101 ]]> 512 ]]>
102 </help> 513 </help>
103 <expand macro="citations" /> 514 <expand macro="citations" />
104 </tool> 515 </tool>