Skip to content

Commit b06a43d

Browse files
authored
phylogenetic: Add config option to specify ancestral root sequence (#46)
Copied and modified from nextstrain/mpox@0bd64d3 Allow users to define an optional `--root-sequence` for `augur ancestral` Adds in resolve_config path for nextstrain run support
1 parent f1b6ad1 commit b06a43d

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

phylogenetic/defaults/config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ refine:
2525

2626
ancestral:
2727
inference: "joint"
28+
root_sequence: "reference.gb"
2829

2930
traits:
3031
north-america: country division MuV_genotype MuV_genotype_nextclade_sh MuV_genotype_nextclade_genome

phylogenetic/rules/annotate_phylogeny.smk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ rule ancestral:
4545
"benchmarks/{build}/ancestral.txt",
4646
params:
4747
inference = config["ancestral"]["inference"],
48+
root_sequence=lambda w: (
49+
("--root-sequence " + resolve_config_path(config["ancestral"]["root_sequence"])(w))
50+
if config["ancestral"].get("root_sequence")
51+
else ""
52+
),
4853
shell:
4954
r"""
5055
exec &> >(tee {log:q})
@@ -53,6 +58,7 @@ rule ancestral:
5358
--tree {input.tree:q} \
5459
--alignment {input.alignment:q} \
5560
--output-node-data {output.node_data:q} \
61+
{params.root_sequence} \
5662
--inference {params.inference:q}
5763
"""
5864

0 commit comments

Comments
 (0)