Skip to content
Merged
2 changes: 1 addition & 1 deletion phylogenetic/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ configfile: "defaults/config.yaml"

rule all:
input:
auspice_json = "auspice/measles.json",
auspice_json = expand("auspice/measles_{gene}.json", gene=genes)

include: "rules/prepare_sequences.smk"
include: "rules/prepare_sequences_N450.smk"
Expand Down
49 changes: 49 additions & 0 deletions phylogenetic/defaults/auspice_config_N450.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"title": "Real-time tracking of measles virus evolution",
"maintainers": [
{"name": "Kim Andrews", "url": "https://bedford.io/team/kim-andrews/"},
{"name": "the Nextstrain team", "url": "https://nextstrain.org/team"}
],
"build_url": "https://github.com/nextstrain/measles",
"colorings": [
{
"key": "gt",
"title": "Genotype",
"type": "categorical"
},
{
"key": "num_date",
"title": "Date",
"type": "continuous"
},
{
"key": "author",
Copy link
Member

@jameshadfield jameshadfield Mar 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Not blocking this PR]

We used to add "author" as a color-by as a workaround so that it appeared as a filtering option in Auspice, however a couple of recent changes have rendered this pattern unnecessary. We can now use "metadata_columns" in the auspice-config JSON (or --metadata-columns) to export "author" and Auspice will automatically add it as a filtering option. This is nicer than exposing author as a coloring.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 8bea320

"title": "Author",
"type": "categorical"
},
{
"key": "country",
"title": "Country",
"type": "categorical"
},
{
"key": "region",
"title": "Region",
"type": "categorical"
}
],
"geo_resolutions": [
"country",
"region"
],
"display_defaults": {
"map_triplicate": true,
"distance_measure": "div",
"layout": "unrooted"
},
"filters": [
"country",
"region",
"author"
]
}
1 change: 1 addition & 0 deletions phylogenetic/defaults/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ files:
reference_N450_fasta: "defaults/measles_reference_N450.fasta"
colors: "defaults/colors.tsv"
auspice_config: "defaults/auspice_config.json"
auspice_config_N450: "defaults/auspice_config_N450.json"
filter:
group_by: "country year month"
sequences_per_group: 20
Expand Down
14 changes: 8 additions & 6 deletions phylogenetic/rules/export.smk
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ See Augur's usage docs for these commands for more details.
rule export:
"""Exporting data files for for auspice"""
input:
tree = "results/tree.nwk",
tree = "results/tree_{gene}.nwk",
metadata = "data/metadata.tsv",
branch_lengths = "results/branch_lengths.json",
nt_muts = "results/nt_muts.json",
aa_muts = "results/aa_muts.json",
branch_lengths = "results/branch_lengths_{gene}.json",
nt_muts = "results/nt_muts_{gene}.json",
aa_muts = "results/aa_muts_{gene}.json",
colors = config["files"]["colors"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest removing all the "country" colours from the defaults/colors.tsv in this PR simply because a number of countries are missing colours. Auspice will pick a better set of colours than the current situation of some colours + some greys. We can then add nicer colours in a subsequent PR, as desired.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 119fbcf

auspice_config = config["files"]["auspice_config"]
auspice_config = lambda wildcard: "defaults/auspice_config.json" if wildcard.gene in ["genome"] else "defaults/auspice_config_N450.json"

output:
auspice_json = rules.all.input.auspice_json
auspice_json = "auspice/measles_{gene}.json",
root_sequence = "auspice/measles_{gene}_root-sequence.json"
params:
strain_id = config["strain_id_field"]
shell:
Expand Down