Skip to content

Commit

Permalink
Move frequencies rule to export.smk
Browse files Browse the repository at this point in the history
  • Loading branch information
trvrb committed Jun 28, 2024
1 parent f20d4a1 commit 3818fab
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 32 deletions.
29 changes: 0 additions & 29 deletions phylogenetic/rules/annotate_phylogeny.smk
Original file line number Diff line number Diff line change
Expand Up @@ -39,32 +39,3 @@ rule translate:
--reference-sequence {input.reference} \
--output {output.node_data} \
"""

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 = "results/{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}
"""
25 changes: 22 additions & 3 deletions phylogenetic/rules/export.smk
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,31 @@ rule export:
--output {output.auspice_json}
"""

rule final_tip_frequencies:
rule tip_frequencies:
"""
Estimating KDE frequencies for tips
"""
input:
tip_freq = "results/{gene}/tip-frequencies.json",
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:
"""
cp -f {input.tip_freq} {output.tip_freq}
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}
"""

0 comments on commit 3818fab

Please sign in to comment.