2022-01-17 10:25:36 +00:00
|
|
|
process DEEPVARIANT {
|
|
|
|
tag "$meta.id"
|
|
|
|
label 'process_medium'
|
|
|
|
|
|
|
|
|
|
|
|
if (params.enable_conda) {
|
|
|
|
exit 1, "Conda environments cannot be used when using the DeepVariant tool. Please use docker or singularity containers."
|
|
|
|
}
|
|
|
|
|
|
|
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
2022-01-17 15:40:31 +00:00
|
|
|
'google/deepvariant:1.3.0' :
|
|
|
|
'google/deepvariant:1.3.0' }"
|
2022-01-17 10:25:36 +00:00
|
|
|
|
|
|
|
input:
|
2022-01-17 15:40:31 +00:00
|
|
|
tuple val(meta), path(input), path(index), path(intervals)
|
2022-01-17 10:25:36 +00:00
|
|
|
path(fasta)
|
|
|
|
path(fai)
|
|
|
|
|
|
|
|
output:
|
2022-03-03 10:54:07 +00:00
|
|
|
tuple val(meta), path("${prefix}.vcf.gz") , emit: vcf
|
|
|
|
tuple val(meta), path("${prefix}.g.vcf.gz"), emit: gvcf
|
2022-01-17 10:25:36 +00:00
|
|
|
path "versions.yml" , emit: versions
|
|
|
|
|
2022-02-04 08:53:32 +00:00
|
|
|
when:
|
|
|
|
task.ext.when == null || task.ext.when
|
|
|
|
|
2022-01-17 10:25:36 +00:00
|
|
|
script:
|
|
|
|
def args = task.ext.args ?: ''
|
2022-03-03 10:54:07 +00:00
|
|
|
prefix = task.ext.prefix ?: "${meta.id}"
|
2022-01-17 15:40:31 +00:00
|
|
|
def regions = intervals ? "--regions ${intervals}" : ""
|
2022-01-17 10:25:36 +00:00
|
|
|
|
|
|
|
"""
|
|
|
|
/opt/deepvariant/bin/run_deepvariant \\
|
|
|
|
--ref=${fasta} \\
|
2022-01-17 15:40:31 +00:00
|
|
|
--reads=${input} \\
|
2022-01-17 10:25:36 +00:00
|
|
|
--output_vcf=${prefix}.vcf.gz \\
|
|
|
|
--output_gvcf=${prefix}.g.vcf.gz \\
|
|
|
|
${args} \\
|
2022-01-17 15:40:31 +00:00
|
|
|
${regions} \\
|
2022-01-17 10:25:36 +00:00
|
|
|
--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
|
|
|
|
"""
|
2022-03-28 15:48:39 +00:00
|
|
|
|
|
|
|
stub:
|
|
|
|
def prefix = task.ext.prefix ?: "${meta.id}"
|
|
|
|
"""
|
|
|
|
touch ${prefix}.vcf.gz
|
|
|
|
touch ${prefix}.g.vcf.gz
|
|
|
|
|
|
|
|
cat <<-END_VERSIONS > versions.yml
|
|
|
|
"${task.process}":
|
|
|
|
deepvariant: \$(echo \$(/opt/deepvariant/bin/run_deepvariant --version) | sed 's/^.*version //; s/ .*\$//' )
|
|
|
|
END_VERSIONS
|
|
|
|
"""
|
2022-01-17 10:25:36 +00:00
|
|
|
}
|