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

54 lines
1.6 KiB
Text
Raw Normal View History

2022-05-31 18:13:48 +00:00
process GATK_REALIGNERTARGETCREATOR {
tag "$meta.id"
label 'process_low'
2022-05-31 18:19:49 +00:00
conda (params.enable_conda ? "bioconda::gatk=3.5" : null)
2022-05-31 18:13:48 +00:00
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
2022-05-31 18:19:49 +00:00
'https://depot.galaxyproject.org/singularity/gatk:3.5--hdfd78af_11':
'quay.io/biocontainers/gatk:3.5--hdfd78af_11' }"
2022-05-31 18:13:48 +00:00
input:
2022-06-02 18:24:14 +00:00
tuple val(meta), path(input), path(index)
path fasta
path fai
path dict
path known_vcf
2022-05-31 18:13:48 +00:00
output:
2022-05-31 18:35:54 +00:00
tuple val(meta), path("*.intervals"), emit: intervals
path "versions.yml" , emit: versions
2022-05-31 18:13:48 +00:00
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
2022-05-31 18:35:54 +00:00
def known = known_vcf ? "-known ${known_vcf}" : ""
2022-06-02 18:32:00 +00:00
if ("$input" == "${prefix}.bam") error "Input and output names are the same, set prefix in module configuration to disambiguate!"
2022-05-31 18:19:49 +00:00
2022-06-02 18:24:14 +00:00
def avail_mem = 3
if (!task.memory) {
log.info '[GATK RealignerTargetCreator] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
2022-06-02 18:24:14 +00:00
} else {
avail_mem = task.memory.giga
}
2022-05-31 18:13:48 +00:00
"""
2022-05-31 18:19:49 +00:00
gatk3 \\
2022-06-02 18:24:14 +00:00
-Xmx${avail_mem}g \\
2022-05-31 18:35:54 +00:00
-T RealignerTargetCreator \\
-nt ${task.cpus} \\
2022-06-02 18:32:00 +00:00
-I ${input} \\
2022-05-31 18:35:54 +00:00
-R ${fasta} \\
-o ${prefix}.intervals \\
2022-05-31 18:19:49 +00:00
${known} \\
$args
2022-05-31 18:13:48 +00:00
cat <<-END_VERSIONS > versions.yml
"${task.process}":
2022-05-31 18:19:49 +00:00
gatk: \$(echo \$(gatk3 --version))
2022-05-31 18:13:48 +00:00
END_VERSIONS
"""
}