Skip to content

Conversation

@pinin4fjords
Copy link
Member

@pinin4fjords pinin4fjords commented Dec 10, 2025

Summary

  • Fixes MultiQC sample name corruption when multiple samples share the same FASTQ filename (in different directories)
  • Fixes QualiMap sample names showing .namesorted suffix in MultiQC
  • Moves _raw/_trimmed suffix handling to multiqc_config.yml using extra_fn_clean_exts with type: remove

Problem

When two samples have FASTQ files with the same filename (e.g., P30162_607.R1.fastq.gz in different directories), the name_replacement.txt file contained duplicate search patterns with different replacement values:

P30162_607	P30162_607_1
P30162_607	P30162_607_0.8X_1

This caused MultiQC to apply replacements incorrectly, corrupting sample names in the report.

Additionally, QualiMap results were showing .namesorted suffixes in sample names.

Solution

  1. Only add FASTQ-to-sample mappings when the FASTQ simpleName differs from the sample ID. When they match, no renaming is needed.
Sample FASTQ simpleName Action
P30162_607 P30162_607 Skip FASTQ mapping (names match)
P30162_607_0.8X P30162_607 Add mapping (names differ)
  1. Added .namesorted to extra_fn_clean_exts in multiqc_config.yml.

  2. Moved _raw/_trimmed suffix handling from main.nf to multiqc_config.yml using extra_fn_clean_exts with type: remove. This removes only the matched substring (not everything after it), preserving read numbers like _1/_2.

Test plan

  • Run pipeline with samples that share FASTQ filenames to verify correct MultiQC naming
  • Verify QualiMap sample names no longer show .namesorted suffix

Fixes #1657

🤖 Generated with Claude Code

When multiple samples share the same FASTQ filename (in different
directories), the MultiQC name replacement file would contain duplicate
search patterns with different replacement values, causing sample names
to be corrupted in the report.

This fix only adds FASTQ filename-based mappings when the FASTQ
simpleName differs from the sample ID, preventing duplicate entries
while still supporting renaming when FASTQ names differ from sample IDs.

Fixes #1657

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@pinin4fjords pinin4fjords linked an issue Dec 10, 2025 that may be closed by this pull request
@github-actions
Copy link

github-actions bot commented Dec 10, 2025

nf-core pipelines lint overall result: Passed ✅ ⚠️

Posted for pipeline commit 5a82e32

+| ✅ 285 tests passed       |+
#| ❔   8 tests were ignored |#
!| ❗   9 tests had warnings |!

❗ Test warnings:

  • files_exist - File not found: assets/multiqc_config.yml
  • pipeline_todos - TODO string in base.config: Check the defaults for all processes
  • pipeline_todos - TODO string in awsfulltest.yml: You can customise AWS full pipeline tests as required
  • pipeline_todos - TODO string in methods_description_template.yml: #Update the HTML below to your preferred methods description, e.g. add publication citation for this pipeline
  • pipeline_todos - TODO string in main.nf: Optionally add in-text citation tools to this list.
  • pipeline_todos - TODO string in main.nf: Optionally add bibliographic entries to this list.
  • pipeline_todos - TODO string in main.nf: Only uncomment below if logic in toolCitationText/toolBibliographyText has been filled!
  • pipeline_todos - TODO string in nextflow.config: Specify any additional parameters here
  • pipeline_if_empty_null - ifEmpty(null) found in /home/runner/work/rnaseq/rnaseq/subworkflows/local/prepare_genome/main.nf: _ versions = ch_versions.ifEmpty(null) // channel: [ versions.yml ]
    _

❔ Tests ignored:

✅ Tests passed:

Run details

  • nf-core/tools version 3.5.1
  • Run at 2025-12-11 15:43:14

pinin4fjords and others added 8 commits December 11, 2025 10:30
Plot export can be slower on ARM architecture, causing timeouts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Use tuple-based mappings and loop over suffixes to reduce code duplication.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Use extra_fn_clean_exts with type: remove to strip _raw/_trimmed
suffixes in MultiQC config instead of generating explicit mappings.
This simplifies the name replacement logic in main.nf.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@pinin4fjords
Copy link
Member Author

Thanks @maxulysse !

@pinin4fjords pinin4fjords merged commit a6d817c into dev Dec 11, 2025
250 of 280 checks passed
@pinin4fjords pinin4fjords deleted the fix/multiqc-sample-rename-collision branch December 11, 2025 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sample renaming in MultiQC report

3 participants