Skip to content

Commit e1b2ef7

Browse files
authored
Merge pull request #1341 from nf-core/rename_samples
Add rename in the MultiQC report for samples without techreps
2 parents 99fb7ef + f35f51b commit e1b2ef7

File tree

7 files changed

+48
-2
lines changed

7 files changed

+48
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ Thank you to everyone else that has contributed by reporting bugs, enhancements
102102
- [PR #1331](https://github.com/nf-core/rnaseq/pull/1331) - Adding stubs for local modules
103103
- [PR #1334](https://github.com/nf-core/rnaseq/pull/1334) - Update all nf-core/modules and subworkflows with stubs
104104
- [PR #1340](https://github.com/nf-core/rnaseq/pull/1340) - Remove out-of-date Azure specific guidance
105+
- [PR #1341](https://github.com/nf-core/rnaseq/pull/1341) - Add rename in the MultiQC report for samples without techreps
105106

106107
### Parameters
107108

modules.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
},
9393
"multiqc": {
9494
"branch": "master",
95-
"git_sha": "45d482f013f7da8a3e050e855f04ada418d91c3c",
95+
"git_sha": "b80f5fd12ff7c43938f424dd76392a2704fa2396",
9696
"installed_by": ["modules"]
9797
},
9898
"picard/markduplicates": {

modules/nf-core/multiqc/main.nf

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/nf-core/multiqc/meta.yml

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/nf-core/multiqc/tests/main.nf.test

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

workflows/rnaseq/assets/multiqc/multiqc_config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ report_section_order:
1010

1111
export_plots: true
1212
disable_version_detection: true
13+
sample_names_replace_exact: true
1314

1415
# Run only these modules
1516
run_modules:

workflows/rnaseq/main.nf

+20-1
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,7 @@ workflow RNASEQ {
857857
// MODULE: MultiQC
858858
//
859859
ch_multiqc_report = Channel.empty()
860+
860861
if (!params.skip_multiqc) {
861862
ch_multiqc_config = Channel.fromPath("$projectDir/workflows/rnaseq/assets/multiqc/multiqc_config.yml", checkIfExists: true)
862863
ch_multiqc_custom_config = params.multiqc_config ? Channel.fromPath(params.multiqc_config) : Channel.empty()
@@ -866,11 +867,29 @@ workflow RNASEQ {
866867
ch_multiqc_files = ch_multiqc_files.mix(ch_workflow_summary.collectFile(name: 'workflow_summary_mqc.yaml'))
867868
ch_multiqc_files = ch_multiqc_files.mix(ch_collated_versions)
868869

870+
// Provide MultiQC with rename patterns to ensure it uses sample names
871+
// for single-techrep samples not processed by CAT_FASTQ.
872+
873+
ch_name_replacements = ch_fastq.single
874+
.map{ meta, reads ->
875+
def name1 = file(reads[0]).simpleName + "\t" + meta.id + '_1'
876+
if (reads[1] ){
877+
def name2 = file(reads[1]).simpleName + "\t" + meta.id + '_2'
878+
return [ name1, name2 ]
879+
} else{
880+
return name1
881+
}
882+
}
883+
.flatten()
884+
.collectFile(name: 'name_replacement.txt', newLine: true)
885+
869886
MULTIQC (
870887
ch_multiqc_files.collect(),
871888
ch_multiqc_config.toList(),
872889
ch_multiqc_custom_config.toList(),
873-
ch_multiqc_logo.toList()
890+
ch_multiqc_logo.toList(),
891+
ch_name_replacements,
892+
[]
874893
)
875894
ch_multiqc_report = MULTIQC.out.report
876895
}

0 commit comments

Comments
 (0)