forked from nf-core/phaseimpute
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.nf
More file actions
51 lines (43 loc) · 1.73 KB
/
main.nf
File metadata and controls
51 lines (43 loc) · 1.73 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
45
46
47
48
49
50
51
process BEAGLE5_BEAGLE {
tag "$meta.id"
label 'process_high'
conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/beagle:5.2_21Apr21.304--hdfd78af_0':
'biocontainers/beagle:5.2_21Apr21.304--hdfd78af_0' }"
input:
tuple val(meta), path(vcf), path(refpanel), path(genmap), path(exclsamples), path(exclmarkers)
output:
tuple val(meta), path("*.vcf.gz") , emit: vcf
tuple val(meta), path("*.log") , emit: log
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}.bglout"
def ref_command = refpanel ? "ref=$refpanel" : ""
def map_command = genmap ? "map=$genmap" : ""
def excludesamples_command = exclsamples ? "excludesamples=$exclsamples" : ""
def excludemarkers_command = exclmarkers ? "excludemarkers=$exclmarkers" : ""
def avail_mem = 3072
if (!task.memory) {
log.info '[beagle] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = (task.memory.mega*0.8).intValue()
}
"""
beagle -Xmx${avail_mem}M \\
gt=${vcf} \\
out=${prefix} \\
$args \\
${ref_command} \\
${map_command} \\
${excludesamples_command} \\
${excludemarkers_command} \\
cat <<-END_VERSIONS > versions.yml
"${task.process}":
beagle: \$(beagle 2>&1 |head -n1 | sed -rn 's/beagle\\.(.*)\\.jar \\(version (.*)\\)/\\2rev\\1/p')
END_VERSIONS
"""
}