Skip to content

Commit

Permalink
Build colors.tsv dynamically during phylo build {#2}
Browse files Browse the repository at this point in the history
  • Loading branch information
genehack committed Nov 21, 2024
1 parent 2ac2f54 commit 59999fb
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion phylogenetic/rules/export.smk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@ This part of the workflow collects the phylogenetic tree and annotations to
export a Nextstrain dataset.
"""


rule colors:
input:
color_schemes = "defaults/color_schemes.tsv",
color_orderings = "defaults/color_orderings.tsv",
metadata = "data/metadata.tsv",
output:
colors = "data/colors.tsv"
shell:
r"""
python3 scripts/assign-colors.py \
--color-schemes {input.color_schemes} \
--ordering {input.color_orderings} \
--metadata {input.metadata} \
--output {output.colors}
"""

rule export:
"""Exporting data files for for auspice"""
input:
Expand All @@ -12,7 +29,7 @@ rule export:
nt_muts = "results/{gene}/nt_muts.json",
aa_muts = "results/{gene}/aa_muts.json",
traits = "results/{gene}/traits.json",
colors = config["files"]["colors"],
colors = "data/colors.tsv",
auspice_config = lambda w: config["files"][w.gene]["auspice_config"],
description=config["files"]["description"],
output:
Expand Down

0 comments on commit 59999fb

Please sign in to comment.