Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Augur] Add augur tree iqtree model type to output #674

Merged
merged 7 commits into from
Nov 14, 2024
1 change: 1 addition & 0 deletions docs/workflows/phylogenetic_construction/augur.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ The Nextstrain team hosts documentation surrounding the Augur workflow → Auspi
| auspice_input_json | File | JSON file used as input to Auspice |
| combined_assemblies | File | Concatenated FASTA file containing all samples |
| distance_tree | File | The distance tree created in Newick (.nwk) format |
| iqtree_model_used | String | The iqtree model used during augur tree |
sage-wright marked this conversation as resolved.
Show resolved Hide resolved
sage-wright marked this conversation as resolved.
Show resolved Hide resolved
| keep_list | File | A list of samples included in the phylogenetic tree |
| metadata_merged | File | Tab-delimited text file of the merged augur_metadata input files from all samples |
| snp_matrix | File | The SNP distance matrix for all samples used in the phylogenetic tree |
Expand Down
16 changes: 16 additions & 0 deletions tasks/phylogenetic_inference/augur/task_augur_tree.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,26 @@ task augur_tree {
~{"--tree-builder-args " + tree_builder_args} \
~{true="--override-default-args" false="" override_default_args} \
--nthreads auto

# If iqtree, get the model used
if [ "~{method}" == "iqtree" ]; then
if [ "~{substitution_model}" == "auto" ]; then
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
echo "$MODEL" > FINAL_MODEL.txt
else
echo "" > FINAL_MODEL.txt
fi
>>>

output {
File aligned_tree = "~{build_name}_~{method}.nwk"
String augur_version = read_string("VERSION")
String iqtree_model_used = read_string("FINAL_MODEL.txt")
}
runtime {
docker: docker
Expand Down
1 change: 1 addition & 0 deletions workflows/phylogenetics/wf_augur.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ workflow augur {
File? auspice_input_json = augur_export.auspice_json
File? time_tree = augur_refine.refined_tree
File distance_tree = augur_tree.aligned_tree
String iqtree_model_used = augur_tree.iqtree_model_used
sage-wright marked this conversation as resolved.
Show resolved Hide resolved
File aligned_fastas = select_first([augur_align.aligned_fasta, alignment_fasta])
File combined_assemblies = filter_sequences_by_length.filtered_fasta
File? metadata_merged = tsv_join.out_tsv
Expand Down