Skip to content

Commit

Permalink
Move paths to clade definition files to configfile
Browse files Browse the repository at this point in the history
  • Loading branch information
j23414 committed Jan 8, 2024
1 parent 1a87f89 commit a3232c1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
10 changes: 0 additions & 10 deletions phylogenetic/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 8 additions & 0 deletions phylogenetic/config/config_dengue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 1 addition & 1 deletion phylogenetic/rules/annotate_phylogeny.smk
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit a3232c1

Please sign in to comment.