Skip to content

Commit

Permalink
Use usher-sampled if installed (#499)
Browse files Browse the repository at this point in the history
* Use the much faster usher-sampled if it is installed; otherwise, print out a message recommending that the user update usher.
  • Loading branch information
AngieHinrichs authored Jan 3, 2023
1 parent 3769273 commit 888f4d1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pangolin/scripts/usher.smk
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,20 @@ rule usher_inference:
if [ -s {input.fasta:q} ]; then
cat {input.reference:q} > {params.ref_fa:q}
echo >> {params.ref_fa:q}
usher=usher
threads={workflow.cores}
if usher-sampled --help >& /dev/null; then
usher="usher-sampled --optimization_radius 0"
else
echo ""
echo "*** usher-sampled is not installed -- please upgrade usher to at least v0.6.1 ***"
echo "*** If you used conda to install usher, run 'conda update --no-pin usher' ***"
echo "*** Alternatively if mamba is installed, run 'mamba update --no-pin usher' ***"
echo ""
fi
cat {input.fasta:q} >> {params.ref_fa:q}
faToVcf -includeNoAltN {params.ref_fa:q} {params.vcf:q}
usher -n -D -i {input.usher_protobuf:q} -v {params.vcf:q} -T {workflow.cores} -d '{config[tempdir]}' &> {log}
$usher -n -D -i {input.usher_protobuf:q} -v {params.vcf:q} -T $threads -d '{config[tempdir]}' &> {log}
else
rm -f {output.txt:q}
touch {output.txt:q}
Expand Down

0 comments on commit 888f4d1

Please sign in to comment.