Skip to content

Commit

Permalink
Drop set_final_strain_name.py
Browse files Browse the repository at this point in the history
Remove set_final_strain_name.py so that both the main JSON and the
frequencies JSON use the accession as the strain id. This simplifies the
augur frequencies call and the "accession" vs "strain" confusion.
  • Loading branch information
j23414 committed Dec 31, 2024
1 parent b708936 commit 34bad54
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 60 deletions.
27 changes: 5 additions & 22 deletions phylogenetic/rules/export.smk
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ rule prepare_auspice_config:
],
"display_defaults": {
"map_triplicate": True,
"color_by": params.replace_clade_key
"color_by": params.replace_clade_key,
"tip_label": "strain"
},
"filters": [
"country",
Expand All @@ -110,6 +111,7 @@ rule prepare_auspice_config:
],
"metadata_columns": [
"accession",
"strain",
"url"
]
}
Expand Down Expand Up @@ -150,7 +152,7 @@ rule export:
auspice_config = "results/defaults/{gene}/auspice_config_{serotype}.json",
colors = "results/colors_{serotype}.tsv",
output:
auspice_json = "results/{gene}/raw_dengue_{serotype}.json"
auspice_json = "results/{gene}/dengue_{serotype}.json"
params:
strain_id = config.get("strain_id_field", "strain"),
shell:
Expand All @@ -167,25 +169,6 @@ rule export:
--output {output.auspice_json}
"""

rule final_strain_name:
input:
auspice_json="results/{gene}/raw_dengue_{serotype}.json",
metadata="data/metadata_{serotype}.tsv",
output:
auspice_json="auspice/dengue_{serotype}_{gene}.json"
params:
strain_id=config.get("strain_id_field", "strain"),
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}
"""

rule tip_frequencies:
"""
Estimating KDE frequencies for tips
Expand All @@ -196,7 +179,7 @@ rule tip_frequencies:
output:
tip_freq = "auspice/dengue_{serotype}_{gene}_tip-frequencies.json"
params:
strain_id = config["display_strain_field"],
strain_id = config["strain_id_field"],
min_date = config["tip_frequencies"]["min_date"],
max_date = config["tip_frequencies"]["max_date"],
narrow_bandwidth = config["tip_frequencies"]["narrow_bandwidth"],
Expand Down
38 changes: 0 additions & 38 deletions phylogenetic/scripts/set_final_strain_name.py

This file was deleted.

0 comments on commit 34bad54

Please sign in to comment.