fix index process

This commit is contained in:
MaxUlysse 2020-01-23 10:19:00 +01:00
parent ad3c14a964
commit a69aebd01b

View file

@ -7,15 +7,14 @@ process samtools_index {
path(bam)
output:
path "*.sorted.bam"
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 sort $bam \\
-@ ${task.cpus} ${avail_mem} \\
-o ${bam.baseName}.sorted.bam
samtools index $bam \\
-@ ${task.cpus} ${avail_mem}
samtools --version &> v_samtools.txt
"""