2021-03-22 16:05:59 +00:00
|
|
|
process PICARD_COLLECTWGSMETRICS {
|
|
|
|
tag "$meta.id"
|
|
|
|
label 'process_medium'
|
|
|
|
|
2022-05-30 08:15:40 +00:00
|
|
|
conda (params.enable_conda ? "bioconda::picard=2.27.2" : null)
|
2021-11-26 07:58:40 +00:00
|
|
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
2022-05-30 08:15:40 +00:00
|
|
|
'https://depot.galaxyproject.org/singularity/picard:2.27.2--hdfd78af_0' :
|
|
|
|
'quay.io/biocontainers/picard:2.27.2--hdfd78af_0' }"
|
2021-03-22 16:05:59 +00:00
|
|
|
|
|
|
|
input:
|
2022-04-29 07:32:32 +00:00
|
|
|
tuple val(meta), path(bam)
|
2021-03-22 16:05:59 +00:00
|
|
|
path fasta
|
|
|
|
|
|
|
|
output:
|
|
|
|
tuple val(meta), path("*_metrics"), emit: metrics
|
2021-10-01 13:04:56 +00:00
|
|
|
path "versions.yml" , emit: versions
|
2021-03-22 16:05:59 +00:00
|
|
|
|
2022-02-04 08:53:32 +00:00
|
|
|
when:
|
|
|
|
task.ext.when == null || task.ext.when
|
|
|
|
|
2021-03-22 16:05:59 +00:00
|
|
|
script:
|
2021-11-26 07:58:40 +00:00
|
|
|
def args = task.ext.args ?: ''
|
2021-12-02 12:39:55 +00:00
|
|
|
def prefix = task.ext.prefix ?: "${meta.id}"
|
2021-03-22 16:05:59 +00:00
|
|
|
def avail_mem = 3
|
|
|
|
if (!task.memory) {
|
|
|
|
log.info '[Picard CollectWgsMetrics] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
|
|
|
|
} else {
|
|
|
|
avail_mem = task.memory.giga
|
|
|
|
}
|
|
|
|
"""
|
|
|
|
picard \\
|
|
|
|
-Xmx${avail_mem}g \\
|
|
|
|
CollectWgsMetrics \\
|
2021-11-26 07:58:40 +00:00
|
|
|
$args \\
|
2022-04-29 05:57:11 +00:00
|
|
|
--INPUT $bam \\
|
|
|
|
--OUTPUT ${prefix}.CollectWgsMetrics.coverage_metrics \\
|
2022-05-22 04:44:05 +00:00
|
|
|
--REFERENCE_SEQUENCE ${fasta}
|
2021-03-22 16:05:59 +00:00
|
|
|
|
|
|
|
|
2021-09-27 08:41:24 +00:00
|
|
|
cat <<-END_VERSIONS > versions.yml
|
2021-11-26 07:58:40 +00:00
|
|
|
"${task.process}":
|
|
|
|
picard: \$(picard CollectWgsMetrics --version 2>&1 | grep -o 'Version.*' | cut -f2- -d:)
|
2021-09-27 08:41:24 +00:00
|
|
|
END_VERSIONS
|
2021-03-22 16:05:59 +00:00
|
|
|
"""
|
|
|
|
}
|