Skip to content

Commit

Permalink
nextclade: enable clade proposals
Browse files Browse the repository at this point in the history
  • Loading branch information
rneher committed Oct 27, 2024
1 parent c5ae153 commit b09a501
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 10 deletions.
13 changes: 12 additions & 1 deletion nextclade/config/auspice_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@
"title": "Country",
"type": "categorical"
},
{
"key": "subclade",
"title": "Subclade",
"type": "categorical"
},
{
"key": "proposed_clade",
"title": "Subclade proposals",
"type": "categorical"
},
{
"key": "region",
"title": "Region",
Expand All @@ -38,7 +48,8 @@
"filters": [
"region",
"country",
"clade_membership"
"clade_membership",
"subclade"
],
"display_defaults": {
"color_by": "clade_membership",
Expand Down
29 changes: 22 additions & 7 deletions nextclade/config/config_dict.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ builds:
subclade:
url: "seasonal_A-H1N1pdm_HA/main/.auto-generated/subclades.tsv"
key: "subclade"
proposed_clade:
url: "seasonal_A-H1N1pdm_HA/main/.auto-generated/subclade_proposals.tsv"
key: "proposed_clade"
refs:
CY121680: # exclude South Korean genomes because of sequencing artifacts close to the start of HA
filter: "--min-date 2009 --probabilistic-sampling --exclude-where country='south_korea' qc.overallStatus='bad' --group-by year --min-length 1500 --subsample-max-sequences 1500"
Expand All @@ -24,19 +27,22 @@ builds:
MW626062:
filter: "--min-date 2019 --probabilistic-sampling --exclude-where country='south_korea' qc.overallStatus='bad' --group-by year --min-length 1500 --subsample-max-sequences 1500"
clade_offset: 0
hardmin_date: 2015
hardmin_date: 2009
reference_EPI_ISL: EPI1812046
reference_strain: A/Wisconsin/588/2019
na:
changelog: "seasonal_A-H1N1pdm_NA/main/CHANGELOG.md"
clade_systems:
clade:
url: "seasonal_A-H1N1pdm_NA/main/.auto-generated/subclades.tsv"
proposed_clade:
url: "seasonal_A-H1N1pdm_NA/main/.auto-generated/subclade_proposals.tsv"
key: "proposed_clade"
refs:
MW626056:
filter: "--min-date 2019 --probabilistic-sampling --group-by year region --min-length 1400 --subsample-max-sequences 2000"
clade_offset: 0
hardmin_date: 2015
hardmin_date: 2009
reference_EPI_ISL: EPI1812046
reference_strain: A/Wisconsin/588/2019
h3n2:
Expand All @@ -51,14 +57,14 @@ builds:
short-clade:
url: "seasonal_A-H3N2_HA/main/.auto-generated/clades.tsv"
key: "short-clade"
emerging_subclade:
url: "seasonal_A-H3N2_HA/emerging/.auto-generated/subclades.tsv"
key: "emerging_subclade"
proposed_clade:
url: "seasonal_A-H3N2_HA/main/.auto-generated/subclade_proposals.tsv"
key: "proposed_clade"
refs:
EPI1857216:
filter: "--min-date 2019 --probabilistic-sampling --group-by year region --min-length 1500 --subsample-max-sequences 2000"
clade_offset: -17
hardmin_date: 2015
hardmin_date: 2004
reference_EPI_ISL: EPI1857216
reference_strain: A/Darwin/6/2021
CY163680:
Expand All @@ -72,11 +78,14 @@ builds:
clade_systems:
clade:
url: "seasonal_A-H3N2_NA/main/.auto-generated/subclades.tsv"
proposed_clade:
url: "seasonal_A-H3N2_NA/main/.auto-generated/subclade_proposals.tsv"
key: "proposed_clade"
refs:
EPI1857215:
filter: "--min-date 2019 --probabilistic-sampling --group-by year region --min-length 1400 --subsample-max-sequences 1500"
clade_offset: 4
hardmin_date: 2015
hardmin_date: 2004
reference_EPI_ISL: EPI1857215
reference_strain: A/Darwin/6/2021
vic:
Expand All @@ -88,6 +97,9 @@ builds:
subclade:
url: "seasonal_B-Vic_HA/main/.auto-generated/subclades.tsv"
key: "subclade"
proposed_clade:
url: "seasonal_B-Vic_HA/main/.auto-generated/subclade_proposals.tsv"
key: "proposed_clade"
refs:
KX058884:
filter: "--min-date 2014 --probabilistic-sampling --group-by year --min-length 1500 --subsample-max-sequences 2000"
Expand All @@ -100,6 +112,9 @@ builds:
clade_systems:
clade:
url: "seasonal_B-Vic_NA/main/.auto-generated/subclades.tsv"
proposed_clade:
url: "seasonal_B-Vic_NA/main/.auto-generated/subclade_proposals.tsv"
key: "proposed_clade"
refs:
CY073894:
filter: "--min-date 2014 --probabilistic-sampling --group-by year region --min-length 1400 --subsample-max-sequences 2000"
Expand Down
7 changes: 7 additions & 0 deletions nextclade/dataset_config/h1n1pdm/includes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
A/Bangladesh/3002/2015
A/Lao/1632/2023
A/NorthCarolina/6/2023
A/Victoria/114/2023
Expand Down Expand Up @@ -52,3 +53,9 @@ A/Ghana/FS-11-206/2011
A/Ghana/ARI1181/2011
A/BurkinaFaso/26/2012
A/Yopougon/GR276/2012
A/Perth/103/2015
A/Fiji/3/2016
A/Helsinki/2430/2012
A/Gansu-Ganzhou/SWL34/2012
A/Brisbane/96/2012
A/Minnesota/23/2014
10 changes: 10 additions & 0 deletions nextclade/dataset_config/h3n2/includes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,13 @@ A/Macau/9901287/2023
A/California/70/2023
A/Norway/9164/2023
A/Bahrain/1899/2023

A/Texas/50/2012
A/Hawaii/22/2012
A/Southauckland/7/2012
A/Victoria/361/2011
A/Brisbane/297/2014
A/Austria/93/2014
A/Southaustralia/2/2013
A/SouthAfrica/R06488/2017
A/Bangladesh/3039/2017
15 changes: 13 additions & 2 deletions nextclade/scripts/merge_jsons.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json, argparse
import json
import argparse

def get_clade_configs(name):
return {
Expand All @@ -16,7 +17,14 @@ def get_clade_configs(name):
"name": "subclade",
"displayName": "Subclade",
"description": "Experimental fine-grained subclade annotation."
}}.get(name, {'name':name, "displayName":name, "description":""})
},
"proposed_clade": {
"name": "Subclade proposal",
"displayName": "Subclade proposal",
"description": "Includes proposals of new subclades. These can change anytime.",
"hideInWeb": True
}
}.get(name, {'name':name, "displayName":name, "description":""})


if __name__=="__main__":
Expand Down Expand Up @@ -56,6 +64,9 @@ def get_clade_configs(name):
auspice_json['extensions']['nextclade']["clade_node_attrs"] = [
get_clade_configs(c) for c in args.clades if c!='default'
]
if 'subclade' in args.clades:
auspice_json['display_defaults']['color_by'] = 'subclade'
auspice_json['display_defaults']['branch_label'] = 'subclade'

with open(args.output_pathogen, 'w') as fh:
json.dump(pathogen_json, fh, indent=2)
Expand Down

0 comments on commit b09a501

Please sign in to comment.