-
Notifications
You must be signed in to change notification settings - Fork 526
Expand file tree
/
Copy pathmain.nf
More file actions
66 lines (57 loc) · 2.23 KB
/
main.nf
File metadata and controls
66 lines (57 loc) · 2.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
process DEEPVARIANT {
tag "$meta.id"
label 'process_high'
container "nf-core/deepvariant:1.5.0"
input:
tuple val(meta), path(input), path(index), path(intervals)
tuple val(meta2), path(fasta)
tuple val(meta3), path(fai)
tuple val(meta4), path(gzi)
output:
tuple val(meta), path("${prefix}.vcf.gz") , emit: vcf
tuple val(meta), path("${prefix}.vcf.gz.tbi") , emit: vcf_tbi
tuple val(meta), path("${prefix}.g.vcf.gz") , emit: gvcf
tuple val(meta), path("${prefix}.g.vcf.gz.tbi"), emit: gvcf_tbi
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
// Exit if running this module with -profile conda / -profile mamba
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
error "DEEPVARIANT module does not support Conda. Please use Docker / Singularity / Podman instead."
}
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
def regions = intervals ? "--regions=${intervals}" : ""
"""
/opt/deepvariant/bin/run_deepvariant \\
--ref=${fasta} \\
--reads=${input} \\
--output_vcf=${prefix}.vcf.gz \\
--output_gvcf=${prefix}.g.vcf.gz \\
${args} \\
${regions} \\
--intermediate_results_dir=. \\
--num_shards=${task.cpus}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
deepvariant: \$(echo \$(/opt/deepvariant/bin/run_deepvariant --version) | sed 's/^.*version //; s/ .*\$//' )
END_VERSIONS
"""
stub:
// Exit if running this module with -profile conda / -profile mamba
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
error "DEEPVARIANT module does not support Conda. Please use Docker / Singularity / Podman instead."
}
prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.vcf.gz
touch ${prefix}.vcf.gz.tbi
touch ${prefix}.g.vcf.gz
touch ${prefix}.g.vcf.gz.tbi
cat <<-END_VERSIONS > versions.yml
"${task.process}":
deepvariant: \$(echo \$(/opt/deepvariant/bin/run_deepvariant --version) | sed 's/^.*version //; s/ .*\$//' )
END_VERSIONS
"""
}