Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rename in the MultiQC report for samples without techreps #1341

Merged
merged 12 commits into from
Jul 15, 2024
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ Thank you to everyone else that has contributed by reporting bugs, enhancements
- [PR #1331](https://github.com/nf-core/rnaseq/pull/1331) - Adding stubs for local modules
- [PR #1334](https://github.com/nf-core/rnaseq/pull/1334) - Update all nf-core/modules and subworkflows with stubs
- [PR #1340](https://github.com/nf-core/rnaseq/pull/1340) - Remove out-of-date Azure specific guidance
- [PR #1341](https://github.com/nf-core/rnaseq/pull/1341) - Add wholesale rename in the MultiQC report

### Parameters

Expand Down
2 changes: 1 addition & 1 deletion modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
},
"multiqc": {
"branch": "master",
"git_sha": "45d482f013f7da8a3e050e855f04ada418d91c3c",
"git_sha": "b80f5fd12ff7c43938f424dd76392a2704fa2396",
"installed_by": ["modules"]
},
"picard/markduplicates": {
Expand Down
6 changes: 6 additions & 0 deletions modules/nf-core/multiqc/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions modules/nf-core/multiqc/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions modules/nf-core/multiqc/tests/main.nf.test

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions workflows/rnaseq/assets/multiqc/multiqc_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ report_section_order:

export_plots: true
disable_version_detection: true
sample_names_replace_exact: true

# Run only these modules
run_modules:
Expand Down
21 changes: 20 additions & 1 deletion workflows/rnaseq/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,7 @@ workflow RNASEQ {
// MODULE: MultiQC
//
ch_multiqc_report = Channel.empty()

if (!params.skip_multiqc) {
ch_multiqc_config = Channel.fromPath("$projectDir/workflows/rnaseq/assets/multiqc/multiqc_config.yml", checkIfExists: true)
ch_multiqc_custom_config = params.multiqc_config ? Channel.fromPath(params.multiqc_config) : Channel.empty()
Expand All @@ -866,11 +867,29 @@ workflow RNASEQ {
ch_multiqc_files = ch_multiqc_files.mix(ch_workflow_summary.collectFile(name: 'workflow_summary_mqc.yaml'))
ch_multiqc_files = ch_multiqc_files.mix(ch_collated_versions)

// Provide MultiQC with rename patterns to ensure it uses sample names
// for single-techrep samples not processed by CAT_FASTQ.

ch_name_replacements = ch_fastq.single
.map{ meta, reads ->
def name1 = file(reads[0]).simpleName + "\t" + meta.id + '_1'
if (reads[1] ){
def name2 = file(reads[1]).simpleName + "\t" + meta.id + '_2'
return [ name1, name2 ]
} else{
return name1
}
}
.flatten()
.collectFile(name: 'name_replacement.txt', newLine: true)

MULTIQC (
ch_multiqc_files.collect(),
ch_multiqc_config.toList(),
ch_multiqc_custom_config.toList(),
ch_multiqc_logo.toList()
ch_multiqc_logo.toList(),
ch_name_replacements,
[]
)
ch_multiqc_report = MULTIQC.out.report
}
Expand Down
Loading