-
Notifications
You must be signed in to change notification settings - Fork 3
/
Snakefile
69 lines (62 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
import os
# read config info into this namespace
configfile: "config.yaml"
include: "bamQC"
rule all:
input:
expand("{mapping_folder}/{sample}.sort.bam.bai", mapping_folder=config['mappings'], sample=config["samples"]),
expand("{mapping_folder}/{sample}.sort.bam", mapping_folder=config['mappings'], sample=config["samples"]),
os.path.join(config['mappings'], "BamQC.pdf"),
"qc/multiqc.html"
rule fastqc:
input:
lambda wildcards: config["samples"][wildcards.sample]['reads'][int(wildcards.read)-1]
output:
html="FastQC/{sample}_R{read}_fastqc.html",
zip="FastQC/{sample}_R{read}_fastqc.zip"
params: ""
wrapper:
"0.17.4/bio/fastqc"
rule multiqc:
input:
expand("FastQC/{sample}_R{read}_fastqc.html", sample=config["samples"], read=[1,2]),
output:
"qc/multiqc.html"
params:
"" # Optional: extra parameters for multiqc.
log:
"Logs/MultiQC/multiqc.log"
wrapper:
"0.19.3/bio/multiqc"
rule hisat:
input:
reads = lambda wildcards: config["samples"][wildcards.sample]['reads']
output:
temp("{mapping_folder}/{sample}.bam")
params:
idx = config["index"],
extra = '--known-splicesite-infile ' + config["splice_sites"]
benchmark:
"Benchmarks/{sample}.hisat.benchmark.txt"
log:
"Logs/{mapping_folder}/{sample}_hisat_map.txt"
threads: 8 # optional, defaults to 1
wrapper:
"0.17.4/bio/hisat2"
rule sort_bam:
input:
rules.hisat.output
output:
"{mapping_folder}/{sample}.sort.bam"
params:
"-m 4G"
threads: 8
wrapper:
"0.17.4/bio/samtools/sort"
rule samtools_index:
input:
rules.sort_bam.output
output:
"{mapping_folder}/{sample}.sort.bam.bai"
wrapper:
"0.17.4/bio/samtools/index"