diff --git a/modules/samtools/merge/main.nf b/modules/samtools/merge/main.nf index ec79142..d3cbeec 100644 --- a/modules/samtools/merge/main.nf +++ b/modules/samtools/merge/main.nf @@ -9,7 +9,7 @@ process SAMTOOLS_MERGE { tag "${meta.sample_id}" input: - tuple val(meta), path(aligned_bam_list) + tuple val(meta), path(aligned_bam_list, stageAs: 'input*/*') output: tuple val(meta), path(merged_bam), emit: bam diff --git a/subworkflows/coverage/main.nf b/subworkflows/coverage/main.nf index e88efae..6476a46 100644 --- a/subworkflows/coverage/main.nf +++ b/subworkflows/coverage/main.nf @@ -56,6 +56,12 @@ workflow COVERAGE { ) ch_bam = ch_bam.mix(ALIGN_LONG_READS.out.bam) + /* + We need both platform-specific as well as + sample-level coverage reports. So we combine all bams + for one sample to compute a global coverage in addition + to the platform-level reports + */ bam_mapped = ch_bam.map { meta, bam -> new_meta = [:] new_meta.sample_id = meta.sample_id @@ -68,9 +74,18 @@ workflow COVERAGE { multiple: it[1].size() > 1 }.set { bam_to_merge } + SAMTOOLS_MERGE( + bam_to_merge.multiple + ) + + bam_to_merge.single.mix(SAMTOOLS_MERGE.out.bam).map { m,b -> + m.platform = "ALL" + tuple(m,b) + }.set { ch_bam_all } + // Index the BAM files SAMTOOLS_INDEX( - ch_bam + ch_bam.mix(ch_bam_all) ) // Calculate coverage diff --git a/subworkflows/find_references/main.nf b/subworkflows/find_references/main.nf index 5798c60..fef4809 100644 --- a/subworkflows/find_references/main.nf +++ b/subworkflows/find_references/main.nf @@ -31,6 +31,10 @@ workflow FIND_REFERENCES { tuple(m, r) }.set { mash_with_gbk } + mash_with_gbk.map { m,r -> + "${m.sample_id}\t${r.getBaseName()}" + }.view() + mash_with_gbk.map { m, r -> m.gbk }.unique() diff --git a/workflows/gabi.nf b/workflows/gabi.nf index 040906c..7205454 100644 --- a/workflows/gabi.nf +++ b/workflows/gabi.nf @@ -234,6 +234,11 @@ workflow GABI { m.platform == "PACBIO" }.map { m,r -> r } ) + multiqc_files = multiqc_files.mix( + COVERAGE.out.report.filter { m,r -> + m.platform == "ALL" + }.map { m,r -> r } + ) /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~