Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include frequencies for N450 build #42

Merged
merged 2 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions phylogenetic/Snakefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
genes = ['N450', 'genome']

configfile: "defaults/config.yaml"
configfile: "defaults/config.yaml"

rule all:
input:
auspice_json = expand("auspice/measles_{gene}.json", gene=genes)
auspice_json = expand("auspice/measles_{gene}.json", gene=genes),
tip_frequencies_json = expand("auspice/measles_{gene}_tip-frequencies.json", gene=genes)

include: "rules/prepare_sequences.smk"
include: "rules/prepare_sequences_N450.smk"
Expand Down
6 changes: 6 additions & 0 deletions phylogenetic/defaults/auspice_config_N450.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@
"country",
"author"
],
"panels": [
"tree",
"map",
"entropy",
"frequencies"
],
"metadata_columns": [
"author"
]
Expand Down
5 changes: 5 additions & 0 deletions phylogenetic/defaults/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,10 @@ refine:
clock_filter_iqd: 4
ancestral:
inference: "joint"
tip_frequencies:
min_date: "2000-01-01"
max_date: "6M"
narrow_bandwidth: 0.2
wide_bandwidth: 0.6
export:
metadata_columns: "strain division location"
29 changes: 29 additions & 0 deletions phylogenetic/rules/export.smk
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,32 @@ rule export:
--include-root-sequence-inline \
--output {output.auspice_json}
"""

rule tip_frequencies:
"""
Estimating KDE frequencies for tips
"""
input:
tree = "results/{gene}/tree.nwk",
metadata = "data/metadata.tsv"
params:
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"],
wide_bandwidth = config["tip_frequencies"]["wide_bandwidth"]
output:
tip_freq = "auspice/measles_{gene}_tip-frequencies.json"
shell:
"""
augur frequencies \
--method kde \
--tree {input.tree} \
--metadata {input.metadata} \
--metadata-id-columns {params.strain_id} \
--min-date {params.min_date} \
--max-date {params.max_date} \
--narrow-bandwidth {params.narrow_bandwidth} \
--wide-bandwidth {params.wide_bandwidth} \
--output {output.tip_freq}
"""