Skip to content

Commit

Permalink
phylogenetic: Add config option ancestral_root_seq
Browse files Browse the repository at this point in the history
Allow users to define an optional `--root-sequence` for
`augur ancestral`.

This commit only adds the new config option to the CI config.
It is not used in the default Nextstrain builds because it's not clear
whether it's needed.
  • Loading branch information
joverlee521 committed Nov 26, 2024
1 parent 4897f36 commit 0bd64d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions phylogenetic/build-configs/ci/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ custom_rules:
- build-configs/ci/copy_example_data.smk

reference: "defaults/reference.fasta"
ancestral_root_seq: "defaults/reference.fasta"
genome_annotation: "defaults/genome_annotation.gff3"
genbank_reference: "defaults/reference.gb"
include: "defaults/hmpxv1/include.txt"
Expand Down
8 changes: 7 additions & 1 deletion phylogenetic/rules/annotate_phylogeny.smk
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,19 @@ rule ancestral:
node_data=build_dir + "/{build_name}/nt_muts.json",
params:
inference="joint",
root_sequence=lambda w: (
f"--root-sequence {config['ancestral_root_seq']!r}"
if config.get("ancestral_root_seq")
else ""
),
shell:
"""
augur ancestral \
--tree {input.tree} \
--alignment {input.alignment} \
--output-node-data {output.node_data} \
--inference {params.inference}
--inference {params.inference} \
{params.root_sequence}
"""


Expand Down

0 comments on commit 0bd64d3

Please sign in to comment.