From c4212df1b3986421e14285d256f828c5d7e1e17a Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Thu, 19 Oct 2023 16:24:50 -0400 Subject: [PATCH] feat: index bam --- modules/CCBR/samtools/filter_aligned/main.nf | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/CCBR/samtools/filter_aligned/main.nf b/modules/CCBR/samtools/filter_aligned/main.nf index 71ac52b..8f0cc8a 100644 --- a/modules/CCBR/samtools/filter_aligned/main.nf +++ b/modules/CCBR/samtools/filter_aligned/main.nf @@ -12,8 +12,8 @@ process FILTER_ALIGNED { tuple val(meta), path(bam), path(bai) output: - tuple val(meta), path("*.unaligned.bam"), emit: bam - path "versions.yml" , emit: versions + tuple val(meta), path("*.unaligned.bam"), path('*.unaligned.bam.bai'), emit: bam + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -28,6 +28,9 @@ process FILTER_ALIGNED { -b \\ -o ${prefix}.unaligned.bam \\ ${prefix}.bam + samtools index \\ + -@ ${task.cpus} \\ + ${prefix}.unaligned.bam cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -37,6 +40,6 @@ process FILTER_ALIGNED { stub: """ - touch ${meta.id}.unaligned.bam versions.yml + touch ${meta.id}.unaligned.bam ${meta.id}.unaligned.bam.bai versions.yml """ }