Skip to content

Commit

Permalink
Use accession for node name but display strain
Browse files Browse the repository at this point in the history
This is a companion commit to changes in Auspice <nextstrain/auspice#1668>
which allow any node-attr to be used as the tip label and which displays
this tip label in the node hover/click boxes as well as alongside nodes
(at suitable zoom levels). This allows us to drop the `set_final_strain_name`
script and ensures all node names are unique which improves the behaviour
of Auspice

This commit only changes the Nextstrain datasets, not the Nextclade ones
  • Loading branch information
jameshadfield committed Aug 26, 2024
1 parent cf9d072 commit 4a268ba
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 62 deletions.
4 changes: 4 additions & 0 deletions phylogenetic/defaults/clade-i/auspice_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,12 @@
"geo_resolutions": [
"country"
],
"metadata_columns": [
"strain"
],
"display_defaults": {
"color_by": "country",
"tip_label": "strain",
"map_triplicate": true,
"distance_measure": "num_date",
"transmission_lines": false
Expand Down
4 changes: 4 additions & 0 deletions phylogenetic/defaults/hmpxv1/auspice_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@
"geo_resolutions": [
"country"
],
"metadata_columns": [
"strain"
],
"display_defaults": {
"color_by": "lineage",
"tip_label": "strain",
"map_triplicate": true,
"distance_measure": "num_date",
"transmission_lines": false
Expand Down
4 changes: 4 additions & 0 deletions phylogenetic/defaults/hmpxv1_big/auspice_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,12 @@
"geo_resolutions": [
"country"
],
"metadata_columns": [
"strain"
],
"display_defaults": {
"color_by": "lineage",
"tip_label": "strain",
"map_triplicate": true,
"distance_measure": "num_date",
"transmission_lines": false
Expand Down
4 changes: 4 additions & 0 deletions phylogenetic/defaults/mpxv/auspice_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,12 @@
"geo_resolutions": [
"country"
],
"metadata_columns": [
"strain"
],
"display_defaults": {
"color_by": "clade_membership",
"tip_label": "strain",
"map_triplicate": true,
"distance_measure": "div",
"transmission_lines": false
Expand Down
26 changes: 2 additions & 24 deletions phylogenetic/rules/export.smk
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ rule export:
description=config["description"],
auspice_config=config["auspice_config"],
output:
auspice_json=build_dir + "/{build_name}/raw_tree.json",
root_sequence=build_dir + "/{build_name}/raw_tree_root-sequence.json",
auspice_json=build_dir + "/{build_name}/tree.json",
root_sequence=build_dir + "/{build_name}/tree_root-sequence.json",
params:
strain_id=config["strain_id_field"],
shell:
Expand All @@ -107,25 +107,3 @@ rule export:
--include-root-sequence \
--output {output.auspice_json}
"""


rule final_strain_name:
input:
auspice_json=build_dir + "/{build_name}/raw_tree.json",
metadata=build_dir + "/{build_name}/metadata.tsv",
root_sequence=build_dir + "/{build_name}/raw_tree_root-sequence.json",
output:
auspice_json=build_dir + "/{build_name}/tree.json",
root_sequence=build_dir + "/{build_name}/tree_root-sequence.json",
params:
strain_id=config["strain_id_field"],
display_strain_field=config.get("display_strain_field", "strain"),
shell:
"""
python3 scripts/set_final_strain_name.py --metadata {input.metadata} \
--metadata-id-columns {params.strain_id} \
--input-auspice-json {input.auspice_json} \
--display-strain-name {params.display_strain_field} \
--output {output.auspice_json}
cp {input.root_sequence} {output.root_sequence}
"""
38 changes: 0 additions & 38 deletions phylogenetic/scripts/set_final_strain_name.py

This file was deleted.

0 comments on commit 4a268ba

Please sign in to comment.