Skip to content

Commit

Permalink
bowtie2: do not use pipes
Browse files Browse the repository at this point in the history
fixes #5983

by using a pipe bowtie2 and samtools run in parallel. since already
bowtie2 alone uses more CPU than the assigned ones (less that 1 core)
we should not do this, but run them serially.

also properly redirects stderr.
  • Loading branch information
bernt-matthias committed May 3, 2024
1 parent 921fa90 commit 0b25490
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tools/bowtie2/bowtie2_wrapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
</requirements>
<version_command>bowtie2 --version</version_command>
<command detect_errors="exit_code"><![CDATA[
## Use pipefail if available to quit with first non-zero exit code
set -o | grep -q pipefail && set -o pipefail;
## prepare bowtie2 index
#set index_path = ''
#if str($reference_genome.source) == "history":
Expand Down Expand Up @@ -303,14 +301,16 @@ bowtie2
## mapping stats (i.e. stderr from bowtie2)
#if $save_mapping_stats
2> '$mapping_stats'
2> >(tee '$mapping_stats' >&2)
#end if
## output file
#if str( $sam_options.sam_options_selector ) == "no" or (str( $sam_options.sam_opt ) == "false" and str($sam_options.reorder) == ''):
| samtools sort --no-PG -@\${GALAXY_SLOTS:-2} -T "\${TMPDIR:-.}" -O bam -o '$output'
> alignment.sam
&& samtools sort --no-PG -@\${GALAXY_SLOTS:-2} -T "\${TMPDIR:-.}" -O bam -o '$output' alignment.sam
#else if $sam_options.reorder:
| samtools view --no-PG -bS - -o '$output'
> alignment.sam
&& samtools view --no-PG -b -o '$output' alignment.sam
#else:
> '$output'
#end if
Expand Down

0 comments on commit 0b25490

Please sign in to comment.