Skip to content

Commit

Permalink
ID strain by accession
Browse files Browse the repository at this point in the history
  • Loading branch information
j23414 committed Sep 13, 2023
1 parent 81a072a commit 65d73a7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
22 changes: 17 additions & 5 deletions Snakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
if not config:
configfile: "config/config_dengue.yaml"

serotypes = ['all', 'denv1', 'denv2', 'denv3', 'denv4']

rule all:
Expand Down Expand Up @@ -98,12 +101,14 @@ rule filter:
params:
group_by = "year region",
sequences_per_group = filter_sequences_per_group,
min_length = 5000
min_length = 5000,
strain_id = config.get("strain_id_field", "strain"),
shell:
"""
augur filter \
--sequences {input.sequences} \
--metadata {input.metadata} \
--metadata-id-columns {params.strain_id} \
--exclude {input.exclude} \
--output {output.sequences} \
--group-by {params.group_by} \
Expand Down Expand Up @@ -161,17 +166,19 @@ rule refine:
metadata = "results/metadata_{serotype}.tsv"
output:
tree = "results/tree_{serotype}.nwk",
node_data = "results/branch-lengths_{serotype}.json"
node_data = "results/branch-lengths_{serotype}.json",
params:
coalescent = "const",
date_inference = "marginal",
clock_filter_iqd = 4
clock_filter_iqd = 4,
strain_id = config.get("strain_id_field", "strain"),
shell:
"""
augur refine \
--tree {input.tree} \
--alignment {input.alignment} \
--metadata {input.metadata} \
--metadata-id-columns {params.strain_id} \
--output-tree {output.tree} \
--output-node-data {output.node_data} \
--timetree \
Expand Down Expand Up @@ -228,12 +235,14 @@ rule traits:
node_data = "results/traits_{serotype}.json",
params:
columns = traits_columns,
sampling_bias_correction = 3
sampling_bias_correction = 3,
strain_id = config.get("strain_id_field", "strain"),
shell:
"""
augur traits \
--tree {input.tree} \
--metadata {input.metadata} \
--metadata-id-columns {params.strain_id} \
--output {output.node_data} \
--columns {params.columns} \
--confidence \
Expand Down Expand Up @@ -270,12 +279,15 @@ rule export:
aa_muts = "results/aa-muts_{serotype}.json",
auspice_config = files.auspice_config
output:
auspice_json = "auspice/dengue_{serotype}.json"
auspice_json = "auspice/dengue_{serotype}.json",
params:
strain_id = config.get("strain_id_field", "strain"),
shell:
"""
augur export v2 \
--tree {input.tree} \
--metadata {input.metadata} \
--metadata-id-columns {params.strain_id} \
--node-data {input.branch_lengths} {input.traits} {input.clades} {input.nt_muts} {input.aa_muts} \
--auspice-config {input.auspice_config} \
--include-root-sequence \
Expand Down
2 changes: 2 additions & 0 deletions config/config_dengue.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
strain_id_field: "accession"
display_strain_field: "strain"

0 comments on commit 65d73a7

Please sign in to comment.