2020-12-17 18:50:24 -05:00
|
|
|
process SAMTOOLS_IDXSTATS {
|
|
|
|
tag "$meta.id"
|
2021-03-16 13:16:47 -04:00
|
|
|
label 'process_low'
|
2020-12-17 18:50:24 -05:00
|
|
|
|
2022-04-11 08:26:28 -04:00
|
|
|
conda (params.enable_conda ? "bioconda::samtools=1.15.1" : null)
|
2021-11-26 02:58:40 -05:00
|
|
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
2022-04-11 08:26:28 -04:00
|
|
|
'https://depot.galaxyproject.org/singularity/samtools:1.15.1--h1170115_0' :
|
|
|
|
'quay.io/biocontainers/samtools:1.15.1--h1170115_0' }"
|
2020-12-17 18:50:24 -05:00
|
|
|
|
|
|
|
input:
|
|
|
|
tuple val(meta), path(bam), path(bai)
|
|
|
|
|
|
|
|
output:
|
|
|
|
tuple val(meta), path("*.idxstats"), emit: idxstats
|
2021-10-01 09:04:56 -04:00
|
|
|
path "versions.yml" , emit: versions
|
2020-12-17 18:50:24 -05:00
|
|
|
|
2022-02-04 03:53:32 -05:00
|
|
|
when:
|
|
|
|
task.ext.when == null || task.ext.when
|
|
|
|
|
2020-12-17 18:50:24 -05:00
|
|
|
script:
|
2021-11-26 02:58:40 -05:00
|
|
|
def args = task.ext.args ?: ''
|
2022-06-16 07:42:01 -04:00
|
|
|
def prefix = task.ext.prefix ?: "${meta.id}"
|
|
|
|
|
2020-12-17 18:50:24 -05:00
|
|
|
"""
|
2022-01-07 12:52:39 -05:00
|
|
|
samtools \\
|
|
|
|
idxstats \\
|
2022-09-26 12:44:36 -04:00
|
|
|
--threads ${task.cpus-1} \\
|
2022-01-07 12:52:39 -05:00
|
|
|
$bam \\
|
2022-06-16 07:42:01 -04:00
|
|
|
> ${prefix}.idxstats
|
2022-01-07 12:52:39 -05:00
|
|
|
|
2021-09-27 04:41:24 -04:00
|
|
|
cat <<-END_VERSIONS > versions.yml
|
2021-11-26 02:58:40 -05:00
|
|
|
"${task.process}":
|
|
|
|
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
|
2021-09-27 04:41:24 -04:00
|
|
|
END_VERSIONS
|
2020-12-17 18:50:24 -05:00
|
|
|
"""
|
|
|
|
}
|