forked from broadinstitute/ABC-Enhancer-Gene-Prediction
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Snakefile
62 lines (59 loc) · 1.82 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
rule all:
input:
"{output_dir}{output_name}_peaks.narrowPeak",
"{output_dir}{output_name}_peaks.narrowPeak.candidateRegions.bed"
rule call_peaks:
input:
bam_file = config['bam_file']
output:
"{output_dir}{output_name}_peaks.narrowPeak"
conda:
"macs.yml"
shell:
"""
macs2 callpeak \
-t {input.bam_file} \
-n {config[output_name]} \
-f BAM \
-g hs \
-p .1 \
--call-summits \
--outdir {config[output_dir]}
"""
rule sort_narrowPeak:
input:
"{output_dir}{output_name}_peaks.narrowPeak"
output:
"{output_dir}{output_name}_peaks.narrowPeak.sorted"
conda:
"macs.yml"
shell:
"""
bedtools sort -faidx {config[chrom_sizes_file]} -i {input} > {output}
"""
rule make_candidate_regions:
input:
narrowPeak = "{output_dir}{output_name}_peaks.narrowPeak.sorted",
bam_file = config['bam_file']
output:
"{output_dir}{output_name}_peaks.narrowPeak.candidateRegions.bed"
params:
chrom_sizes = config['chrom_sizes_file'],
blocklist = config['regions_blocklist_file'],
includelist = config['regions_includelist_file'],
peakExtendFromSummit = config['peakExtendFromSummit'],
nStrongestPeaks = config['nStrongestPeaks']
conda:
"abcenv.yml"
shell:
"""
python src/makeCandidateRegions.py \
--narrowPeak {input.narrowPeak} \
--bam {input.bam_file} \
--outDir {config[output_dir]} \
--chrom_sizes {params.chrom_sizes} \
--regions_blocklist {params.blocklist} \
--regions_includelist {params.includelist} \
--peakExtendFromSummit {params.peakExtendFromSummit} \
--nStrongestPeaks {params.nStrongestPeaks}
"""