forked from nf-core/chipseq
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.nf
More file actions
44 lines (37 loc) · 1.23 KB
/
main.nf
File metadata and controls
44 lines (37 loc) · 1.23 KB
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
/*
* Prepare genome intervals for filtering by removing regions in blacklist file
*/
process GENOME_BLACKLIST_REGIONS {
tag "$sizes"
conda "bioconda::bedtools=2.30.0"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/bedtools:2.30.0--hc088bd4_0':
'biocontainers/bedtools:2.30.0--hc088bd4_0' }"
input:
path sizes
path blacklist
output:
path '*.bed' , emit: bed
path "versions.yml", emit: versions
when:
task.ext.when == null || task.ext.when
script:
def file_out = "${sizes.simpleName}.include_regions.bed"
if (blacklist) {
"""
sortBed -i $blacklist -g $sizes | complementBed -i stdin -g $sizes > $file_out
cat <<-END_VERSIONS > versions.yml
"${task.process}":
bedtools: \$(bedtools --version | sed -e "s/bedtools v//g")
END_VERSIONS
"""
} else {
"""
awk '{print \$1, '0' , \$2}' OFS='\t' $sizes > $file_out
cat <<-END_VERSIONS > versions.yml
"${task.process}":
bedtools: \$(bedtools --version | sed -e "s/bedtools v//g")
END_VERSIONS
"""
}
}