nf-core_modules/modules/gatk/indelrealigner/main.nf

55 lines
1.5 KiB
Text
Raw Normal View History

2022-05-30 19:12:21 +00:00
process GATK_INDELREALIGNER {
tag "$meta.id"
label 'process_single'
2022-05-30 19:12:21 +00:00
conda (params.enable_conda ? "bioconda::gatk=3.5" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/gatk:3.5--hdfd78af_11':
'quay.io/biocontainers/gatk:3.5--hdfd78af_11' }"
input:
2022-06-09 06:26:04 +00:00
tuple val(meta), path(bam), path(bai), path(intervals)
path(fasta)
2022-06-02 18:27:16 +00:00
path(fai)
path(dict)
path(known_vcf)
2022-05-30 19:12:21 +00:00
output:
tuple val(meta), path("*.bam"), path("*.bai"), emit: bam
2022-05-30 19:12:21 +00:00
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}"
def known = known_vcf ? "-known ${known_vcf}" : ""
2022-06-02 18:27:16 +00:00
if ("$bam" == "${prefix}.bam") error "Input and output names are the same, set prefix in module configuration to disambiguate!"
2022-06-08 19:14:08 +00:00
2022-06-02 18:27:16 +00:00
def avail_mem = 3
if (!task.memory) {
log.info '[GATK IndelRealigner] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = task.memory.giga
}
2022-05-30 19:12:21 +00:00
"""
gatk3 \\
-Xmx${avail_mem}g \\
2022-06-02 18:27:16 +00:00
-T IndelRealigner \\
2022-05-30 19:12:21 +00:00
-R ${fasta} \\
-I ${bam} \\
2022-06-08 19:14:08 +00:00
--targetIntervals ${intervals} \\
2022-05-30 19:12:21 +00:00
${known} \\
-o ${prefix}.bam \\
$args
cat <<-END_VERSIONS > versions.yml
"${task.process}":
gatk: \$(echo \$(gatk3 --version))
END_VERSIONS
"""
}