From 9fa7edc9bcd80b061a901532b7b058cfb4d63be9 Mon Sep 17 00:00:00 2001 From: Ilja Bezrukov Date: Thu, 26 Jan 2023 16:06:11 +0100 Subject: [PATCH] Fix for SORT_BAM step failing Moved the $bam argument to samtools view, which otherwise gets no input data and causes the step to fail. Seems like the bug was introduced in commit 1a2e962, when always sorting bam files was added. This fixes the issue. --- modules/process/sort_bam_samtools.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/process/sort_bam_samtools.nf b/modules/process/sort_bam_samtools.nf index e917ce8..95a0a2f 100644 --- a/modules/process/sort_bam_samtools.nf +++ b/modules/process/sort_bam_samtools.nf @@ -11,6 +11,6 @@ process SORT_BAM { script: """ - samtools view -@ ${task.cpus} -bh -F 0x200 -F 0x4 | samtools sort -@ ${task.cpus} -o ${bam.baseName}.sorted.bam $bam + samtools view -@ ${task.cpus} -bh -F 0x200 -F 0x4 $bam | samtools sort -@ ${task.cpus} -o ${bam.baseName}.sorted.bam """ -} \ No newline at end of file +}