diff --git a/modules.json b/modules.json index 153e1d9..044418e 100644 --- a/modules.json +++ b/modules.json @@ -70,13 +70,13 @@ "picard/markduplicates": { "branch": "master", "git_sha": "20b0918591d4ba20047d7e13e5094bcceba81447", - "installed_by": ["bam_markduplicates_picard"], + "installed_by": ["modules"], "patch": "modules/nf-core/picard/markduplicates/picard-markduplicates.diff" }, "samtools/coverage": { "branch": "master", "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", - "installed_by": ["bam_stats_samtools"] + "installed_by": ["modules"] }, "samtools/depth": { "branch": "master", @@ -92,22 +92,22 @@ "samtools/flagstat": { "branch": "master", "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", - "installed_by": ["bam_stats_samtools"] + "installed_by": ["modules"] }, "samtools/idxstats": { "branch": "master", "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", - "installed_by": ["bam_stats_samtools"] + "installed_by": ["modules"] }, "samtools/index": { "branch": "master", "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", - "installed_by": ["bam_markduplicates_picard"] + "installed_by": ["modules"] }, "samtools/stats": { "branch": "master", "git_sha": "a64788f5ad388f1d2ac5bd5f1f3f8fc81476148c", - "installed_by": ["bam_stats_samtools"] + "installed_by": ["modules"] }, "tabix/bgzip": { "branch": "master", @@ -125,20 +125,6 @@ "installed_by": ["modules"] } } - }, - "subworkflows": { - "nf-core": { - "bam_markduplicates_picard": { - "branch": "master", - "git_sha": "f4596fe0bdc096cf53ec4497e83defdb3a94ff62", - "installed_by": ["subworkflows"] - }, - "bam_stats_samtools": { - "branch": "master", - "git_sha": "f4596fe0bdc096cf53ec4497e83defdb3a94ff62", - "installed_by": ["bam_markduplicates_picard"] - } - } } } } diff --git a/subworkflows/nf-core/bam_markduplicates_picard/main.nf b/subworkflows/local/cram_markduplicates_picard/main.nf similarity index 67% rename from subworkflows/nf-core/bam_markduplicates_picard/main.nf rename to subworkflows/local/cram_markduplicates_picard/main.nf index 732ee56..86e5850 100644 --- a/subworkflows/nf-core/bam_markduplicates_picard/main.nf +++ b/subworkflows/local/cram_markduplicates_picard/main.nf @@ -4,9 +4,9 @@ include { PICARD_MARKDUPLICATES } from '../../../modules/nf-core/picard/markduplicates/main' include { SAMTOOLS_INDEX } from '../../../modules/nf-core/samtools/index/main' -include { BAM_STATS_SAMTOOLS } from '../bam_stats_samtools/main' +include { CRAM_STATS_SAMTOOLS } from '../cram_stats_samtools/main' -workflow BAM_MARKDUPLICATES_PICARD { +workflow CRAM_MARKDUPLICATES_PICARD { take: ch_cram // channel: [ val(meta), path(cram) ] @@ -31,19 +31,19 @@ workflow BAM_MARKDUPLICATES_PICARD { else [ meta, cram, csi ] } - BAM_STATS_SAMTOOLS ( ch_cram_crai, ch_fasta ) - ch_versions = ch_versions.mix(BAM_STATS_SAMTOOLS.out.versions) + CRAM_STATS_SAMTOOLS ( ch_cram_crai, ch_fasta ) + ch_versions = ch_versions.mix(CRAM_STATS_SAMTOOLS.out.versions) emit: cram = PICARD_MARKDUPLICATES.out.cram // channel: [ val(meta), path(cram) ] metrics = PICARD_MARKDUPLICATES.out.metrics // channel: [ val(meta), path(cram) ] - crai = SAMTOOLS_INDEX.out.crai // channel: [ val(meta), path(crai) ] + crai = SAMTOOLS_INDEX.out.crai // channel: [ val(meta), path(crai) ] csi = SAMTOOLS_INDEX.out.csi // channel: [ val(meta), path(csi) ] - stats = BAM_STATS_SAMTOOLS.out.stats // channel: [ val(meta), path(stats) ] - flagstat = BAM_STATS_SAMTOOLS.out.flagstat // channel: [ val(meta), path(flagstat) ] - idxstats = BAM_STATS_SAMTOOLS.out.idxstats // channel: [ val(meta), path(idxstats) ] - coverage = BAM_STATS_SAMTOOLS.out.coverage // channel: [ val(meta), path(coverage) ] + stats = CRAM_STATS_SAMTOOLS.out.stats // channel: [ val(meta), path(stats) ] + flagstat = CRAM_STATS_SAMTOOLS.out.flagstat // channel: [ val(meta), path(flagstat) ] + idxstats = CRAM_STATS_SAMTOOLS.out.idxstats // channel: [ val(meta), path(idxstats) ] + coverage = CRAM_STATS_SAMTOOLS.out.coverage // channel: [ val(meta), path(coverage) ] versions = ch_versions // channel: [ versions.yml ] } diff --git a/subworkflows/nf-core/bam_markduplicates_picard/meta.yml b/subworkflows/local/cram_markduplicates_picard/meta.yml similarity index 96% rename from subworkflows/nf-core/bam_markduplicates_picard/meta.yml rename to subworkflows/local/cram_markduplicates_picard/meta.yml index fe63068..998e751 100644 --- a/subworkflows/nf-core/bam_markduplicates_picard/meta.yml +++ b/subworkflows/local/cram_markduplicates_picard/meta.yml @@ -1,5 +1,5 @@ # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json -name: "bam_markduplicates_picard" +name: "cram_markduplicates_picard" description: Picard MarkDuplicates, index BAM file and run samtools stats, flagstat and idxstats keywords: - markduplicates @@ -12,7 +12,7 @@ components: - samtools/stats - samtools/idxstats - samtools/flagstat - - bam_stats_samtools + - cram_stats_samtools input: - ch_bam: description: | diff --git a/subworkflows/nf-core/bam_markduplicates_picard/tests/main.nf.test b/subworkflows/local/cram_markduplicates_picard/tests/main.nf.test similarity index 92% rename from subworkflows/nf-core/bam_markduplicates_picard/tests/main.nf.test rename to subworkflows/local/cram_markduplicates_picard/tests/main.nf.test index d8d2429..59c1fe0 100644 --- a/subworkflows/nf-core/bam_markduplicates_picard/tests/main.nf.test +++ b/subworkflows/local/cram_markduplicates_picard/tests/main.nf.test @@ -1,17 +1,17 @@ nextflow_workflow { - name "Test Workflow BAM_MARKDUPLICATES_PICARD" + name "Test Workflow CRAM_MARKDUPLICATES_PICARD" script "../main.nf" - workflow "BAM_MARKDUPLICATES_PICARD" + workflow "CRAM_MARKDUPLICATES_PICARD" tag "picard" tag "picard/markduplicates" tag "subworkflows" tag "subworkflows_nfcore" - tag "bam_markduplicates_picard" - tag "subworkflows/bam_markduplicates_picard" - tag "subworkflows/bam_stats_samtools" - tag "bam_stats_samtools" + tag "cram_markduplicates_picard" + tag "subworkflows/cram_markduplicates_picard" + tag "subworkflows/cram_stats_samtools" + tag "cram_stats_samtools" tag "samtools" tag "samtools/flagstat" tag "samtools/idxstats" diff --git a/subworkflows/nf-core/bam_markduplicates_picard/tests/main.nf.test.snap b/subworkflows/local/cram_markduplicates_picard/tests/main.nf.test.snap similarity index 100% rename from subworkflows/nf-core/bam_markduplicates_picard/tests/main.nf.test.snap rename to subworkflows/local/cram_markduplicates_picard/tests/main.nf.test.snap diff --git a/subworkflows/local/cram_markduplicates_picard/tests/tags.yml b/subworkflows/local/cram_markduplicates_picard/tests/tags.yml new file mode 100644 index 0000000..53f9b67 --- /dev/null +++ b/subworkflows/local/cram_markduplicates_picard/tests/tags.yml @@ -0,0 +1,2 @@ +subworkflows/cram_markduplicates_picard: + - subworkflows/nf-core/cram_markduplicates_picard/** diff --git a/subworkflows/local/cram_stats_samtools/bam_stats_samtools/main.nf b/subworkflows/local/cram_stats_samtools/bam_stats_samtools/main.nf new file mode 100644 index 0000000..c00051e --- /dev/null +++ b/subworkflows/local/cram_stats_samtools/bam_stats_samtools/main.nf @@ -0,0 +1,37 @@ +CRAM_STATS_SAMTOOLS// +// Run SAMtools stats, flagstat and idxstats +// + +include { SAMTOOLS_STATS } from '../../../modules/nf-core/samtools/stats/main' +include { SAMTOOLS_IDXSTATS } from '../../../modules/nf-core/samtools/idxstats/main' +include { SAMTOOLS_FLAGSTAT } from '../../../modules/nf-core/samtools/flagstat/main' +include { SAMTOOLS_COVERAGE } from '../../../modules/nf-core/samtools/coverage/main' + +workflow CRAM_STATS_SAMTOOLS { + take: + ch_bam_crai // channel: [ val(meta), path(bam), path(crai) ] + ch_fasta // channel: [ val(meta), path(fasta) ] + + main: + ch_versions = Channel.empty() + + SAMTOOLS_STATS ( ch_bam_crai, ch_fasta ) + ch_versions = ch_versions.mix(SAMTOOLS_STATS.out.versions) + + SAMTOOLS_FLAGSTAT ( ch_bam_crai ) + ch_versions = ch_versions.mix(SAMTOOLS_FLAGSTAT.out.versions) + + SAMTOOLS_IDXSTATS ( ch_bam_crai ) + ch_versions = ch_versions.mix(SAMTOOLS_IDXSTATS.out.versions) + + SAMTOOLS_COVERAGE ( ch_bam_crai ) + ch_versions = ch_versions.mix(SAMTOOLS_COVERAGE.out.versions) + + emit: + stats = SAMTOOLS_STATS.out.stats // channel: [ val(meta), path(stats) ] + flagstat = SAMTOOLS_FLAGSTAT.out.flagstat // channel: [ val(meta), path(flagstat) ] + idxstats = SAMTOOLS_IDXSTATS.out.idxstats // channel: [ val(meta), path(idxstats) ] + coverage = SAMTOOLS_COVERAGE.out.coverage // channel: [ val(meta), path(coverage) ] + + versions = ch_versions // channel: [ path(versions.yml) ] +} diff --git a/subworkflows/nf-core/bam_stats_samtools/main.nf b/subworkflows/local/cram_stats_samtools/main.nf similarity index 97% rename from subworkflows/nf-core/bam_stats_samtools/main.nf rename to subworkflows/local/cram_stats_samtools/main.nf index bfd6730..199ff7c 100644 --- a/subworkflows/nf-core/bam_stats_samtools/main.nf +++ b/subworkflows/local/cram_stats_samtools/main.nf @@ -7,7 +7,7 @@ include { SAMTOOLS_IDXSTATS } from '../../../modules/nf-core/samtools/idxstats/m include { SAMTOOLS_FLAGSTAT } from '../../../modules/nf-core/samtools/flagstat/main' include { SAMTOOLS_COVERAGE } from '../../../modules/nf-core/samtools/coverage/main' -workflow BAM_STATS_SAMTOOLS { +workflow CRAM_STATS_SAMTOOLS { take: ch_bam_crai // channel: [ val(meta), path(bam), path(crai) ] ch_fasta // channel: [ val(meta), path(fasta) ] diff --git a/subworkflows/nf-core/bam_stats_samtools/meta.yml b/subworkflows/local/cram_stats_samtools/meta.yml similarity index 97% rename from subworkflows/nf-core/bam_stats_samtools/meta.yml rename to subworkflows/local/cram_stats_samtools/meta.yml index 809bf73..cfb2c46 100644 --- a/subworkflows/nf-core/bam_stats_samtools/meta.yml +++ b/subworkflows/local/cram_stats_samtools/meta.yml @@ -1,5 +1,5 @@ # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json -name: bam_stats_samtools +name: cram_stats_samtools description: Produces comprehensive statistics from SAM/BAM/CRAM file keywords: - statistics diff --git a/subworkflows/nf-core/bam_stats_samtools/tests/main.nf.test b/subworkflows/local/cram_stats_samtools/tests/main.nf.test similarity index 82% rename from subworkflows/nf-core/bam_stats_samtools/tests/main.nf.test rename to subworkflows/local/cram_stats_samtools/tests/main.nf.test index c8b21f2..1921d02 100644 --- a/subworkflows/nf-core/bam_stats_samtools/tests/main.nf.test +++ b/subworkflows/local/cram_stats_samtools/tests/main.nf.test @@ -1,18 +1,18 @@ nextflow_workflow { - name "Test Workflow BAM_STATS_SAMTOOLS" + name "Test Workflow CRAM_STATS_SAMTOOLS" script "../main.nf" - workflow "BAM_STATS_SAMTOOLS" + workflow "CRAM_STATS_SAMTOOLS" tag "subworkflows" tag "subworkflows_nfcore" - tag "bam_stats_samtools" - tag "subworkflows/bam_stats_samtools" + tag "cram_stats_samtools" + tag "subworkflows/cram_stats_samtools" tag "samtools" tag "samtools/flagstat" tag "samtools/idxstats" tag "samtools/stats" - test("test_bam_stats_samtools_single_end") { + test("test_cram_stats_samtools_single_end") { when { params { @@ -36,14 +36,14 @@ nextflow_workflow { then { assertAll( { assert workflow.success}, - { assert snapshot(workflow.out.stats).match("test_bam_stats_samtools_single_end_stats") }, - { assert snapshot(workflow.out.flagstat).match("test_bam_stats_samtools_single_end_flagstats") }, - { assert snapshot(workflow.out.idxstats).match("test_bam_stats_samtools_single_end_idxstats") } + { assert snapshot(workflow.out.stats).match("test_cram_stats_samtools_single_end_stats") }, + { assert snapshot(workflow.out.flagstat).match("test_cram_stats_samtools_single_end_flagstats") }, + { assert snapshot(workflow.out.idxstats).match("test_cram_stats_samtools_single_end_idxstats") } ) } } - test("test_bam_stats_samtools_paired_end") { + test("test_cram_stats_samtools_paired_end") { when { params { @@ -67,14 +67,14 @@ nextflow_workflow { then { assertAll( { assert workflow.success }, - { assert snapshot(workflow.out.stats).match("test_bam_stats_samtools_paired_end_stats") }, - { assert snapshot(workflow.out.flagstat).match("test_bam_stats_samtools_paired_end_flagstats") }, - { assert snapshot(workflow.out.idxstats).match("test_bam_stats_samtools_paired_end_idxstats") } + { assert snapshot(workflow.out.stats).match("test_cram_stats_samtools_paired_end_stats") }, + { assert snapshot(workflow.out.flagstat).match("test_cram_stats_samtools_paired_end_flagstats") }, + { assert snapshot(workflow.out.idxstats).match("test_cram_stats_samtools_paired_end_idxstats") } ) } } - test("test_bam_stats_samtools_paired_end_cram") { + test("test_cram_stats_samtools_paired_end_cram") { when { params { @@ -98,9 +98,9 @@ nextflow_workflow { then { assertAll( { assert workflow.success}, - { assert snapshot(workflow.out.stats).match("test_bam_stats_samtools_paired_end_cram_stats") }, - { assert snapshot(workflow.out.flagstat).match("test_bam_stats_samtools_paired_end_cram_flagstats") }, - { assert snapshot(workflow.out.idxstats).match("test_bam_stats_samtools_paired_end_cram_idxstats") } + { assert snapshot(workflow.out.stats).match("test_cram_stats_samtools_paired_end_cram_stats") }, + { assert snapshot(workflow.out.flagstat).match("test_cram_stats_samtools_paired_end_cram_flagstats") }, + { assert snapshot(workflow.out.idxstats).match("test_cram_stats_samtools_paired_end_cram_idxstats") } ) } } diff --git a/subworkflows/nf-core/bam_stats_samtools/tests/main.nf.test.snap b/subworkflows/local/cram_stats_samtools/tests/main.nf.test.snap similarity index 89% rename from subworkflows/nf-core/bam_stats_samtools/tests/main.nf.test.snap rename to subworkflows/local/cram_stats_samtools/tests/main.nf.test.snap index bf0b0c6..88a9207 100644 --- a/subworkflows/nf-core/bam_stats_samtools/tests/main.nf.test.snap +++ b/subworkflows/local/cram_stats_samtools/tests/main.nf.test.snap @@ -1,5 +1,5 @@ { - "test_bam_stats_samtools_paired_end_cram_flagstats": { + "test_cram_stats_samtools_paired_end_cram_flagstats": { "content": [ [ [ @@ -17,7 +17,7 @@ }, "timestamp": "2023-11-06T09:31:26.194017574" }, - "test_bam_stats_samtools_paired_end_stats": { + "test_cram_stats_samtools_paired_end_stats": { "content": [ [ [ @@ -35,7 +35,7 @@ }, "timestamp": "2024-02-13T16:45:06.230091746" }, - "test_bam_stats_samtools_paired_end_flagstats": { + "test_cram_stats_samtools_paired_end_flagstats": { "content": [ [ [ @@ -53,7 +53,7 @@ }, "timestamp": "2024-01-18T17:17:27.717482" }, - "test_bam_stats_samtools_single_end_flagstats": { + "test_cram_stats_samtools_single_end_flagstats": { "content": [ [ [ @@ -71,7 +71,7 @@ }, "timestamp": "2023-11-06T09:26:10.340046381" }, - "test_bam_stats_samtools_paired_end_cram_idxstats": { + "test_cram_stats_samtools_paired_end_cram_idxstats": { "content": [ [ [ @@ -89,7 +89,7 @@ }, "timestamp": "2023-11-06T09:31:26.207052003" }, - "test_bam_stats_samtools_single_end_stats": { + "test_cram_stats_samtools_single_end_stats": { "content": [ [ [ @@ -107,7 +107,7 @@ }, "timestamp": "2024-02-13T16:44:57.442208382" }, - "test_bam_stats_samtools_paired_end_idxstats": { + "test_cram_stats_samtools_paired_end_idxstats": { "content": [ [ [ @@ -125,7 +125,7 @@ }, "timestamp": "2024-01-18T17:17:27.726719" }, - "test_bam_stats_samtools_single_end_idxstats": { + "test_cram_stats_samtools_single_end_idxstats": { "content": [ [ [ @@ -143,7 +143,7 @@ }, "timestamp": "2023-11-06T09:26:10.349439801" }, - "test_bam_stats_samtools_paired_end_cram_stats": { + "test_cram_stats_samtools_paired_end_cram_stats": { "content": [ [ [ @@ -161,4 +161,4 @@ }, "timestamp": "2024-02-13T16:45:14.997164209" } -} \ No newline at end of file +} diff --git a/subworkflows/local/cram_stats_samtools/tests/tags.yml b/subworkflows/local/cram_stats_samtools/tests/tags.yml new file mode 100644 index 0000000..e18e39e --- /dev/null +++ b/subworkflows/local/cram_stats_samtools/tests/tags.yml @@ -0,0 +1,2 @@ +subworkflows/cram_stats_samtools: + - subworkflows/nf-core/cram_stats_samtools/** diff --git a/subworkflows/nf-core/bam_markduplicates_picard/tests/tags.yml b/subworkflows/nf-core/bam_markduplicates_picard/tests/tags.yml deleted file mode 100644 index 10b8527..0000000 --- a/subworkflows/nf-core/bam_markduplicates_picard/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -subworkflows/bam_markduplicates_picard: - - subworkflows/nf-core/bam_markduplicates_picard/** diff --git a/subworkflows/nf-core/bam_stats_samtools/tests/tags.yml b/subworkflows/nf-core/bam_stats_samtools/tests/tags.yml deleted file mode 100644 index ec2f2d6..0000000 --- a/subworkflows/nf-core/bam_stats_samtools/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -subworkflows/bam_stats_samtools: - - subworkflows/nf-core/bam_stats_samtools/** diff --git a/workflows/resequencing-mem.nf b/workflows/resequencing-mem.nf index cb8e98a..cd11d5b 100644 --- a/workflows/resequencing-mem.nf +++ b/workflows/resequencing-mem.nf @@ -46,8 +46,7 @@ include { BCFTOOLS_NORM } from '../modules/nf-core/bcftools/ include { TABIX_TABIX } from '../modules/nf-core/tabix/tabix/main' include { BCFTOOLS_STATS } from '../modules/nf-core/bcftools/stats/main' include { CUSTOM_DUMPSOFTWAREVERSIONS } from '../modules/nf-core/custom/dumpsoftwareversions/main' -include { BAM_MARKDUPLICATES_PICARD } from '../subworkflows/nf-core/bam_markduplicates_picard/main' -include { BAM_STATS_SAMTOOLS } from '../subworkflows/nf-core/bam_stats_samtools/main' +include { CRAM_MARKDUPLICATES_PICARD } from '../subworkflows/local/cram_markduplicates_picard/main' // A workflow definition which does not declare any name is assumed to be the // main workflow and it’s implicitly executed. Therefore it’s the entry point @@ -144,12 +143,12 @@ workflow RESEQUENCING_MEM { ch_versions = ch_versions.mix(BWA_MEM.out.versions) // Perform Picard MarkDuplicates, index CRAM file and run samtools stats, flagstat and idxstats - BAM_MARKDUPLICATES_PICARD(BWA_MEM.out.cram, PREPARE_GENOME.out.genome_fasta, PREPARE_GENOME.out.genome_fasta_fai) - ch_versions = ch_versions.mix(BAM_MARKDUPLICATES_PICARD.out.versions) + CRAM_MARKDUPLICATES_PICARD(BWA_MEM.out.cram, PREPARE_GENOME.out.genome_fasta, PREPARE_GENOME.out.genome_fasta_fai) + ch_versions = ch_versions.mix(CRAM_MARKDUPLICATES_PICARD.out.versions) // prepare to call freebayes (multi) - get rid of meta.id - freebayes_input_cram = BAM_MARKDUPLICATES_PICARD.out.cram.map{ meta, cram -> [cram] }.collect().map{ it -> [[id: "all-samples"], it]} - freebayes_input_crai = BAM_MARKDUPLICATES_PICARD.out.crai.map{ meta, crai -> [crai] }.collect().map{ it -> [[id: "all-samples"], it]} + freebayes_input_cram = CRAM_MARKDUPLICATES_PICARD.out.cram.map{ meta, cram -> [cram] }.collect().map{ it -> [[id: "all-samples"], it]} + freebayes_input_crai = CRAM_MARKDUPLICATES_PICARD.out.crai.map{ meta, crai -> [crai] }.collect().map{ it -> [[id: "all-samples"], it]} // call freebayes paralle CRAM_FREEBAYES_PARALLEL( @@ -197,11 +196,11 @@ workflow RESEQUENCING_MEM { multiqc_input = FASTQC.out.html.map{it[1]}.ifEmpty([]) .concat(FASTQC.out.zip.map{it[1]}.ifEmpty([])) .concat(TRIMGALORE.out.log.map{it[1]}.ifEmpty([])) - .concat(BAM_MARKDUPLICATES_PICARD.out.metrics.map{it[1]}.ifEmpty([])) - .concat(BAM_MARKDUPLICATES_PICARD.out.stats.map{it[1]}.ifEmpty([])) - .concat(BAM_MARKDUPLICATES_PICARD.out.idxstats.map{it[1]}.ifEmpty([])) - .concat(BAM_MARKDUPLICATES_PICARD.out.flagstat.map{it[1]}.ifEmpty([])) - .concat(BAM_MARKDUPLICATES_PICARD.out.stats.map{it[1]}.ifEmpty([])) + .concat(CRAM_MARKDUPLICATES_PICARD.out.metrics.map{it[1]}.ifEmpty([])) + .concat(CRAM_MARKDUPLICATES_PICARD.out.stats.map{it[1]}.ifEmpty([])) + .concat(CRAM_MARKDUPLICATES_PICARD.out.idxstats.map{it[1]}.ifEmpty([])) + .concat(CRAM_MARKDUPLICATES_PICARD.out.flagstat.map{it[1]}.ifEmpty([])) + .concat(CRAM_MARKDUPLICATES_PICARD.out.stats.map{it[1]}.ifEmpty([])) .collect() // .view()