-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSnakefile
More file actions
101 lines (87 loc) · 2.59 KB
/
Snakefile
File metadata and controls
101 lines (87 loc) · 2.59 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
configfile: "config.json"
pref=config["inprefix"]
suff=config["insuffix"]
outpref = config["outpref"]
CONDITIONS = glob_wildcards(pref+"{sample}"+suff).sample
conda environment.yml
rule all:
input: outpref+"_primer_pair_results.txt"
default_target: True
checkpoint gunzip:
input: pref+"{sample}_R{fr}_001.fastq.gz"
output: "{sample}_R{fr}_001.fastq"
group:"group1"
conda:
"mpcr_testing"
shell: """
gunzip -c {input} > {output}
"""
checkpoint runclip:
input: "{sample}_R{fr}_001.fastq"
output: "{sample}_R{fr}_001_clip.fastq"
group:"group1"
conda:
"mpcr_testing"
shell:"""
python scripts/polyAclip.py {input} {output}
"""
checkpoint runfastp:
input:
in1="{sample}_R1_001_clip.fastq",
in2="{sample}_R2_001_clip.fastq"
output:
out1="{sample}_R1_001_clip_fastp.fastq",
out2="{sample}_R2_001_clip_fastp.fastq",
group:"group2"
conda:
"mpcr_testing"
shell:"""
fastp -c -i {input.in1} -o {output.out1} -I {input.in2} -O {output.out2}
rm fastp.html
rm fastp.json
"""
checkpoint runflash:
input:
in1="{sample}_R1_001_clip_fastp.fastq",
in2="{sample}_R2_001_clip_fastp.fastq"
output:
output="{sample}_OL_001_clip_fastp_flash_extendedFrags.fastq"
group:"group2"
conda:
"mpcr_testing"
params:
pfx ="{sample}_OL_001_clip_fastp_flash"
shell:"""
flash --max-overlap 150 --allow-outies {input.in1} {input.in2} -o {params.pfx}
mv {params.pfx}.extendedFrags.fastq {params.pfx}_extendedFrags.fastq
rm {params.pfx}.*
"""
checkpoint runcheckreads:
input:
in1 = "{sample}_R1_001_clip_fastp.fastq",
in2 = "{sample}_R2_001_clip_fastp.fastq",
inol="{sample}_OL_001_clip_fastp_flash_extendedFrags.fastq"
output: "{sample}_paircounts.txt"
group:"group2"
conda:
"mpcr_testing"
params:
primers = config["primers"],
nonprimertargets = config["nonprimertargets"],
targets = config["targets"],
adapters = config["adapters"],
snpdata = config["snpdata"]
shell:"""
python scripts/checkreads.py {input.in1} {input.in2} {input.inol} {params.primers} {params.nonprimertargets} {params.targets} {params.adapters} {output} {params.snpdata}
"""
rule collated_summary:
input: expand("{group}_paircounts.txt",group=CONDITIONS)
output: outpref+"_primer_pair_results.txt"
group: "group3"
params:
pfx =outpref
conda:
"mpcr_testing"
shell:"""
python scripts/checkread_collate.py {params.pfx} {input}
"""