Skip to content

Commit

Permalink
Refactor augur_tree task to correctly derive FASTA basename and direc…
Browse files Browse the repository at this point in the history
…tory for iqtree model extraction
  • Loading branch information
Michal-Babins committed Nov 8, 2024
1 parent 39ece66 commit d181a17
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tasks/phylogenetic_inference/augur/task_augur_tree.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ task augur_tree {
# capture version information
augur version > VERSION

# Get alignment basename
FASTA_BASENAME=$(basename ~{aligned_fasta} .fasta)

AUGUR_RECURSION_LIMIT=10000 augur tree \
--alignment "~{aligned_fasta}" \
--output "~{build_name}_~{method}.nwk" \
Expand All @@ -35,7 +32,9 @@ task augur_tree {
# If iqtree, get the model used
if [ "~{method}" == "iqtree" ]; then
if [ "~{substitution_model}" == "auto" ]; then
MODEL=$(grep "Best-fit model:" ${FASTA_BASENAME}-delim.fasta.log | sed 's|Best-fit model: ||g;s|chosen.*||' | tr -d '\n\r')
FASTA_BASENAME=$(basename ~{aligned_fasta} .fasta)
FASTA_DIR=$(dirname ~{aligned_fasta})
MODEL=$(grep "Best-fit model:" ${FASTA_DIR}/${FASTA_BASENAME}-delim.iqtree.log | sed 's|Best-fit model: ||g;s|chosen.*||' | tr -d '\n\r')
else
MODEL="~{substitution_model}"
fi
Expand Down

0 comments on commit d181a17

Please sign in to comment.