# HG changeset patch
# User iuc
# Date 1633427576 0
# Node ID a287431cdf4f4a7c73ba253e77a52555668989d9
# Parent fb4975b507c690aff886228bd5a214f8a6510857
"planemo upload for repository https://github.com/davebx/bioext-gx/ commit c9002fa57e4d800f2c1c8d1dafbceb7681b0fcc2"
diff -r fb4975b507c6 -r a287431cdf4f bealign.xml
--- a/bealign.xml Fri Aug 20 21:04:17 2021 +0000
+++ b/bealign.xml Tue Oct 05 09:52:56 2021 +0000
@@ -3,10 +3,11 @@
to a reference using a codon alignment algorithm
macros.xml
- 1
+ 2
gawk
+ samtools
bealign --version
@@ -18,8 +19,10 @@
## and replace any unwanted characters in the sequence names with underscores.
## This should not affect the actual alignment, since any non-standard character
## in the sequences is already ignored, but the possibility remains.
+ set -o pipefail;
cat '$input' @SANITIZE@ reads.fa &&
- bealign --reference '$select_reference.reference' --alphabet $advanced.alphabet
+ ## bealign's parallel job executor uses the NCPU env variable
+ NCPU=\${GALAXY_SLOTS:-2} bealign --reference '$select_reference.reference' --alphabet $advanced.alphabet
#if $advanced.expected_identity:
--expected-identity $advanced.expected_identity
#end if
@@ -29,26 +32,32 @@
--score-matrix $advanced.score_matrix
$advanced.reverse_complement
$advanced.keep_reference
- reads.fa '$output'
- #set $input_background = False
- #if $background_source.selection == 'history':
- #if $background_source.sequences:
- #set $input_background = $background_source.sequences
- #end if
- #else:
- #if $background_source.sequences:
- #set $input_background = $background_source.sequences.fields.path
- #end if
+ ## bypass bealign's internal pysam-based, single-threaded BAM sorting
+ --no-sort
+ reads.fa bealign_out.bam &&
+ samtools sort -@\${GALAXY_SLOTS:-2} -T "\${TMPDIR:-.}" -O bam -o '$output' bealign_out.bam
+ #set $input_background = False
+ #if $background_source.selection == 'history':
+ #if $background_source.sequences:
+ #set $input_background = $background_source.sequences
+ #end if
+ #else:
+ #if $background_source.sequences:
+ #set $input_background = $background_source.sequences.fields.path
#end if
- #if $input_background:
- && cat '$input_background' @SANITIZE@ background.fa &&
- bealign --reference '$select_reference.reference' --alphabet $advanced.alphabet
- #if $advanced.expected_identity:
- --expected-identity $advanced.expected_identity
- #end if
- --keep-reference --score-matrix $advanced.score_matrix $advanced.reverse_complement
- background.fa '$background'
+ #end if
+ #if $input_background:
+ && cat '$input_background' @SANITIZE@ background.fa &&
+ NCPU=\${GALAXY_SLOTS:-2} bealign --reference '$select_reference.reference' --alphabet $advanced.alphabet
+ #if $advanced.expected_identity:
+ --expected-identity $advanced.expected_identity
#end if
+ --keep-reference --score-matrix $advanced.score_matrix $advanced.reverse_complement
+ ## bypass bealign's internal pysam-based, single-threaded BAM sorting
+ --no-sort
+ background.fa bealign_background.bam &&
+ samtools sort -@\${GALAXY_SLOTS:-2} -T "\${TMPDIR:-.}" -O bam -o '$background' bealign_background.bam
+ #end if
#set $reference_name = str($select_reference.reference)
#if $select_reference.reference_type == 'preset' and $select_reference.save_reference:
&& python '$__tool_directory__/copy_reference.py' --reference '$reference_name' --dataset '$saved_reference'
diff -r fb4975b507c6 -r a287431cdf4f test-data/bealign-out3-background.bam
Binary file test-data/bealign-out3-background.bam has changed
diff -r fb4975b507c6 -r a287431cdf4f test-data/bealign_selection.loc
--- a/test-data/bealign_selection.loc Fri Aug 20 21:04:17 2021 +0000
+++ b/test-data/bealign_selection.loc Tue Oct 05 09:52:56 2021 +0000
@@ -1,1 +1,1 @@
-CoV2-nsp8 SARS-CoV-2: nsp8 ${HERE}/nsp8.fa
+CoV2-nsp8 SARS-CoV-2: nsp8 ${__HERE__}/nsp8.fa