-
Notifications
You must be signed in to change notification settings - Fork 1
/
chewbbaca.smk
74 lines (50 loc) · 1.17 KB
/
chewbbaca.smk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
from pathlib import Path
rule all:
input:
expand('cgmlst_{presence}/cgMLST.tsv', presence=(0.95, 0.999, 1.00))
rule define_wgmlst:
input:
list(Path('genomes').glob('*.fasta'))
output:
directory('wgmlst_schema')
params:
training_file=config['training']
threads:
32
conda:
'envs/chewbbaca.yaml'
shell:
'chewie CreateSchema -i genomes/ -o {output} '
'--cpu {threads} --ptf {params.training_file}'
rule allele_call:
input:
rules.define_wgmlst.output
output:
directory('allele_call')
params:
training_file=config['training']
threads:
32
conda:
'envs/chewbbaca.yaml'
shell:
'chewie AlleleCall -i genomes/ -g {input} -o {output} '
'--cpu {threads} --ptf {params.training_file}'
rule evaluate_schema:
input:
Path(rules.allele_call.output) / 'results_Alleles.txt'
output:
directory('allele_call_evaluation')
conda:
'envs/chewbbaca.yaml'
shell:
'chewie TestGenomeQuality -i {input} -o {output} -n 24 -t 500 -s 5'
rule extract_cgmlst:
input:
'allele_call_{date}/results_alleles.tsv'
output:
'cgmlst_{presence}/cgMLST.tsv'
conda:
'envs/chewbbaca.yaml'
shell:
'chewie -i {input} -o cgmlst_{presence} -p {presence}'