# Replace-names

**URL:** <https://community.seqera.io/t/replace-names/2502>\
**Category:** Ask for help\
**Tags:** multiqc\
**Created:** [January 9, 2026, 1:47am UTC](https://community.seqera.io/t/replace-names/2502 "2026-01-09T01:47:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hanjiewu](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/hanjiewu/32/678_2.png) [@Hanjiewu](https://community.seqera.io/u/Hanjiewu)\
**Post date:** [January 9, 2026, 1:47am UTC](https://community.seqera.io/t/replace-names/2502/1 "2026-01-09T01:47:46Z")

</div>

In my MultiQC reports, the sample names have several different patterns due to different analyses. The patterns include barcodeXX, barcodeXX.reor\_consensus, and barcodeXX.reor\_consensus.fasta. I would like to use --replace-names to get rid of the suffixes, so I added the following code to my config file:

```auto
sample_names_replace_regex: true

sample_names_replace:

  "barcode(\\d{2})\\.reor_consensus(\\.fasta)?": "barcode\\1"

```

However, it did not remove the suffixes as expected. I need help, Thanks

---

<div class="post-metadata">

**Author:** ![ewels](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/ewels/32/1_2.png) [@ewels](https://community.seqera.io/u/ewels)\
**Post date:** [January 9, 2026, 8:43am UTC](https://community.seqera.io/t/replace-names/2502/2 "2026-01-09T08:43:40Z")

</div>

If it’s just suffixes, you don’t want to replace the names - you want to clean them.

> **[Sample name cleaning​ - Configuration | Seqera Docs](https://docs.seqera.io/multiqc/getting_started/config#sample-name-cleaning)**
>
> Whilst most MultiQC settings can be specified on the command line, MultiQC is also able to parse system-wide and personal config files. At run time, it collects the configuration settings from the following places in this order (overwriting at each...

In your case, your config should look something like this:

```yml
extra_fn_clean_exts:
  - ".reor_consensus"

```

That’ll match `.reor_consensus` anywhere in a sample name and remove it - _and anything after it_ (including the `.fasta`).

Hope that helps!

Phil

---

<div class="post-metadata">

**Author:** ![Hanjiewu](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/hanjiewu/32/678_2.png) [@Hanjiewu](https://community.seqera.io/u/Hanjiewu)\
**Post date:** [January 12, 2026, 12:59am UTC](https://community.seqera.io/t/replace-names/2502/3 "2026-01-12T00:59:24Z")

</div>

Dear ewels

Thank you for the reply, but it didn’t work for me.

I have tried

```auto
extra_fn_clean_exts:

  - ".reor_consensus"

```

and/or

```auto
extra_fn_clean_trim:

  - ".reor_consensus"

```

including the `--replace-names`, but nothing works.

From `multiqc --verbose`

it does register the pattern specified in the config, but somehow it doesn’t do the job as expected.

```auto
[2026-01-12 00:29:10] multiqc.config [DEBUG] Added to filename clean extensions: [['.reor_consensus']]
[2026-01-12 00:29:10] multiqc.config [DEBUG] Added to filename clean trimmings: [['.reor_consensus']]

```

here is one example, the CheckM2 report didn’t clean the file name: the name ends with .reor\_consensus, but even with the `extra_fn_clean_exts:` in the config, it still doesn’t cleanup the suffix.

```auto
[2026-01-12 00:29:34] multiqc.core.exec_modules [DEBUG] Running module: checkm2
[2026-01-12 00:29:34] multiqc.modules.checkm2.checkm2 [INFO] Found 16 reports
[2026-01-12 00:29:34] multiqc.report [DEBUG] Wrote data file multiqc_checkm2.txt
[2026-01-12 00:29:34] multiqc.report [DEBUG] Wrote data file multiqc_checkm2.json
[2026-01-12 00:29:34] multiqc.plots.table_object [DEBUG] Table key 'Additional_Notes' not found in data for 'checkm2-first-table'. Skipping. Check for possible typos between data keys and header keys
[2026-01-12 00:29:34] multiqc.plots.plot [DEBUG] merge_with_previous for checkm2-first-table: found old_data = False
[2026-01-12 00:29:34] multiqc.plots.plot [DEBUG] merge_with_previous for checkm2-first-table: no old data or empty, using new data only
[2026-01-12 00:29:34] multiqc.core.software_versions [DEBUG] Reading software versions from config.software_versions
[2026-01-12 00:29:34] multiqc.core.software_versions [DEBUG] Reading software versions settings from: pipeline_info/bacteria_mqc_versions.yaml

```

By the way, the multiqc version is V1.33

---

<div class="post-metadata">

**Author:** ![ewels](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/ewels/32/1_2.png) [@ewels](https://community.seqera.io/u/ewels)\
**Post date:** [January 12, 2026, 10:07am UTC](https://community.seqera.io/t/replace-names/2502/4 "2026-01-12T10:07:39Z")

</div>

Ah, you’re not doing anything wrong. It looks like these modules are incorrectly not using the `self.clean_s_name()` function from MultiQC which does this sample name cleaning.

I’ve just opened a PR to address this:

> <https://github.com/MultiQC/MultiQC/pull/3464>
>
> \## Summary
> \- Both CheckM and CheckM2 modules were not calling \`clean\_s\_name()\` o…n sample names extracted from file content
> \- This meant config options like \`extra\_fn\_clean\_exts\` had no effect on sample names in these modules
> \- Added the missing \`self.clean\_s\_name()\` calls to properly clean sample names
> 
> \## Test plan
> \- \[\] Run MultiQC with CheckM/CheckM2 output files
> \- \[\] Verify that \`extra\_fn\_clean\_exts\` config option now works correctly for these modules
> \- \[\] Confirm sample names are properly cleaned according to configured patterns
> 
> Fixes https://community.seqera.io/t/replace-names/2502/3
> 
> 🤖 Generated with \[Claude Code\](https://claude.com/claude-code)

Once that is merged and released, it should work. You can try installing from this dev branch to test locally in the mean time:

```bash
pip install git+https://github.com/MultiQC/MultiQC.git@musing-beaver

```

Thanks for checking, hopefully this should do the job. Let me know how you get on!

---

<div class="post-metadata">

**Author:** ![Hanjiewu](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/hanjiewu/32/678_2.png) [@Hanjiewu](https://community.seqera.io/u/Hanjiewu)\
**Post date:** [January 13, 2026, 1:39am UTC](https://community.seqera.io/t/replace-names/2502/5 "2026-01-13T01:39:02Z")

</div>

Thank you ewels, One more thing, would this fix also apply to custom contents?

---

<div class="post-metadata">

**Author:** ![ewels](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/ewels/32/1_2.png) [@ewels](https://community.seqera.io/u/ewels)\
**Post date:** [January 15, 2026, 8:48am UTC](https://community.seqera.io/t/replace-names/2502/6 "2026-01-15T08:48:18Z")

</div>

Custom content should already be correctly applying the sample name cleaning, so that should already work 👍

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/system/32/2402_2.png) [@system](https://community.seqera.io/u/system)\
**Post date:** [January 22, 2026, 8:48am UTC](https://community.seqera.io/t/replace-names/2502/7 "2026-01-22T08:48:19Z")

</div>

Closed on January 22, 2026, 8:48am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
