-
Notifications
You must be signed in to change notification settings - Fork 6
/
Snakefile
105 lines (86 loc) · 4.36 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
94
95
96
97
98
99
100
101
102
103
configfile: "config.yaml"
from snakemake.utils import Paramspace
import pandas as pd
import os
import random
df = pd.read_csv(os.path.join(config["input_dir"],config["barcodes"]), sep='\t', dtype="object").set_index('Sample')
SAMPLES = df.index
SAMPLE = SAMPLES[0]
flowCell = df.Flowcell[0]
lane = df.Lane[0]
projectName=random.randint(1,1000000) #To ensure non overlapping tmp directories
paramspace = Paramspace(pd.read_csv("src/parameter_test/paramTest.tsv", sep="\t"))
if config["mode"] == "reference":
include: "src/rules/fastqc-ref.rules"
include: "src/rules/reference.rules"
include: "src/rules/demultiplex.rules"
include: "src/rules/trimming.rules"
if config["mode"] == "denovo":
include: "src/rules/demultiplex.rules"
include: "src/rules/denovo.rules"
include: "src/rules/trimming.rules"
include: "src/rules/fastqc.rules"
if config["mode"] == "paramTest":
include: "src/rules/demultiplex.rules"
include: "src/rules/paramTest.rules"
include: "src/rules/trimming.rules"
if config["mode"]== "reference":
rule all:
input: expand("{out}/output_demultiplex/clone-stacks/{sample}-Watson.1.fq.gz \
{out}/output_demultiplex/clone-stacks/{sample}-Watson.2.fq.gz \
{out}/output_demultiplex/clone-stacks/{sample}-Crick.1.fq.gz \
{out}/output_demultiplex/clone-stacks/{sample}-Crick.2.fq.gz \
{out}/fastqc/ \
{out}/multiQC_report.html \
{out}/cutadapt/{sample}_trimmed_filt_merged.1.fq.gz \
{out}/cutadapt/{sample}_trimmed_filt_merged.2.fq.gz \
{out}/alignment/{sample}_trimmed_filt_merged.1_bismark_bt2_pe.bam \
{out}/methylation_calling/{sample}_bismark_bt2_pe.CX_report.txt.gz \
{out}/snp_calling/snp.vcf.gz".split(),out=config["output_dir"],sample=SAMPLES)
if config["mode"]== "denovo":
rule all:
input: expand("{out}/output_demultiplex/Watson_R2.fq.gz \
{out}/output_demultiplex/Watson_R1.fq.gz \
{out}/output_demultiplex/Crick_R2.fq.gz \
{out}/output_demultiplex/Crick_R1.fq.gz \
{out}/fastqc/ \
{out}/multiQC_report.html \
{out}/output_denovo/consensus_cluster.renamed.fa \
{out}/cutadapt/{sample}_trimmed_filt_merged.1.fq.gz \
{out}/cutadapt/{sample}_trimmed_filt_merged.1.fq.gz \
{out}/alignment/{sample}_trimmed_filt_merged.1_bismark_bt2_pe.bam \
{out}/methylation_calling/{sample}_bismark_bt2_pe.CX_report.txt.gz \
{out}/snp_calling/snp.vcf.gz".split(),out=config["output_dir"],sample=SAMPLES)
if config["mode"]== "paramTest":
rule all:
input: expand("{out}/output_demultiplex/clone-stacks/{samples}-Watson.1.fq.gz \
{out}/output_demultiplex/clone-stacks/{samples}-Watson.2.fq.gz \
{out}/output_demultiplex/clone-stacks/{samples}-Crick.1.fq.gz \
{out}/output_demultiplex/clone-stacks/{samples}-Crick.2.fq.gz \
{out}/output_demultiplex/Watson_R2.fq.gz \
{out}/output_demultiplex/Watson_R1.fq.gz \
{out}/output_demultiplex/Crick_R2.fq.gz \
{out}/output_demultiplex/Crick_R1.fq.gz \
{out}/paramTest/{params}/alignment/{sample}_trimmed_filt_merged.1_bismark_bt2_pe.bam \
{out}/paramTest/{params}/output_denovo/consensus_cluster.renamed.fa \
{out}/paramTest/Assembled.txt \
{out}/paramTest/averageDepth.txt \
{out}/paramTest/denovoParameter.tsv \
{out}/paramTest/denovoParameter.tiff \
{out}/cutadapt/{sample}_trimmed_filt_merged.1.fq.gz \
{out}/cutadapt/{sample}_trimmed_filt_merged.2.fq.gz".split(),out=config["output_dir"],params=paramspace.instance_patterns,sample=SAMPLE,samples=SAMPLES)
if config["mode"] == "legacy":
include: "src/rules/legacy.rules"
include: "src/rules/demultiplex.rules"
include: "src/rules/report.rules"
if config["mode"]== "legacy":
rule all:
input: expand("{out}/output_demultiplex/Watson_R2.fq.gz \
{out}/output_demultiplex/Watson_R1.fq.gz \
{out}/output_demultiplex/Crick_R2.fq.gz \
{out}/output_demultiplex/Crick_R1.fq.gz \
{out}/mapping/watson.bam \
{out}/mapping/crick.bam \
{out}/output_denovo/consensus_cluster.renamed.fa \
{out}/mapping/methylation.bed \
{out}/mapping/snp.vcf.gz".split(), out=config["output_dir"])