2020-12-17 23:50:24 +00:00
|
|
|
process SAMTOOLS_INDEX {
|
|
|
|
tag "$meta.id"
|
2021-03-16 17:16:47 +00:00
|
|
|
label 'process_low'
|
2020-12-17 23:50:24 +00:00
|
|
|
|
2021-11-18 21:24:47 +00:00
|
|
|
conda (params.enable_conda ? "bioconda::samtools=1.14" : null)
|
2021-11-26 07:58:40 +00:00
|
|
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
|
|
|
'https://depot.galaxyproject.org/singularity/samtools:1.14--hb421002_0' :
|
|
|
|
'quay.io/biocontainers/samtools:1.14--hb421002_0' }"
|
2020-12-17 23:50:24 +00:00
|
|
|
|
|
|
|
input:
|
2021-11-10 09:30:48 +00:00
|
|
|
tuple val(meta), path(input)
|
2020-12-17 23:50:24 +00:00
|
|
|
|
|
|
|
output:
|
2021-12-13 16:15:20 +00:00
|
|
|
tuple val(meta), path("*.bai") , optional:true, emit: bai
|
|
|
|
tuple val(meta), path("*.csi") , optional:true, emit: csi
|
|
|
|
tuple val(meta), path("*.crai"), optional:true, emit: crai
|
|
|
|
path "versions.yml" , emit: versions
|
2020-12-17 23:50:24 +00:00
|
|
|
|
2022-02-04 08:53:32 +00:00
|
|
|
when:
|
|
|
|
task.ext.when == null || task.ext.when
|
|
|
|
|
2020-12-17 23:50:24 +00:00
|
|
|
script:
|
2021-11-26 07:58:40 +00:00
|
|
|
def args = task.ext.args ?: ''
|
2020-12-17 23:50:24 +00:00
|
|
|
"""
|
2022-01-07 17:52:39 +00:00
|
|
|
samtools \\
|
|
|
|
index \\
|
|
|
|
-@ ${task.cpus-1} \\
|
|
|
|
$args \\
|
|
|
|
$input
|
2021-11-18 21:24:47 +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}":
|
|
|
|
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
|
2021-09-27 08:41:24 +00:00
|
|
|
END_VERSIONS
|
2020-12-17 23:50:24 +00:00
|
|
|
"""
|
|
|
|
}
|