diff --git a/phylogenetic/Snakefile b/phylogenetic/Snakefile index cc50cda8..a2ced232 100644 --- a/phylogenetic/Snakefile +++ b/phylogenetic/Snakefile @@ -7,16 +7,6 @@ rule all: input: auspice_json = expand("auspice/dengue_{serotype}.json", serotype=serotypes) -def clade_defs(w): - defs = { - 'all': 'config/clades_serotypes.tsv', - 'denv1': 'config/clades_genotypes.tsv', - 'denv2': 'config/clades_genotypes.tsv', - 'denv3': 'config/clades_genotypes.tsv', - 'denv4': 'config/clades_genotypes.tsv' - } - return defs[w.serotype] - include: "rules/prepare_sequences.smk" include: "rules/construct_phylogeny.smk" include: "rules/annotate_phylogeny.smk" diff --git a/phylogenetic/config/config_dengue.yaml b/phylogenetic/config/config_dengue.yaml index cf7b4771..b9588622 100644 --- a/phylogenetic/config/config_dengue.yaml +++ b/phylogenetic/config/config_dengue.yaml @@ -20,3 +20,11 @@ traits: denv2: 'country region' denv3: 'country region' denv4: 'country region' + +clades: + clade_definitions: + all: 'config/clades_serotypes.tsv' + denv1: 'config/clades_genotypes.tsv' + denv2: 'config/clades_genotypes.tsv' + denv3: 'config/clades_genotypes.tsv' + denv4: 'config/clades_genotypes.tsv' diff --git a/phylogenetic/rules/annotate_phylogeny.smk b/phylogenetic/rules/annotate_phylogeny.smk index f89cc339..b5280ede 100644 --- a/phylogenetic/rules/annotate_phylogeny.smk +++ b/phylogenetic/rules/annotate_phylogeny.smk @@ -88,7 +88,7 @@ rule clades: tree = "results/tree_{serotype}.nwk", nt_muts = "results/nt-muts_{serotype}.json", aa_muts = "results/aa-muts_{serotype}.json", - clade_defs = clade_defs, + clade_defs = lambda wildcards: config['clades']['clade_definitions'][wildcards.serotype], output: clades = "results/clades_{serotype}.json" shell: