Skip to content

Commit

Permalink
working H7Nx,HxN6 builds
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshadfield committed Dec 4, 2024
1 parent 4525438 commit 04f527d
Show file tree
Hide file tree
Showing 11 changed files with 272 additions and 39 deletions.
3 changes: 2 additions & 1 deletion Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ rule refine:
params:
coalescent = config['refine']['coalescent'],
date_inference = config['refine']['date_inference'],
timetree = lambda w: "--timetree" if resolve_config_value(['refine', 'timetree'], w) else "",
clock_rates = refine_clock_rates,
clock_filter = refine_clock_filter,
root = lambda w: f"--root {resolve_config_value(['refine', 'root'], w)}" if resolve_config_value(['refine', 'root'], w) else ''
Expand All @@ -593,7 +594,7 @@ rule refine:
--metadata {input.metadata} \
--output-tree {output.tree} \
--output-node-data {output.node_data} \
--timetree \
{params.timetree} \
{params.root} \
--coalescent {params.coalescent} \
--date-confidence \
Expand Down
42 changes: 4 additions & 38 deletions config/h7n6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,57 +5,23 @@ inputs:

builds:
- subtype: h7n6
segment:
- pb2
- pb1
- pa
- ha
- np
- na
- mp
- ns
segment: ['pb2', 'pb1', 'pa', 'ha', 'np', 'na', 'mp', 'ns']
time: all-time

subtype_lookup:
h7n6: ['h7n6']



#### Config files ####
reference: config/{subtype}/reference_{subtype}_{segment}.gb
auspice_config: config/{subtype}/auspice_config_{subtype}.json
colors: config/{subtype}/colors_{subtype}.tsv
lat_longs: config/{subtype}/lat_longs_{subtype}.tsv
include_strains: config/{subtype}/include_strains_{subtype}_{time}.txt
dropped_strains: config/{subtype}/dropped_strains_{subtype}.txt
description: config/description_gisaid.md


filter:
target_sequences_per_tree:
"*/*/*": 3000

min_length:
"*/pb2/*": 2100
"*/pb1/*": 2100
"*/pa/*": 2000
"*/ha/*": 1600
"*/np/*": 1400
"*/na/*": 1270
"*/mp/*": 900
"*/ns/*": 800

min_date:
"h7n6/*/all-time": 1900
group_by:
"h7n6/*/*": subtype
exclude_where:
host=laboratoryderived # can't use an empty string...

ancestral:
inference: joint
root_seq: false

refine:
clock_filter_iqd:
"h7n6/*/*": ""
traits:
columns:
"h7n6/*/*": region
97 changes: 97 additions & 0 deletions config/h7nx/auspice_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{
"title": "Real-time tracking of influenza A/H7Nx evolution",
"maintainers": [
{"name": "James Hadfield"},
{"name": "Nextstrain"}
],
"build_url": "https://github.com/nextstrain/avian-flu",
"data_provenance": [
{
"name": "GISAID"
}
],
"colorings": [
{
"key": "gt",
"title": "Genotype",
"type": "categorical"
},
{
"key": "num_date",
"title": "Date",
"type": "continuous"
},
{
"key": "date",
"title": "Date",
"type": "temporal"
},
{
"key": "pathogenicity",
"title": "Pathogenicity",
"type": "categorical"
},
{
"key": "subtype",
"title": "subtype",
"type": "categorical"
},
{
"key": "region",
"title": "Region",
"type": "categorical"
},
{
"key": "country",
"title": "Country",
"type": "categorical"
},
{
"key": "division",
"title": "Admin Division",
"type": "categorical"
},
{
"key": "host",
"title": "Host",
"type": "categorical"
},
{
"key": "furin_cleavage_motif",
"title": "Furin Cleavage Motif",
"type": "categorical"
},
{
"key": "cleavage_site_sequence",
"title": "Cleavage Site Sequence",
"type": "categorical"
},
{
"key": "originating_lab",
"title": "Originating Lab",
"type": "categorical"
},
{
"key": "submitting_lab",
"title": "Submitting Lab",
"type": "categorical"
}
],
"geo_resolutions": [
"region",
"country",
"division"
],
"display_defaults": {
"map_triplicate": true,
"color_by": "pathogenicity",
"geo_resolution": "region"
},
"filters": [
"host",
"country",
"division",
"originating_lab",
"submitting_lab"
]
}
2 changes: 2 additions & 0 deletions config/h7nx/dropped_strains.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
A/duck/Chiba/13/200

Empty file added config/h7nx/include_strains.txt
Empty file.
97 changes: 97 additions & 0 deletions config/hxn6/auspice_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{
"title": "Real-time tracking of influenza A/HxN6 evolution",
"maintainers": [
{"name": "James Hadfield"},
{"name": "Nextstrain"}
],
"build_url": "https://github.com/nextstrain/avian-flu",
"data_provenance": [
{
"name": "GISAID"
}
],
"colorings": [
{
"key": "gt",
"title": "Genotype",
"type": "categorical"
},
{
"key": "num_date",
"title": "Date",
"type": "continuous"
},
{
"key": "date",
"title": "Date",
"type": "temporal"
},
{
"key": "pathogenicity",
"title": "Pathogenicity",
"type": "categorical"
},
{
"key": "subtype",
"title": "subtype",
"type": "categorical"
},
{
"key": "region",
"title": "Region",
"type": "categorical"
},
{
"key": "country",
"title": "Country",
"type": "categorical"
},
{
"key": "division",
"title": "Admin Division",
"type": "categorical"
},
{
"key": "host",
"title": "Host",
"type": "categorical"
},
{
"key": "furin_cleavage_motif",
"title": "Furin Cleavage Motif",
"type": "categorical"
},
{
"key": "cleavage_site_sequence",
"title": "Cleavage Site Sequence",
"type": "categorical"
},
{
"key": "originating_lab",
"title": "Originating Lab",
"type": "categorical"
},
{
"key": "submitting_lab",
"title": "Submitting Lab",
"type": "categorical"
}
],
"geo_resolutions": [
"region",
"country",
"division"
],
"display_defaults": {
"map_triplicate": true,
"color_by": "pathogenicity",
"geo_resolution": "region"
},
"filters": [
"host",
"country",
"division",
"originating_lab",
"submitting_lab"
]
}
Empty file added config/hxn6/dropped_strains.txt
Empty file.
Empty file added config/hxn6/include_strains.txt
Empty file.
64 changes: 64 additions & 0 deletions config/hxn6_h7nx.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
inputs:
- name: gisaid
metadata: ingest/fauna/results/metadata.tsv
sequences: ingest/fauna/results/sequences_{segment}.fasta

builds:
- subtype:
- h7nx
- hxn6
segment:
# - pb2
# - pb1
# - pa
# - ha
# - np
# - na
# - mp
- ns
time: all-time

## HACK! FIXME XXX
auspice_config: config/{subtype}/auspice_config.json
reference: config/h7n9/reference_h7n9_{segment}.gb
colors: config/h7n6/colors_h7n6.tsv
lat_longs: config/h7n9/lat_longs_h7n9.tsv
include_strains: config/{subtype}/include_strains.txt
dropped_strains: config/{subtype}/dropped_strains.txt
clades_file: clade-labeling/{subtype}-clades.tsv # TODO XXX -- should drop this! But I think it's required. BUG.
description: config/description_gisaid.md

### TODO
# fix the clock?

subtype_lookup:
h7nx: ['h7n1', 'h7n2', 'h7n3', 'h7n4', 'h7n5', 'h7n6', 'h7n7', 'h7n8', 'h7n9', 'h7n10', 'h7n11']
hxn6: ['h1n6', 'h2n6', 'h3n6', 'h4n6', 'h5n6', 'h6n6', 'h7n6', 'h8n6', 'h9n6', 'h10n6', 'h11n6', 'h12n6', 'h13n6', 'h14n6', 'h15n6', 'h16n6', 'h17n6', 'h18n6']

filter:
target_sequences_per_tree: 10_000 # FIXME XXX - there's circa 7k sequences so we can build em all
min_date:
"h7nx/*/all-time": 1900
"hxn6/*/all-time": 1900
min_length:
"hxn6/ns/*": 600 # NZ sequence is short here...
"h7nx/ns/*": 600 # NZ sequence is short here...
group_by:
"h7nx/*/*": subtype
"hxn6/*/*": subtype
exclude_where:
host=laboratoryderived # can't use an empty string...

refine:
timetree:
"h7nx/*/*": false
"hxn6/*/*": false
root:
"h7nx/*/*": mid_point
"hxn6/*/*": mid_point
# clock_filter_iqd:
# "h7nx/*/*": ""
traits:
columns:
"h7nx/*/*": region
"hxn6/*/*": region
4 changes: 4 additions & 0 deletions config/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,11 @@ properties:
- clock_filter_iqd
- clock_rates
- root
- timetree
properties:
timetree:
title: Infer timetree?
<<: *wildcard_param_property
coalescent:
title: Coalescent time scale
description: >
Expand Down
2 changes: 2 additions & 0 deletions gisaid/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ filter:
host=laboratoryderived host=ferret host=unknown host=other host=host country=? region=? gisaid_clade=3C.2

refine:
timetree:
"*/*/*": true
coalescent: const
date_inference: marginal

Expand Down

0 comments on commit 04f527d

Please sign in to comment.