generated from ngs-docs/2022-ggg-201b-hw2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Snakefile
43 lines (39 loc) · 1.23 KB
/
Snakefile
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
rule all:
input:
"SRR2584857_quast.4000000",
"SRR2584857_annot.4000000",
rule subset_reads:
input:
"{sample}.fastq.gz",
output:
"{sample}.{subset,\d+}.fastq.gz"
shell: """
gunzip -c {input} | head -{wildcards.subset} | gzip -9c > {output} || true
"""
rule annotate:
input:
"SRR2584857-assembly.{subset}.fa"
output:
directory("SRR2584857_annot.{subset}")
shell: """
prokka --prefix {output} {input}
"""
rule assemble:
input:
r1 = "SRR2584857_1.{subset}.fastq.gz",
r2 = "SRR2584857_2.{subset}.fastq.gz"
output:
dir = directory("SRR2584857_assembly.{subset}"),
assembly = "SRR2584857-assembly.{subset}.fa"
shell: """
megahit -1 {input.r1} -2 {input.r2} -f -m 5e9 -t 4 -o {output.dir}
cp {output.dir}/final.contigs.fa {output.assembly}
"""
rule quast:
input:
"SRR2584857-assembly.{subset}.fa"
output:
directory("SRR2584857_quast.{subset}")
shell: """
quast {input} -o {output}
"""