comparison bowtie2_wrapper.xml @ 32:d5ceb9f3c25b draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bowtie2 commit 7c23f328dedbbf24693ddfcc4ebc6b5ee1801767
author iuc
date Mon, 13 May 2024 13:49:14 +0000
parents 0d4acadabb04
children
comparison
equal deleted inserted replaced
31:0d4acadabb04 32:d5ceb9f3c25b
111 #set read1 = "input_f.fastq" 111 #set read1 = "input_f.fastq"
112 #end if 112 #end if
113 ln -f -s '${library.input_1}' ${read1} && 113 ln -f -s '${library.input_1}' ${read1} &&
114 #end if 114 #end if
115 115
116
117 ## compute number of threads to be used for bowtie2
118 ## the bowtie parameter -p specifies the number of alignment threads to use (in
119 ## addition to a control thread) # just using GALAXY_SLOTS will lead to
120 ## overcommiting ressources (in particular because there may be a samtools sort or view
121 ## running in parallel).
122 ## for now we use one thread less than GALAXY_SLOTS
123 THREADS=\${GALAXY_SLOTS:-4} &&
124 if [ "\$THREADS" -gt 1 ]; then (( THREADS-- )); fi &&
125
116 ## execute bowtie2 126 ## execute bowtie2
117 127
118 bowtie2 128 bowtie2
119 129
120 ## number of threads 130 ## number of threads
121 -p \${GALAXY_SLOTS:-4} 131 -p "\$THREADS"
122 132
123 ## index file path 133 ## index file path
124 -x '$index_path' 134 -x '$index_path'
125 135
126 ## Input reads are fasta? 136 ## Input reads are fasta?
301 ${sam_options.reorder} 311 ${sam_options.reorder}
302 #end if 312 #end if
303 313
304 ## mapping stats (i.e. stderr from bowtie2) 314 ## mapping stats (i.e. stderr from bowtie2)
305 #if $save_mapping_stats 315 #if $save_mapping_stats
306 2> '$mapping_stats' 316 2> >(tee '$mapping_stats' >&2)
307 #end if 317 #end if
308 318
309 ## output file 319 ## output file
310 #if str( $sam_options.sam_options_selector ) == "no" or (str( $sam_options.sam_opt ) == "false" and str($sam_options.reorder) == ''): 320 #if str( $sam_options.sam_options_selector ) == "no" or (str( $sam_options.sam_opt ) == "false" and str($sam_options.reorder) == ''):
311 | samtools sort --no-PG -@\${GALAXY_SLOTS:-2} -T "\${TMPDIR:-.}" -O bam -o '$output' 321 ## Convert SAM output to sorted BAM
322 ## using the two pipe stages has the following effect
323 ## - mapping and sorting run in parallel, during this time sort produces
324 ## presorted temporary files but does not produce output (hence
325 ## view does not run)
326 ## - once mapping is finished sort will start to merge the temporary
327 ## files (which should be fast also on a single thread) gives the
328 ## sorted output to view which only compresses the files (now
329 ## using full parallelism again)
330 | samtools sort -l 0 -T "\${TMPDIR:-.}" -O bam | samtools view --no-PG -O bam -@ \${GALAXY_SLOTS:-1} -o '$output'
312 #else if $sam_options.reorder: 331 #else if $sam_options.reorder:
313 | samtools view --no-PG -bS - -o '$output' 332 | samtools view --no-PG -b -o '$output'
314 #else: 333 #else:
315 > '$output' 334 > '$output'
316 #end if 335 #end if
317 336
318 ## rename unaligned sequence files 337 ## rename unaligned sequence files