diff --git a/assets/pipeline_multiqc_config.yml b/assets/pipeline_multiqc_config.yml index 97e49f4..dee69fd 100644 --- a/assets/pipeline_multiqc_config.yml +++ b/assets/pipeline_multiqc_config.yml @@ -1,12 +1,12 @@ report_comment: > - This report has been generated by the anoronh4/forte + This report has been generated by the mskcc/forte analysis pipeline. report_section_order: - "anoronh4-forte-methods-description": + "mskcc-forte-methods-description": order: -1000 software_versions: order: -1001 - "anoronh4-forte-summary": + "mskcc-forte-summary": order: -1002 export_plots: true diff --git a/conf/modules.config b/conf/modules.config index c1d1161..9f17e2c 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -35,7 +35,13 @@ process { ] } - withName: '.*:QC:MULTIQC' { + withName: '.*:QC_DEDUP:MULTIQC_COLLECT' { + ext.args = { + [ + "--cl-config \"subtitle: 'Deduplicated Bam'\"", + "-n dedupbam_multiqc_report" + ].join(" ") + } publishDir = [ path: { "${params.outdir}/multiqc" }, mode: params.publish_dir_mode, @@ -43,6 +49,38 @@ process { ] } + withName: '.*:QC_DUP:MULTIQC_COLLECT' { + ext.args = { + [ + "--cl-config \"subtitle: 'Non-deduplicated Bam'\"", + "-n dupbam_multiqc_report" + ].join(" ") + } + publishDir = [ + path: { "${params.outdir}/multiqc" }, + mode: params.publish_dir_mode, + saveAs: { filename -> filename.equals('versions.yml') ? null : filename } + ] + } + + withName: '.*:QC_DEDUP:MULTIQC' { + ext.args = { + [ + "--cl-config \"subtitle: 'Deduplicated Bam'\"", + "-n dedupbam_multiqc_report" + ].join(" ") + } + } + + withName: '.*:QC_DUP:MULTIQC' { + ext.args = { + [ + "--cl-config \"subtitle: 'Non-deduplicated Bam'\"", + "-n dupbam_multiqc_report" + ].join(" ") + } + } + withName: SAMPLESHEET_CHECK { publishDir = [ path: { "${params.outdir}/pipeline_info" }, diff --git a/modules.json b/modules.json index f06ec66..f7321b0 100644 --- a/modules.json +++ b/modules.json @@ -48,7 +48,8 @@ "multiqc": { "branch": "master", "git_sha": "ee80d14721e76e2e079103b8dcd5d57129e584ba", - "installed_by": ["modules"] + "installed_by": ["modules"], + "patch": "modules/nf-core/multiqc/multiqc.diff" }, "picard/collecthsmetrics": { "branch": "master", diff --git a/modules/nf-core/multiqc/main.nf b/modules/nf-core/multiqc/main.nf index 4b60474..5fc35f0 100644 --- a/modules/nf-core/multiqc/main.nf +++ b/modules/nf-core/multiqc/main.nf @@ -7,7 +7,7 @@ process MULTIQC { 'quay.io/biocontainers/multiqc:1.14--pyhdfd78af_0' }" input: - path multiqc_files, stageAs: "?/*" + tuple val(meta), path(multiqc_files, stageAs: "?/*") path(multiqc_config) path(extra_multiqc_config) path(multiqc_logo) diff --git a/modules/nf-core/multiqc/meta.yml b/modules/nf-core/multiqc/meta.yml index ebc29b2..c25a1af 100644 --- a/modules/nf-core/multiqc/meta.yml +++ b/modules/nf-core/multiqc/meta.yml @@ -14,6 +14,11 @@ tools: licence: ["GPL-3.0-or-later"] input: + - meta: + type: map + description: | + Groovy Map containing meta information + e.g. [ id:'test' ] - multiqc_files: type: file description: | diff --git a/modules/nf-core/multiqc/multiqc.diff b/modules/nf-core/multiqc/multiqc.diff new file mode 100644 index 0000000..1645613 --- /dev/null +++ b/modules/nf-core/multiqc/multiqc.diff @@ -0,0 +1,30 @@ +Changes in module 'nf-core/multiqc' +--- modules/nf-core/multiqc/meta.yml ++++ modules/nf-core/multiqc/meta.yml +@@ -14,6 +14,12 @@ + licence: ["GPL-3.0-or-later"] + + input: ++ - meta: ++ type: ++ type: map ++ description: | ++ Groovy Map containing meta information ++ e.g. [ id:'test' ] + - multiqc_files: + type: file + description: | + +--- modules/nf-core/multiqc/main.nf ++++ modules/nf-core/multiqc/main.nf +@@ -7,7 +7,7 @@ + 'quay.io/biocontainers/multiqc:1.14--pyhdfd78af_0' }" + + input: +- path multiqc_files, stageAs: "?/*" ++ tuple val(meta), path(multiqc_files, stageAs: "?/*") + path(multiqc_config) + path(extra_multiqc_config) + path(multiqc_logo) + +************************************************************ diff --git a/subworkflows/local/qc.nf b/subworkflows/local/qc.nf index 71c1a42..bba118f 100644 --- a/subworkflows/local/qc.nf +++ b/subworkflows/local/qc.nf @@ -2,7 +2,10 @@ ch_multiqc_config = Channel.fromPath("$projectDir/assets/multiqc_config include { PICARD_COLLECTRNASEQMETRICS } from '../../modules/nf-core/picard/collectrnaseqmetrics/main' include { PICARD_COLLECTHSMETRICS } from '../../modules/nf-core/picard/collecthsmetrics/main' -include { MULTIQC } from '../../modules/nf-core/multiqc/main' +include { + MULTIQC ; + MULTIQC as MULTIQC_COLLECT +} from '../../modules/nf-core/multiqc/main' include { BAM_RSEQC } from '../nf-core/bam_rseqc/main' workflow QC { @@ -10,15 +13,13 @@ workflow QC { take: bam bai + multiqc_files refflat rrna_intervals rseqc_bed fai dict baits - fastp_json - htseq_counts - star_log_final main: fasta = params.fasta @@ -55,11 +56,9 @@ workflow QC { dict.map{ dict -> [[:],dict]} ) - multiqc_ch = PICARD_COLLECTRNASEQMETRICS.out.metrics - .mix(fastp_json) -<<<<<<< HEAD - .mix(star_log_final) - .mix(htseq_counts) + multiqc_files = multiqc_files + .mix(PICARD_COLLECTRNASEQMETRICS.out.metrics) + .mix(PICARD_COLLECTHSMETRICS.out.metrics) .mix(BAM_RSEQC.out.bamstat_txt) .mix(BAM_RSEQC.out.innerdistance_freq) .mix(BAM_RSEQC.out.inferexperiment_txt) @@ -68,14 +67,19 @@ workflow QC { .mix(BAM_RSEQC.out.readdistribution_txt) .mix(BAM_RSEQC.out.readduplication_pos_xls) .mix(BAM_RSEQC.out.tin_txt) -======= - .mix(PICARD_COLLECTHSMETRICS.out.metrics) ->>>>>>> develop - .map{meta, multiqc_files -> multiqc_files } - .collect() + .map{ meta, file -> + [meta.subMap(['sample']),file] + } MULTIQC( - multiqc_ch, + multiqc_files.groupTuple(by:[0]), + ch_multiqc_config.collect().ifEmpty([]), + [], + [] + ) + + MULTIQC_COLLECT( + multiqc_files.map{meta, multiqc_files -> multiqc_files}.collect().map{[[:],it]}, ch_multiqc_config.collect().ifEmpty([]), [], [] diff --git a/workflows/forte.nf b/workflows/forte.nf index 619cf09..89e1921 100644 --- a/workflows/forte.nf +++ b/workflows/forte.nf @@ -54,7 +54,10 @@ include { PREPROCESS_READS } from '../subworkflows/local/prepro include { ALIGN_READS } from '../subworkflows/local/align_reads' include { MERGE_READS } from '../subworkflows/local/merge_reads' include { MULTIQC } from '../modules/nf-core/multiqc/main' -include { QC } from '../subworkflows/local/qc' +include { + QC as QC_DUP ; + QC as QC_DEDUP +} from '../subworkflows/local/qc' include { QUANTIFICATION } from '../subworkflows/local/quantification' include { FUSION } from '../subworkflows/local/fusion' @@ -122,20 +125,34 @@ workflow FORTE { ) ch_versions = ch_versions.mix(FUSION.out.ch_versions) - QC( + QC_DEDUP( + ALIGN_READS.out.bam, + ALIGN_READS.out.bai, + PREPROCESS_READS.out.fastp_json + .mix(QUANTIFICATION.out.htseq_counts) + .mix(ALIGN_READS.out.star_log_final), + PREPARE_REFERENCES.out.refflat, + PREPARE_REFERENCES.out.rrna_interval_list, + PREPARE_REFERENCES.out.rseqc_bed, + PREPARE_REFERENCES.out.fasta_fai, + PREPARE_REFERENCES.out.fasta_dict, + BAIT_INPUTS.out.baits + ) + ch_versions = ch_versions.mix(QC_DEDUP.out.ch_versions) + + QC_DUP( ALIGN_READS.out.bam_withdup, ALIGN_READS.out.bai_withdup, + PREPROCESS_READS.out.fastp_json + .mix(QUANTIFICATION.out.htseq_counts) + .mix(ALIGN_READS.out.star_log_final), PREPARE_REFERENCES.out.refflat, PREPARE_REFERENCES.out.rrna_interval_list, - PREPARE_REFERENCES.out.rseqc_bed, - PREPARE_REFERENCES.out.fasta_fai, - PREPARE_REFERENCES.out.fasta_dict, - BAIT_INPUTS.out.baits, - PREPROCESS_READS.out.fastp_json, - QUANTIFICATION.out.htseq_counts, - ALIGN_READS.out.star_log_final + PREPARE_REFERENCES.out.rseqc_bed, + PREPARE_REFERENCES.out.fasta_fai, + PREPARE_REFERENCES.out.fasta_dict, + BAIT_INPUTS.out.baits ) - ch_versions = ch_versions.mix(QC.out.ch_versions) CUSTOM_DUMPSOFTWAREVERSIONS ( ch_versions.unique().collectFile(name: 'collated_versions.yml') @@ -155,10 +172,10 @@ workflow FORTE { ch_multiqc_files = ch_multiqc_files.mix(ch_methods_description.collectFile(name: 'methods_description_mqc.yaml')) ch_multiqc_files = ch_multiqc_files.mix(CUSTOM_DUMPSOFTWAREVERSIONS.out.mqc_yml.collect()) - ch_multiqc_files.collect() + ch_multiqc_files = ch_multiqc_files.collect().map{ files -> [[:], files] } MULTIQC ( - ch_multiqc_files.collect(), + ch_multiqc_files, ch_multiqc_config.collect().ifEmpty([]), ch_multiqc_custom_config.collect().ifEmpty([]), ch_multiqc_logo.collect().ifEmpty([])