-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassemly.smk
107 lines (75 loc) · 3.12 KB
/
assemly.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
73
74
75
76
77
78
79
80
81
82
83
84
85
# assembly for viral and unclassed seqs.
import os
import shutil
if os.path.exists('06_assembly/01_metaspades'):
shutil.rmtree('06_assembly/01_metaspades', ignore_errors=True)
if os.path.exists('06_assembly/02_spades'):
shutil.rmtree('06_assembly/02_spades', ignore_errors=True)
if os.path.exists('06_assembly/03_megahit'):
shutil.rmtree('06_assembly/03_megahit', ignore_errors=True)
if os.path.exists('06_assembly/01_metaspades_quast'):
shutil.rmtree('06_assembly/01_metaspades_quast', ignore_errors=True)
if os.path.exists('06_assembly/02_spades_quast'):
shutil.rmtree('06_assembly/02_spades_quast', ignore_errors=True)
if os.path.exists('06_assembly/03_megahit_quast'):
shutil.rmtree('06_assembly/03_megahit_quast', ignore_errors=True)
rule assembly_metaspades:
input:
fq1 = '04_annotation/{}_viral_unclass.R1.fq'.format(config['samples']['id']),
fq2 = '04_annotation/{}_viral_unclass.R2.fq'.format(config['samples']['id'])
output:
directory('06_assembly/01_metaspades')
threads:
int(config['threads']['bwa'])
shell:
"metaspades.py -t {threads} -1 {input.fq1} -2 {input.fq2} -o {output}"
rule quast_metaspades:
input:
fa = '06_assembly/01_metaspades',
viral_ref = "/BIGDATA2/gzfezx_shhli_2/USER/luozhenyu/database/viral_refseq/viral.1.1.genomic.fna"
output:
directory('06_assembly/01_metaspades_quast')
threads:
int(config['threads']['bwa'])
shell:
"quast.py -t {threads} -r {input.viral_ref} -o {output} {input.fa}/contigs.fasta"
rule assembly_spades:
input:
fq1 = '04_annotation/{}_viral_unclass.R1.fq'.format(config['samples']['id']),
fq2 = '04_annotation/{}_viral_unclass.R2.fq'.format(config['samples']['id'])
output:
directory('06_assembly/02_spades')
threads:
int(config['threads']['bwa'])
shell:
"spades.py -t {threads} -1 {input.fq1} -2 {input.fq2} -o {output} --metaviral"
rule quast_spades:
input:
fa = '06_assembly/02_spades',
viral_ref = "/BIGDATA2/gzfezx_shhli_2/USER/luozhenyu/database/viral_refseq/viral.1.1.genomic.fna"
output:
directory('06_assembly/02_spades_quast')
threads:
int(config['threads']['bwa'])
shell:
"quast.py -t {threads} -r {input.viral_ref} -o {output} {input.fa}/contigs.fasta"
rule assembly_megahit:
input:
fq1 = '04_annotation/{}_viral_unclass.R1.fq'.format(config['samples']['id']),
fq2 = '04_annotation/{}_viral_unclass.R2.fq'.format(config['samples']['id'])
output:
directory('06_assembly/03_megahit')
threads:
int(config['threads']['bwa'])
shell:
"megahit -t {threads} -1 {input.fq1} -2 {input.fq2} -o {output}"
rule quast_megahit:
input:
fa = '06_assembly/03_megahit',
viral_ref = "/BIGDATA2/gzfezx_shhli_2/USER/luozhenyu/database/viral_refseq/viral.1.1.genomic.fna"
output:
directory('06_assembly/03_megahit_quast')
threads:
int(config['threads']['bwa'])
shell:
"quast.py -t {threads} -r {input.viral_ref} -o {output} {input.fa}/final.contigs.fa"