Skip to content

Commit

Permalink
Merge pull request #20 from nextstrain/assign-Troupin-clades
Browse files Browse the repository at this point in the history
Assign clades using Troupin et al definitions
  • Loading branch information
kimandrews authored Jan 13, 2025
2 parents 01f492a + 9133653 commit 219e638
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 1 deletion.
5 changes: 5 additions & 0 deletions phylogenetic/defaults/auspice_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
"key": "host_common_name",
"title": "Host common name",
"type": "categorical"
},
{
"key": "clade_membership",
"title": "Clade",
"type": "categorical"
}
],
"geo_resolutions": [
Expand Down
51 changes: 51 additions & 0 deletions phylogenetic/defaults/clades.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
clade gene site alt
Africa-2 nuc 499 G
Africa-2 nuc 708 A
Africa-2 nuc 3746 G
Africa-2 nuc 3914 A
Africa-2 nuc 4440 C
Africa-2 nuc 4628 G
Africa-2 nuc 4844 A
Africa-3 nuc 332 A
Africa-3 nuc 392 A
Africa-3 nuc 821 T
Africa-3 nuc 1209 T
Africa-3 nuc 1258 G
Africa-3 nuc 4473 T
Africa-3 nuc 4940 A
Arctic-related nuc 248 T
Arctic-related nuc 1030 G
Arctic-related nuc 1036 A
Arctic-related nuc 3363 A
Arctic-related nuc 3494 T
Arctic-related nuc 3657 C
Arctic-related nuc 4775 C
Asian nuc 1471 A
Asian nuc 8234 C
Asian nuc 8837 G
Asian nuc 9038 G
Asian nuc 9113 G
Asian nuc 9773 T
Asian nuc 9965 T
Asian nuc 10773 A
Bat nuc 331 T
Bat nuc 413 A
Bat nuc 1879 C
Bat nuc 2449 C
Bat nuc 2594 A
Bat nuc 2955 G
Bat nuc 5083 T
Bat nuc 11189 T
Cosmopolitan nuc 781 A
Cosmopolitan nuc 1057 T
Cosmopolitan nuc 1470 A
Cosmopolitan nuc 3998 C
Cosmopolitan nuc 4697 A
Cosmopolitan nuc 4949 T
Indian Subcontinent nuc 1207 T
Indian Subcontinent nuc 3548 C
Indian Subcontinent nuc 5054 G
RAC-SK nuc 574 T
RAC-SK nuc 844 T
RAC-SK nuc 1207 C
RAC-SK nuc 3924 G
1 change: 1 addition & 0 deletions phylogenetic/defaults/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ files:
colors: "defaults/colors.tsv"
auspice_config: "defaults/auspice_config.json"
description: "defaults/description.md"
clades: "defaults/clades.tsv"
filter:
group_by: "country year"
sequences_per_group: 20
Expand Down
4 changes: 4 additions & 0 deletions phylogenetic/defaults/description.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ We curate sequence data and metadata from NCBI as starting point for our analyse
- [data.nextstrain.org/files/workflows/rabies/sequences.fasta.zst](https://data.nextstrain.org/files/workflows/rabies/sequences.fasta.zst)
- [data.nextstrain.org/files/workflows/rabies/metadata.tsv.zst](https://data.nextstrain.org/files/workflows/rabies/metadata.tsv.zst)

#### Clade annotation

Clades are defined based on the "major clades" in [Troupin et al. 2016](https://journals.plos.org/plospathogens/article?id=10.1371/journal.ppat.1006041).

---

Screenshots may be used under a [CC-BY-4.0 license](https://creativecommons.org/licenses/by/4.0/) and attribution to nextstrain.org must be provided.
17 changes: 17 additions & 0 deletions phylogenetic/rules/annotate_phylogeny.smk
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,23 @@ rule translate:
2>&1 | tee {log}
"""

rule clades:
input:
tree = "results/tree.nwk",
nt_muts = "results/nt_muts.json",
aa_muts = "results/aa_muts.json",
clade_defs = config["files"]["clades"]
output:
clades = "results/clades.json"
shell:
"""
augur clades \
--tree {input.tree} \
--mutations {input.nt_muts} {input.aa_muts} \
--clades {input.clade_defs} \
--output {output.clades}
"""

rule add_year_metadata:
input:
metadata = "data/metadata.tsv",
Expand Down
3 changes: 2 additions & 1 deletion phylogenetic/rules/export.smk
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ rule export:
branch_lengths = "results/branch_lengths.json",
nt_muts = "results/nt_muts.json",
aa_muts = "results/aa_muts.json",
clades = "results/clades.json",
year = "results/year.json",
colors = config["files"]["colors"],
auspice_config = config["files"]["auspice_config"],
Expand All @@ -31,7 +32,7 @@ rule export:
--tree {input.tree} \
--metadata {input.metadata} \
--metadata-id-columns {params.strain_id} \
--node-data {input.branch_lengths} {input.nt_muts} {input.aa_muts} {input.year} \
--node-data {input.branch_lengths} {input.nt_muts} {input.aa_muts} {input.year} {input.clades} \
--colors {input.colors} \
--auspice-config {input.auspice_config} \
--include-root-sequence-inline \
Expand Down

0 comments on commit 219e638

Please sign in to comment.