Skip to content

Commit 02f660a

Browse files
authored
Merge pull request #297 from nextstrain/phylo-ancestral-root
phylogenetic: Add config option `ancestral_root_seq`
2 parents 4897f36 + 0bd64d3 commit 02f660a

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

phylogenetic/build-configs/ci/config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ custom_rules:
22
- build-configs/ci/copy_example_data.smk
33

44
reference: "defaults/reference.fasta"
5+
ancestral_root_seq: "defaults/reference.fasta"
56
genome_annotation: "defaults/genome_annotation.gff3"
67
genbank_reference: "defaults/reference.gb"
78
include: "defaults/hmpxv1/include.txt"

phylogenetic/rules/annotate_phylogeny.smk

+7-1
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,19 @@ rule ancestral:
3131
node_data=build_dir + "/{build_name}/nt_muts.json",
3232
params:
3333
inference="joint",
34+
root_sequence=lambda w: (
35+
f"--root-sequence {config['ancestral_root_seq']!r}"
36+
if config.get("ancestral_root_seq")
37+
else ""
38+
),
3439
shell:
3540
"""
3641
augur ancestral \
3742
--tree {input.tree} \
3843
--alignment {input.alignment} \
3944
--output-node-data {output.node_data} \
40-
--inference {params.inference}
45+
--inference {params.inference} \
46+
{params.root_sequence}
4147
"""
4248

4349

0 commit comments

Comments
 (0)