-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSnakefile
93 lines (54 loc) · 1.87 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
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
# snakemake workflow to recover and estimate quality of plastids recovered from metagenomic samples
import os
# file locations
configfile: "config.yaml"
ASSEMBLYDIR = config["assemblydir"]
ASSEMBLYNAME = config["assemblyname"]
OUTPUTDIR = config["outputdir"]
MAPREQUIRE = config["maprequire"]
if MAPREQUIRE == True:
READDIR = config["readdir"]
if MAPREQUIRE == False:
MAPBAMDIR = config["mapbamdir"]
MAPBAM = config["mapbamfile"]
MINPLASTIDCONTENT = config["min_plastid_content"]
CATDBDIR = config["catdbdir"]
CATTAXDIR = config["cattaxdir"]
UNIREFDMND = config["unirefdb"]
def getsample_names(dir):
filelist = os.listdir(config["assemblydir"])
samplenames = []
for file in filelist:
samplename = file.split(".")[0]
samplenames.append(samplename)
return samplenames
SAMPLENAMES = getsample_names(config["assemblydir"])
for sample in SAMPLENAMES:
if not os.path.exists(OUTPUTDIR + sample + "/logs"):
os.makedirs(OUTPUTDIR + sample + "/logs")
if not os.path.exists(OUTPUTDIR + sample + "/working"):
os.makedirs(OUTPUTDIR + sample + "/working")
include: "rules/tiara.smk"
if MAPREQUIRE == True:
include: "rules/reads2assembly.smk"
if MAPREQUIRE == False:
include: "rules/nomapreq.smk"
include: "rules/plastidbins.smk"
include: "rules/kegg.smk"
include: "rules/quality_estimate.smk"
include: "rules/sourceclassify.smk"
include: "rules/markersearch.smk"
include: "rules/samplesummary.smk"
rule all:
input:
expand(
OUTPUTDIR + "{samplename}/plastids/plastidinfo.csv", samplename=SAMPLENAMES
),
expand(
OUTPUTDIR + "{samplename}/plastids/markersearch/rRNA_fasta.out",
samplename=SAMPLENAMES,
),
expand(
OUTPUTDIR + "{samplename}/plastids/markersearch/rbcL_fasta.out",
samplename=SAMPLENAMES,
),