From 30af26a8b361f3d0e79e24fda84c28d9cd265df9 Mon Sep 17 00:00:00 2001 From: sofstam Date: Tue, 22 Nov 2022 16:50:50 +0100 Subject: [PATCH] Include the mapped reads in samtools stats --- subworkflows/local/longread_hostremoval.nf | 4 ++-- subworkflows/local/shortread_hostremoval.nf | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/subworkflows/local/longread_hostremoval.nf b/subworkflows/local/longread_hostremoval.nf index 5f3f746..b6a9419 100644 --- a/subworkflows/local/longread_hostremoval.nf +++ b/subworkflows/local/longread_hostremoval.nf @@ -44,8 +44,8 @@ workflow LONGREAD_HOSTREMOVAL { SAMTOOLS_INDEX ( SAMTOOLS_VIEW.out.bam ) ch_versions = ch_versions.mix( SAMTOOLS_INDEX.out.versions.first() ) - bam_bai = SAMTOOLS_VIEW.out.bam - .join(SAMTOOLS_INDEX.out.bai, remainder: true) + bam_bai = MINIMAP2_ALIGN.out.bam + .join(SAMTOOLS_INDEX.out.bai,by:[0], remainder: true) SAMTOOLS_STATS ( bam_bai, reference ) ch_versions = ch_versions.mix(SAMTOOLS_STATS.out.versions.first()) diff --git a/subworkflows/local/shortread_hostremoval.nf b/subworkflows/local/shortread_hostremoval.nf index 426442b..e0254c6 100644 --- a/subworkflows/local/shortread_hostremoval.nf +++ b/subworkflows/local/shortread_hostremoval.nf @@ -25,7 +25,7 @@ workflow SHORTREAD_HOSTREMOVAL { ch_bowtie2_index = index.first() } - BOWTIE2_ALIGN ( reads, ch_bowtie2_index, true, false ) + BOWTIE2_ALIGN ( reads, ch_bowtie2_index, true, true) ch_versions = ch_versions.mix( BOWTIE2_ALIGN.out.versions.first() ) ch_multiqc_files = ch_multiqc_files.mix( BOWTIE2_ALIGN.out.log ) @@ -41,8 +41,8 @@ workflow SHORTREAD_HOSTREMOVAL { SAMTOOLS_INDEX ( SAMTOOLS_VIEW.out.bam ) ch_versions = ch_versions.mix( SAMTOOLS_INDEX.out.versions.first() ) - bam_bai = SAMTOOLS_VIEW.out.bam - .join(SAMTOOLS_INDEX.out.bai, remainder: true) + bam_bai = BOWTIE2_ALIGN.out.bam + .join(SAMTOOLS_INDEX.out.bai, by:[0], remainder: true) SAMTOOLS_STATS ( bam_bai, reference ) ch_versions = ch_versions.mix(SAMTOOLS_STATS.out.versions.first())