mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-11-11 04:33:10 +00:00
70daf8be30
This commit provides a minor refactoring with som Nextflow code style improvments: - Replaces `.toGiga()` with `.giga` - Replaces `tag { foo }` with `tag "$foo"` - Move publishDir before input declarations. Directives should be before the first input. Tho this is not enforced, it may be in future versions. - Replaces input `file` with `path` - Remove unnecessary parentheses
21 lines
529 B
Text
21 lines
529 B
Text
process samtools_index {
|
|
tag "${bam.baseName}"
|
|
|
|
container 'quay.io/biocontainers/samtools:1.9--h10a08f8_12'
|
|
|
|
input:
|
|
path bam
|
|
|
|
output:
|
|
path "*.bai"
|
|
|
|
script:
|
|
def suff_mem = ("${(task.memory.toBytes() - 6000000000) / task.cpus}" > 2000000000) ? 'true' : 'false'
|
|
def avail_mem = (task.memory && suff_mem) ? "-m" + "${(task.memory.toBytes() - 6000000000) / task.cpus}" : ''
|
|
"""
|
|
samtools index $bam \\
|
|
-@ ${task.cpus} ${avail_mem}
|
|
|
|
samtools --version &> v_samtools.txt
|
|
"""
|
|
}
|