diff --git a/assets/multiqc_config.yml b/assets/multiqc_config.yml index 942f95e5b..1eff688fc 100644 --- a/assets/multiqc_config.yml +++ b/assets/multiqc_config.yml @@ -66,7 +66,38 @@ sample_names_replace: "\\.[0-9]{4}$": ".md" # should match ".0001" but only at the end of strings for module Markduplicates/EstimateLibraryComplexity module: picard +custom_data: + dedup_metrics: + id: "dedup_metrics" + section_name: "Sentieon Dedup Metrics" + plot_type: "table" + pconfig: + id: "dedup_metrics" + namespace: "Sentieon Dedup Metrics" + headers: + LIBRARY: + description: "LIBRARY" + UNPAIRED_READS_EXAMINED: + description: "UNPAIRED_READS_EXAMINE" + READ_PAIRS_EXAMINED: + description: "READ_PAIRS_EXAMINED" + SECONDARY_OR_SUPPLEMENTARY_RDS: + description: "SECONDARY_OR_SUPPLEMENTARY_RDS" + UNMAPPED_READS: + description: "UNMAPPED_READS" + UNPAIRED_READ_DUPLICATES: + description: "UNPAIRED_READ_DUPLICATES" + READ_PAIR_DUPLICATES: + description: "READ_PAIR_DUPLICATES" + READ_PAIR_OPTICAL_DUPLICATES: + description: "READ_PAIR_OPTICAL_DUPLICATES" + PERCENT_DUPLICATION: + description: "PERCENT_DUPLICATION" + ESTIMATED_LIBRARY_SIZE: + description: "ESTIMATED_LIBRARY_SIZE" sp: snpeff: contents: "SnpEff_version" max_filesize: 5000000 + dedup_metrics: + fn: "*.metrics.multiqc.tsv" diff --git a/conf/modules/sentieon_dedup.config b/conf/modules/sentieon_dedup.config index 891c2acd6..6f5531cb4 100644 --- a/conf/modules/sentieon_dedup.config +++ b/conf/modules/sentieon_dedup.config @@ -28,7 +28,7 @@ process { [ mode: params.publish_dir_mode, path: { "${params.outdir}/reports/" }, - pattern: "*metrics", + pattern: "*{metrics,metrics.multiqc.tsv}", saveAs: { !(params.skip_tools && params.skip_tools.split(',').contains('sentieon_dedup_report')) ? "sentieon_dedup/${meta.id}/${it}" : null} ] ] diff --git a/modules.json b/modules.json index 755c99b08..a865ad0df 100644 --- a/modules.json +++ b/modules.json @@ -383,7 +383,7 @@ }, "sentieon/dedup": { "branch": "master", - "git_sha": "2cb2012b268b3502ac74463e510e76be99e2cdbf", + "git_sha": "e311732e4d878d7e47872226bef5f8630dc81675", "installed_by": ["modules"] }, "sentieon/gvcftyper": { diff --git a/modules/nf-core/sentieon/dedup/main.nf b/modules/nf-core/sentieon/dedup/main.nf index def50e248..7f6d1ce73 100644 --- a/modules/nf-core/sentieon/dedup/main.nf +++ b/modules/nf-core/sentieon/dedup/main.nf @@ -24,6 +24,7 @@ process SENTIEON_DEDUP { tuple val(meta), path("*.bai"), emit: bai tuple val(meta), path("*.score"), emit: score tuple val(meta), path("*.metrics"), emit: metrics + tuple val(meta), path("*.metrics.multiqc.tsv"), emit: metrics_multiqc_tsv path "versions.yml", emit: versions when: @@ -60,6 +61,9 @@ process SENTIEON_DEDUP { sentieon driver $args $input_list -r ${fasta} --algo LocusCollector $args2 --fun score_info ${prefix}.score sentieon driver $args3 -t $task.cpus $input_list -r ${fasta} --algo Dedup $args4 --score_info ${prefix}.score --metrics ${metrics} ${prefix}${suffix} + # This following tsv-file is produced in order to get a proper tsv-file with Dedup-metrics for importing in MultiQC as "custom content". + # It should be removed once MultiQC has a module for displaying Dedup-metrics. + head -3 ${metrics} > ${metrics}.multiqc.tsv cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/sentieon/dedup/meta.yml b/modules/nf-core/sentieon/dedup/meta.yml index 37ca9c67d..6813d663b 100644 --- a/modules/nf-core/sentieon/dedup/meta.yml +++ b/modules/nf-core/sentieon/dedup/meta.yml @@ -64,8 +64,12 @@ output: pattern: "*.score" - metrics: type: file - description: Output file containing the metrics data from Dedup. + description: Output file containing Dedup metrics incl. histogram data. pattern: "*.metrics" + - metrics_multiqc_tsv: + type: file + description: Output tsv-file containing Dedup metrics excl. histogram data. + pattern: "*.metrics.multiqc.tsv" - versions: type: file description: File containing software versions diff --git a/subworkflows/local/bam_sentieon_dedup/main.nf b/subworkflows/local/bam_sentieon_dedup/main.nf index 72d7f0408..bb0d8b5d5 100644 --- a/subworkflows/local/bam_sentieon_dedup/main.nf +++ b/subworkflows/local/bam_sentieon_dedup/main.nf @@ -34,6 +34,7 @@ workflow BAM_SENTIEON_DEDUP { // Gather all reports generated reports = reports.mix(SENTIEON_DEDUP.out.metrics) + reports = reports.mix(SENTIEON_DEDUP.out.metrics_multiqc_tsv) reports = reports.mix(SENTIEON_DEDUP.out.score) reports = reports.mix(CRAM_QC_MOSDEPTH_SAMTOOLS.out.reports) diff --git a/tests/test_sentieon_dedup_from_bam.yml b/tests/test_sentieon_dedup_from_bam.yml index ba1ce42a5..f23d9f00a 100644 --- a/tests/test_sentieon_dedup_from_bam.yml +++ b/tests/test_sentieon_dedup_from_bam.yml @@ -13,6 +13,8 @@ - path: results/csv/recalibrated.csv md5sum: 1888a924bc70bd80165a96ad641e22d6 - path: results/multiqc + - path: results/multiqc/multiqc_report.html + contains: ["Sentieon Dedup Metrics", "PERCENT_DUPLICATION", "ESTIMATED_LIBRARY_SIZE"] - path: results/preprocessing/sentieon_dedup/test/test.md.cram # binary changes md5sums on reruns - path: results/preprocessing/sentieon_dedup/test/test.md.cram.crai diff --git a/tests/test_sentieon_dedup_from_cram.yml b/tests/test_sentieon_dedup_from_cram.yml index 3d85f8363..7a576cbc6 100644 --- a/tests/test_sentieon_dedup_from_cram.yml +++ b/tests/test_sentieon_dedup_from_cram.yml @@ -13,6 +13,8 @@ - path: results/csv/recalibrated.csv md5sum: 1888a924bc70bd80165a96ad641e22d6 - path: results/multiqc + - path: results/multiqc/multiqc_report.html + contains: ["Sentieon Dedup Metrics", "PERCENT_DUPLICATION", "ESTIMATED_LIBRARY_SIZE"] - path: results/preprocessing/sentieon_dedup/test/test.md.cram # binary changes md5sums on reruns - path: results/preprocessing/sentieon_dedup/test/test.md.cram.crai