comparison bbmap.xml @ 4:6d44c9f1a42b draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bbtools commit 1800b13dcea155e96558f6b80989cf719071e300"
author iuc
date Thu, 03 Feb 2022 21:13:25 +0000
parents 8157a81f511c
children 81cbb6a4c1ca
comparison
equal deleted inserted replaced
3:8157a81f511c 4:6d44c9f1a42b
1 <tool id="bbtools_bbmap" name="BBTools: BBMap" version="@WRAPPER_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@"> 1 <tool id="bbtools_bbmap" name="BBTools: BBMap" version="@WRAPPER_VERSION@+galaxy3" profile="@PROFILE@">
2 <description>short-read aligner</description> 2 <description>short-read aligner</description>
3 <macros> 3 <macros>
4 <import>macros.xml</import> 4 <import>macros.xml</import>
5 </macros> 5 </macros>
6 <expand macro="requirements"/> 6 <expand macro="requirements"/>
42 #set read2_identifier = re.sub('[^\s\w\-]', '_', str($read2.name)) 42 #set read2_identifier = re.sub('[^\s\w\-]', '_', str($read2.name))
43 #set read2_file = $read2_identifier + $ext 43 #set read2_file = $read2_identifier + $ext
44 ln -s '${read2}' '${read2_file}' && 44 ln -s '${read2}' '${read2_file}' &&
45 #end if 45 #end if
46 46
47 bbmap.sh t=\${GALAXY_SLOTS:-4} ref='${ref}' 47 bbmap.sh
48
49 #### Indexing Parameters
50 nodisk=f
51 ref='${ref}'
52 k=13
53 usemodulo=f
54 rebuild=f
55
56 #### Input Parameters
48 #if str($input_type_cond.input_type) == 'single': 57 #if str($input_type_cond.input_type) == 'single':
49 in='${read1_file}' 58 in='${read1_file}'
50 #else: 59 #else:
51 in1='${read1_file}' in2='${read2_file}' 60 in='${read1_file}' in2='${read2_file}'
52 #end if 61 #end if
53 #if str($output_sort) == 'coordinate': 62 fastareadlen=500
54 out='mapped.bam'; samtools sort -@\${GALAXY_SLOTS:-4} -T "\${TMPDIR:-.}" -O bam -o '$output' 'mapped.bam' 63 unpigz=f
55 #elif str($output_sort) == 'name': 64 touppercase=t
56 out='mapped.bam'; samtools sort -n -@\${GALAXY_SLOTS:-4} -T '\${TMPDIR:-.}' -O bam -o '$output' 'mapped.bam' 65
66 #### Sampling Parameters
67 reads=-1
68 samplerate=1
69 skipreads=0
70
71 #### Mapping Parameters
72 maxindel=$mapping_options.maxindel
73 strictmaxindel='$mapping_options.strictmaxindel'
74 tipsearch=$mapping_options.tipsearch
75 minid=$mapping_options.minid
76 minhits=$mapping_options.minhits
77 local='$mapping_options.local'
78 perfectmode='$mapping_options.perfectmode'
79 semiperfectmode='$mapping_options.semiperfectmode'
80 threads=\${GALAXY_SLOTS:-4}
81 ambiguous='$mapping_options.ambiguous'
82 samestrandpairs='$mapping_options.samestrandpairs'
83 requirecorrectstrand='$mapping_options.requirecorrectstrand'
84 killbadpairs='$mapping_options.killbadpairs'
85 pairedonly='$mapping_options.pairedonly'
86 rcomp='$mapping_options.rcomp'
87 rcompmate='$mapping_options.rcompmate'
88 pairlen=$mapping_options.pairlen
89 rescuedist=$mapping_options.rescuedist
90 rescuemismatches=$mapping_options.rescuemismatches
91 averagepairdist=$mapping_options.averagepairdist
92 deterministic='$mapping_options.deterministic'
93 bandwidthratio='$mapping_options.bandwidthratio'
94 bandwidth='$mapping_options.bandwidth'
95 usejni='f'
96 maxsites2=$mapping_options.maxsites2
97 ignorefrequentkmers='$mapping_options.ignorefrequentkmers'
98 excludefraction=$mapping_options.excludefraction
99 greedy='$mapping_options.greedy'
100 kfilter=$mapping_options.kfilter
101
102 #### Quality and Trimming Parameters
103 qin='auto'
104 qout='auto'
105 qtrim='$qt_options.qtrim'
106 untrim='$qt_options.untrim'
107 trimq=$qt_options.trimq
108 mintrimlength=$qt_options.mintrimlength
109 fakefastaquality=$qt_options.fakefastaquality
110 ignorebadquality='$qt_options.ignorebadquality'
111 usequality='$qt_options.usequality'
112 minaveragequality=$qt_options.minaveragequality
113 maqb=$qt_options.maqb
114
115 #### Post-Filtering options
116 idfilter=$pf_options.idfilter
117 subfilter=$pf_options.subfilter
118 insfilter=$pf_options.insfilter
119 delfilter=$pf_options.delfilter
120 indelfilter=$pf_options.indelfilter
121 editfilter=$pf_options.editfilter
122 inslenfilter=$pf_options.inslenfilter
123 dellenfilter=$pf_options.dellenfilter
124 nfilter=$pf_options.nfilter
125
126 #### Output parameters
127 secondary='$output_options.secondary'
128 maxsites=$output_options.maxsites
129 sssr=$output_options.sssr
130 ssao='$output_options.ssao'
131 quickmatch='$output_options.quickmatch'
132 trimreaddescriptions='$output_options.trimreaddescriptions'
133 machineout='$output_options.machineout'
134 printunmappedcount='$output_options.printunmappedcount'
135 renamebyinsert='$output_options.renamebyinsert'
136 #if str($output_options.output_sort) == 'coordinate':
137 out='all_reads.bam'
138 outu='unmapped_reads.bam'
139 outm='mapped_reads.bam'
140 && samtools sort -@\${GALAXY_SLOTS:-4} -T "\${TMPDIR:-.}" -O bam -o '$output_all_reads' 'all_reads.bam'
141 && samtools sort -@\${GALAXY_SLOTS:-4} -T "\${TMPDIR:-.}" -O bam -o '$output_unmapped_reads' 'unmapped_reads.bam'
142 && samtools sort -@\${GALAXY_SLOTS:-4} -T "\${TMPDIR:-.}" -O bam -o '$output_mapped_reads' 'mapped_reads.bam'
143 #elif str($output_options.output_sort) == 'name':
144 out='all_reads.bam'
145 outu='unmapped_reads.bam'
146 outm='mapped_reads.bam'
147 && samtools sort -n -@\${GALAXY_SLOTS:-4} -T '\${TMPDIR:-.}' -O bam -o '$output_all_reads' 'all_reads.bam'
148 && samtools sort -n -@\${GALAXY_SLOTS:-4} -T '\${TMPDIR:-.}' -O bam -o '$output_unmapped_reads' 'unmapped_reads.bam'
149 && samtools sort -n -@\${GALAXY_SLOTS:-4} -T '\${TMPDIR:-.}' -O bam -o '$output_mapped_reads' 'mapped_reads.bam'
57 #else: 150 #else:
58 out='mapped.bam' && mv 'mapped.bam' '$output' 151 out='all_reads.bam'
152 outu='unmapped_reads.bam'
153 outm='mapped_reads.bam'
154 && mv 'all_reads.bam' '$output_all_reads'
155 && mv 'unmapped_reads.bam' '$output_unmapped_reads'
156 && mv 'mapped_reads.bam' '$output_mapped_reads'
59 #end if 157 #end if
60 ]]></command> 158 ]]></command>
61 <inputs> 159 <inputs>
62 <expand macro="input_type_cond"/> 160 <expand macro="input_type_cond"/>
63 <expand macro="reference_source_cond"/> 161 <expand macro="reference_source_cond"/>
64 <param name="output_sort" type="select" label="BAM sorting mode" help="The 'Not sorted' option can significantly extend the run time of the tool (it runs using a single thread)."> 162 <section name="mapping_options" title="Mapping options">
65 <option value="coordinate" selected="True">Sort by chromosomal coordinates</option> 163 <param argument="maxindel" type="integer" value="16000" label="Maximum indel length" help="Don't look for indels longer than this (lower is faster)"/>
66 <option value="name">Sort by read names</option> 164 <param argument="strictmaxindel" type="boolean" truevalue="t" falsevalue="f" checked="false" label="Do not allow indels longer than the specified maximum indel length?" help="By default these are not sought, but may be found anyway"/>
67 <option value="unsorted">Not sorted (sorted as input)</option> 165 <param argument="tipsearch" type="integer" value="100" label="Look this far for read-end deletions with anchors shorter than K using brute force"/>
68 </param> 166 <param argument="minid" type="float" value="0.76" label="Approximate minimum alignment identity to look for" help="Higher is faster and less sensitive"/>
167 <param argument="minhits" type="integer" value="1" label="Minimum number of seed hits required for candidate sites" help="Higher is faster"/>
168 <param argument="local" type="boolean" truevalue="t" falsevalue="f" checked="false" label="Use local (rather than global) alignments?"/>
169 <param argument="perfectmode" type="boolean" truevalue="t" falsevalue="f" checked="false" label="Allow only perfect mappings?"/>
170 <param argument="semiperfectmode" type="boolean" truevalue="t" falsevalue="f" checked="false" label="Allow only perfect and semiperfect (perfect except for N's in the reference) mappings?"/>
171 <param name="ambiguous" type="select" label="Specify behavior on ambiguously-mapped reads with multiple top-scoring mapping locations">
172 <option value="best" selected="true">Use the first best site</option>
173 <option value="toss">Consider unmapped</option>
174 <option value="random">Select one top-scoring site randomly</option>
175 <option value="all">Retain all top-scoring sites</option>
176 </param>
177 <param argument="samestrandpairs" type="boolean" truevalue="t" falsevalue="f" checked="false" label="Map paired reads to the same strand?" help="No value will map to opposite strands"/>
178 <param argument="requirecorrectstrand" type="boolean" truevalue="t" falsevalue="f" checked="true" label="Forbid pairing of reads without correct strand orientation?" help="Select No for long-mate-pair libraries"/>
179 <param argument="killbadpairs" type="boolean" truevalue="t" falsevalue="f" checked="false" label="Mark the read with the lower mapping quality as unmapped if a read pair is mapped with an inappropriate insert size or orientation?"/>
180 <param argument="pairedonly" type="boolean" truevalue="t" falsevalue="f" checked="false" label="Treat unpaired reads as unmapped?"/>
181 <param argument="rcomp" type="boolean" truevalue="t" falsevalue="f" checked="false" label="Reverse complement both reads prior to mapping (for LMP outward-facing libraries)?"/>
182 <param argument="rcompmate" type="boolean" truevalue="t" falsevalue="f" checked="false" label="Reverse complement read2 prior to mapping?"/>
183 <param argument="pairlen" type="integer" value="32000" label="Maximum allowed distance between paired reads"/>
184 <param argument="rescuedist" type="integer" value="1200" label="Maximum average insert size for trying to rescue paired reads" help="Lower is faster"/>
185 <param argument="rescuemismatches" type="integer" value="32" label="Maximum mismatches allowed in a rescued read" help="Lower is faster"/>
186 <param argument="averagepairdist" type="integer" value="100" label="Initial average distance between paired reads" help="Varies dynamically; does not need to be specified"/>
187 <param argument="deterministic" type="boolean" truevalue="t" falsevalue="f" checked="false" label="Run in deterministic mode?" help="BBMap is deterministic without this flag if using single-ended reads?"/>
188 <param argument="bandwidthratio" type="integer" value="0" label="Restrict alignment band to this fraction of read length" help="Zero value ignores"/>
189 <param argument="bandwidth" type="integer" value="0" label="Set the bandwidth directly to this fraction of read length" help="Faster but less accurate"/>
190 <param argument="maxsites2" type="integer" value="800" label="Maximum number of alignments per read to output"/>
191 <param argument="ignorefrequentkmers" type="boolean" truevalue="t" falsevalue="f" checked="true" label="Discard low-information kmers that occur often?"/>
192 <param argument="excludefraction" type="float" value="0.03" label="Fraction of kmers to ignore" help="For example, 0.03 will ignore the most common 3% of kmers"/>
193 <param argument="greedy" type="boolean" truevalue="t" falsevalue="f" checked="true" label="Use a greedy algorithm to discard the least-useful kmers on a per-read basis?"/>
194 <param argument="kfilter" type="integer" value="0" label="Potential mapping sites must have at least this many consecutive exact matches" help="Zero value ignores"/>
195 </section>
196 <section name="qt_options" title="Quality and trimming options">
197 <param name="qtrim" type="select" label="Select option for quality trimming ends before mapping">
198 <option value="f" selected="true">No trimming</option>
199 <option value="l">Trim left</option>
200 <option value="r">Trim right</option>
201 <option value="lr">Trim both</option>
202 </param>
203 <param argument="untrim" type="boolean" truevalue="t" falsevalue="f" checked="false" label="Undo trimming after mapping?" help="Untrimmed bases will be soft-clipped in cigar strings"/>
204 <param argument="trimq" type="integer" value="6" label="Trim regions with average quality below this value"/>
205 <param argument="mintrimlength" type="integer" value="60" label="Don't trim reads to be shorter than this value"/>
206 <param argument="fakefastaquality" type="integer" value="-1" max="50" label="Set to a positive number 1-50 to generate fake quality strings for fasta input reads"/>
207 <param argument="ignorebadquality" type="boolean" truevalue="t" falsevalue="f" checked="false" label="Keep going, rather than crashing, if a read has out-of-range quality values?"/>
208 <param argument="usequality" type="boolean" truevalue="t" falsevalue="f" checked="true" label="Use quality scores when determining which read kmers to use as seeds?"/>
209 <param argument="minaveragequality" type="integer" value="0" label="Do not map reads with average quality below this value"/>
210 <param argument="maqb" type="integer" value="0" label="Calculate maq from this many initial bases" help="Zero value ignores"/>
211 </section>
212 <section name="output_options" title="Output options">
213 <param argument="secondary" type="boolean" truevalue="t" falsevalue="f" checked="false" label="Output secondary alignments?"/>
214 <param argument="maxsites" type="integer" value="5" label="Maximum number of total alignments to output per read" help="Relevant only when outputting secondary alignments"/>
215 <param argument="sssr" type="float" value="0.95" label="Output only secondary alignments with score of at least this fraction of primary"/>
216 <param argument="ssao" type="boolean" truevalue="t" falsevalue="f" checked="false" label="Only output secondary alignments for ambiguously-mapped reads?"/>
217 <param argument="quickmatch" type="boolean" truevalue="t" falsevalue="f" checked="false" label="Generate cigar strings more quickly?"/>
218 <param argument="trimreaddescriptions" type="boolean" truevalue="t" falsevalue="f" checked="false" label="Truncate read and ref names at the first whitespace, assuming that the remainder is a comment or description?"/>
219 <param argument="machineout" type="boolean" truevalue="t" falsevalue="f" checked="false" label="Output statistics in machine-friendly (key=value) format?"/>
220 <param argument="printunmappedcount" type="boolean" truevalue="t" falsevalue="f" checked="false" label="Output the total number of unmapped reads and bases?" help="If input is paired, the number will be of pairs for which both reads are unmapped"/>
221 <param argument="renamebyinsert" type="boolean" truevalue="t" falsevalue="f" checked="false" label="Rename reads based on their mapped insert size?"/>
222 <param name="output_sort" type="select" label="BAM sorting mode" help="The 'Not sorted' option can significantly extend the run time of the tool (it runs using a single thread)">
223 <option value="coordinate" selected="True">Sort by chromosomal coordinates</option>
224 <option value="name">Sort by read names</option>
225 <option value="unsorted">Not sorted (sorted as input)</option>
226 </param>
227 </section>
228 <section name="pf_options" title="Post-filtering options">
229 <param argument="idfilter" type="integer" value="0" min="0" max="1" label="Specify exact minimum identity allowed for alignments to be output" help="Independent of approximate minimum alignment identity to look for"/>
230 <param argument="subfilter" type="integer" value="-1" label="Ban alignments with more than this many substitutions" help="Negative value ignores"/>
231 <param argument="insfilter" type="integer" value="-1" label="Ban alignments with more than this many insertions" help="Negative value ignores"/>
232 <param argument="delfilter" type="integer" value="-1" label="Ban alignments with more than this many deletions" help="Negative value ignores"/>
233 <param argument="indelfilter" type="integer" value="-1" label="Ban alignments with more than this many indels" help="Negative value ignores"/>
234 <param argument="editfilter" type="integer" value="-1" label="Ban alignments with more than this many edits" help="Negative value ignores"/>
235 <param argument="inslenfilter" type="integer" value="-1" label="Ban alignments with an insertion longer than this" help="Negative value ignores"/>
236 <param argument="dellenfilter" type="integer" value="-1" label="Ban alignments with a deletion longer than this" help="Negative value ignores"/>
237 <param argument="nfilter" type="integer" value="-1" label="Ban alignments with more than this many ns (includes nocall, noref, and off scaffold ends)" help="Negative value ignores"/>
238 </section>
69 </inputs> 239 </inputs>
70 <outputs> 240 <outputs>
71 <data format="bam" name="output" label="${tool.name} on ${on_string} (mapped reads in BAM format)"> 241 <data format="bam" name="output_all_reads" label="${tool.name} on ${on_string} (all reads)">
72 <expand macro="dbKeyActionsBBMap"/> 242 <expand macro="dbKeyActionsBBMap"/>
73 <change_format> 243 <change_format>
74 <when input="output_sort" value="name" format="qname_sorted.bam" /> 244 <when input="output_options.output_sort" value="name" format="qname_sorted.bam"/>
75 <when input="output_sort" value="unsorted" format="qname_input_sorted.bam" /> 245 <when input="output_options.output_sort" value="unsorted" format="qname_input_sorted.bam"/>
246 </change_format>
247 </data>
248 <data format="bam" name="output_unmapped_reads" label="${tool.name} on ${on_string} (unmapped reads)">
249 <expand macro="dbKeyActionsBBMap"/>
250 <change_format>
251 <when input="output_options.output_sort" value="name" format="qname_sorted.bam"/>
252 <when input="output_options.output_sort" value="unsorted" format="qname_input_sorted.bam"/>
253 </change_format>
254 </data>
255 <data format="bam" name="output_mapped_reads" label="${tool.name} on ${on_string} (mapped reads)">
256 <expand macro="dbKeyActionsBBMap"/>
257 <change_format>
258 <when input="output_options.output_sort" value="name" format="qname_sorted.bam"/>
259 <when input="output_options.output_sort" value="unsorted" format="qname_input_sorted.bam"/>
76 </change_format> 260 </change_format>
77 </data> 261 </data>
78 </outputs> 262 </outputs>
79 <tests> 263 <tests>
80 <!-- Single file, cached reference, output coordinate sorted --> 264 <!-- Single file, cached reference, output coordinate sorted -->
81 <test expect_num_outputs="1"> 265 <test expect_num_outputs="3">
82 <param name="input_type" value="single"/> 266 <param name="input_type" value="single"/>
83 <param name="read1" value="13-1941-6_S4_L001_R1_600000.fastq.gz"/> 267 <param name="read1" value="13-1941-6_S4_L001_R1_600000.fastq.gz"/>
84 <output name="output" file="output1.bam" ftype="bam" lines_diff="4"> 268 <param name="output_sort" value="coordinate"/>
85 <metadata name="dbkey" value="89" /> 269 <output name="output_all_reads" ftype="bam">
270 <metadata name="dbkey" value="89"/>
271 <assert_contents>
272 <has_size value="9433" delta="300"/>
273 </assert_contents>
274 </output>
275 <output name="output_unmapped_reads" ftype="bam">
276 <metadata name="dbkey" value="89"/>
277 <assert_contents>
278 <has_size value="9432" delta="300"/>
279 </assert_contents>
280 </output>
281 <output name="output_mapped_reads" ftype="bam">
282 <metadata name="dbkey" value="89"/>
283 <assert_contents>
284 <has_size value="938" delta="100"/>
285 </assert_contents>
86 </output> 286 </output>
87 </test> 287 </test>
88 <!-- Paired reads in separate datasets, cached reference, output name sorted --> 288 <!-- Paired reads in separate datasets, cached reference, output name sorted -->
89 <test expect_num_outputs="1"> 289 <test expect_num_outputs="3">
90 <param name="input_type" value="pair"/> 290 <param name="input_type" value="pair"/>
91 <param name="read1" value="13-1941-6_S4_L001_R1_600000.fastq.gz"/> 291 <param name="read1" value="13-1941-6_S4_L001_R1_600000.fastq.gz"/>
92 <param name="read2" value="13-1941-6_S4_L001_R2_600000.fastq.gz"/> 292 <param name="read2" value="13-1941-6_S4_L001_R2_600000.fastq.gz"/>
93 <param name="output_sort" value="name"/> 293 <param name="output_sort" value="name"/>
94 <output name="output" file="output2.bam" ftype="qname_sorted.bam" lines_diff="4"> 294 <output name="output_all_reads" ftype="qname_sorted.bam">
95 <metadata name="dbkey" value="89" /> 295 <metadata name="dbkey" value="89"/>
296 <assert_contents>
297 <has_size value="17103" delta="600"/>
298 </assert_contents>
299 </output>
300 <output name="output_unmapped_reads" ftype="qname_sorted.bam">
301 <metadata name="dbkey" value="89"/>
302 <assert_contents>
303 <has_size value="17105" delta="600"/>
304 </assert_contents>
305 </output>
306 <output name="output_mapped_reads" ftype="qname_sorted.bam">
307 <metadata name="dbkey" value="89"/>
308 <assert_contents>
309 <has_size value="967" delta="100"/>
310 </assert_contents>
96 </output> 311 </output>
97 </test> 312 </test>
98 <!-- Collection of Paired reads, history reference, output unsorted --> 313 <!-- Collection of Paired reads, history reference, output unsorted -->
99 <test expect_num_outputs="1"> 314 <test expect_num_outputs="3">
100 <param name="input_type" value="paired"/> 315 <param name="input_type" value="paired"/>
101 <param name="reads_collection"> 316 <param name="reads_collection">
102 <collection type="paired"> 317 <collection type="paired">
103 <element name="forward" value="13-1941-6_S4_L001_R1_600000.fastq.gz"/> 318 <element name="forward" value="13-1941-6_S4_L001_R1_600000.fastq.gz"/>
104 <element name="reverse" value="13-1941-6_S4_L001_R2_600000.fastq.gz"/> 319 <element name="reverse" value="13-1941-6_S4_L001_R2_600000.fastq.gz"/>
105 </collection> 320 </collection>
106 </param> 321 </param>
107 <param name="ref_source" value="history"/> 322 <param name="ref_source" value="history"/>
108 <param name="reference" value="NC_002945v4.fasta" dbkey="89" ftype="fasta"/> 323 <param name="reference" value="NC_002945v4.fasta" dbkey="89" ftype="fasta"/>
109 <param name="output_sort" value="unsorted"/> 324 <param name="output_sort" value="unsorted"/>
110 <output name="output" file="output3.bam" ftype="qname_input_sorted.bam" lines_diff="4"> 325 <output name="output_all_reads" ftype="qname_input_sorted.bam">
111 <metadata name="dbkey" value="89" /> 326 <metadata name="dbkey" value="89"/>
327 <assert_contents>
328 <has_size value="17059" delta="600"/>
329 </assert_contents>
330 </output>
331 <output name="output_unmapped_reads" ftype="qname_input_sorted.bam">
332 <metadata name="dbkey" value="89"/>
333 <assert_contents>
334 <has_size value="17059" delta="600"/>
335 </assert_contents>
336 </output>
337 <output name="output_mapped_reads" ftype="qname_input_sorted.bam">
338 <metadata name="dbkey" value="89"/>
339 <assert_contents>
340 <has_size value="906" delta="100"/>
341 </assert_contents>
112 </output> 342 </output>
113 </test> 343 </test>
114 </tests> 344 </tests>
115 <help> 345 <help>
116 **What it does** 346 **What it does**