Janan Gawra
11/24/2025, 10:30 AM_PolyA:1 or _PolyA:2
• Sometimes adding a prefix like 1:A: or 2:A:
When umi_tools dedup tries to extract UMIs, it's seeing:
• Some UMIs: ATTTCTCAATTG (12 bp) ✅
• Some UMIs: TACATGGTCAAT_1:N:0:TCCACAACCGGT+ACCTTGGTGGTA_PolyA:2 (way longer!) ❌
suggestion from seqera AI:
Normal reads (12 bp UMI):
AV244713:AV2:2444401486:2:22103:3284:2407_ATTTCTCAATTG_1:N:0:TCAACAACCGGT+ACCTTGGTGGTA
^^^^^^^^^^^^
12 bp UMI
Problematic reads (UMI + extra PolyA tag):
2:A:AV244713:AV2:2444401486:1:20104:1411:0810_TACATGGTCAAT_1:N:0:TCCACAACCGGT+ACCTTGGTGGTA_PolyA:2
^^ ^^^^^^^^^^^^ ^^^^^^^^
Prefix! 12 bp UMI EXTRA TAG!
1:A:AV244713:AV2:2444401486:1:20704:2070:0037_AACAACTGTTTA_1:N:0:TCAACAACCGGT+ACCTTGGTGGTA_PolyA:1
^^ ^^^^^^^^^^^^ ^^^^^^^^
Prefix! 12 bp UMI EXTRA TAG!
The Problem
Cutadapt/Trim Galore is adding extra information to read names when it detects poly-A sequences:
• _PolyA:1 or _PolyA:2
• Sometimes adding a prefix like 1:A: or 2:A:
When umi_tools dedup tries to extract UMIs, it's seeing:
• Some UMIs: ATTTCTCAATTG (12 bp) ✅
• Some UMIs: TACATGGTCAAT_1:N:0:TCCACAACCGGT+ACCTTGGTGGTA_PolyA:2 (way longer!) ❌
This is why you get: AssertionError: not all umis are the same length(!): 7 - 31
The Solution
Tell umi_tools dedup to use a different separator and extract only the UMI part, ignoring the poly-A tags:
input: /home/csic/toa/jga/RNASEQ_DATA_ANALYSIS/seabass_epiboost_rnaseq/sample_names_3_sample.csv
fasta: /mnt/netapp2/Home_FT2/home/csic/toa/jga/RNASEQ_DATA_ANALYSIS/seabass_epiboost_rnaseq/genome/Dicentrarchus_labrax.dlabrax2021.dna.toplevel.fa
gtf: /mnt/netapp2/Home_FT2/home/csic/toa/jga/RNASEQ_DATA_ANALYSIS/seabass_epiboost_rnaseq/genome/Dicentrarchus_labrax.dlabrax2021.114.gtf
aligner: star_salmon
# UMI configuration
with_umi: *true*
umitools_extract_method: "string"
umitools_bc_pattern: "NNNNNNNNNNNN"
# Tell UMI-tools dedup to use underscore as separator and get UMI from correct position
umitools_dedup_stats: *true*
save_umi_intermeds: *true*
# CORALL V2 trimming - but DON'T use --polyA flag that adds tags
extra_trimgalore_args: "--clip_R2 9"
skip_markduplicates: *true*
outdir: /mnt/lustre/scratch/nlsas/home/csic/toa/jga/results_rna_seq_epiboost_seabass_CD_corallV2
Key change:
Removed --polyA from trim_galore_args because it's adding the _PolyA:X suffix that breaks UMI parsing.
Alternative: If you MUST trim poly-A
If poly-A trimming is critical, you need to add a parameter to tell umi_tools dedup to handle the modified read names:
input: /home/csic/toa/jga/RNASEQ_DATA_ANALYSIS/seabass_epiboost_rnaseq/sample_names_3_sample.csv
fasta: /mnt/netapp2/Home_FT2/home/csic/toa/jga/RNASEQ_DATA_ANALYSIS/seabass_epiboost_rnaseq/genome/Dicentrarchus_labrax.dlabrax2021.dna.toplevel.fa
gtf: /mnt/netapp2/Home_FT2/home/csic/toa/jga/RNASEQ_DATA_ANALYSIS/seabass_epiboost_rnaseq/genome/Dicentrarchus_labrax.dlabrax2021.114.gtf
aligner: star_salmon
# UMI configuration
with_umi: *true*
umitools_extract_method: "string"
umitools_bc_pattern: "NNNNNNNNNNNN"
# Use custom dedup args to handle poly-A tagged reads
umitools_dedup_stats: *true*
# CORALL V2 trimming with poly-A
extra_trimgalore_args: "--clip_R2 9 --polyA"
skip_markduplicates: *true*
outdir: /mnt/lustre/scratch/nlsas/home/csic/toa/jga/results_rna_seq_epiboost_seabass_CD_corallV2
But unfortunately, nf-core/rnaseq doesn't expose a parameter to pass custom args to umi_tools dedup.
Any Idea how to do this. do we need to modify the rnaseq tool to add an option like that?
Why the Cutadapt/Trim Galore is adding extra information to read names when it detects poly-A sequences??Thomas Danhorn
11/25/2025, 4:19 AMINFO: Mounting image with FUSE.
fusermount3: mount failed: Operation not permitted
WARNING: squashfuse mount failed, falling back to extraction: encountered error while trying to mount image "/scratch/...img" with FUSE at /scratch/...: exit status 1
INFO: Converting SIF file to temporary sandbox...
I would discuss that with your sysadmin. Maybe there is a different Singularity installation you can use or some setting/permission they can fix, because converting containers to sandbox is very inefficient and not how it is supposed to work.
• Lastly (this is the actual error you get), if Trimgalore really appends stuff to the read meta data that screws up your UMI detection, i would suggest not using it: --trimmer fastp might do the trick. 🤞