Hi, I have a question related to the rnaseq using ...
# rnaseq
j
Hi, I have a question related to the rnaseq using it with the corall v2 mRNA kit. I need to add a regex to say where is the UMI. I am using a code like the down one, but I am getting the error below: (nextflow) [cstoajga@login209-18 seabass_epiboost_rnaseq]$ more nf-core_rnaseq_final_v3.sh #!/bin/bash #SBATCH -J V3_final_rnaseq_corallV2 #SBATCH -t 80000 #SBATCH -c 32 #SBATCH --mem-per-cpu=3952M #SBATCH -o rnaseq_corallV2_%j.out #SBATCH -e rnaseq_corallV2_%j.err ##SBATCH --mail-user=jkgtam@cid.csic.es ##SBATCH --mail-type=BEGIN,END,FAIL #--------------------------------------------------------------------------- # Lexogen CORALL RNA-Seq V2 library # Forward-strand reads with 12 nt UMI in R1 and 9 nt clip in R2. # Parameters derived from Lexogen manual (see corallV2_notes.md) #--------------------------------------------------------------------------- module --force purge module load cesga/2025 nextflow/25.04.6 echo "=== Job started on $(date) ===" echo "Running on node: $(hostname)" nextflow -version java -version singularity --version export NXF_SINGULARITY_CACHEDIR=$TMPDIR/singularity_cache #This is not being enforced: now set in $HOME/.nextflow/config.singularity #export NXF_SINGULARITY_RUNNER='singularity exec --no-fuse --containall' nextflow run nf-core/rnaseq -r 3.21.0 \ -profile singularity \ -params-file params_corall_v3.yaml \ -c $HOME/.nextflow/config.singularity \ -w $LUSTRE_NVME/workingdir_rna_seq_epiboost_seabass_samplev3 echo "=== Job finished on $(date) ===" (nextflow) [cstoajga@login209-18 seabass_epiboost_rnaseq]$ more params_corall_v2.yaml 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 with_umi: true umitools_extract_method: "regex" ## or string #umitools_bc_pattern: "^(?P<umi_1>.{12}).*" umitools_bc_pattern: "(?P<umi_1>.{10})(?P<discard_1>.{2})" #umitools_extract_method: "string" #umitools_bc_pattern: "NNNNNNNNNNNN" 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 because I am putting the --polyA in the param file. is putting polyA in the name of the read of the bam file. here how a bam file look like: AV244713AV2244440148621130232282910_TAGGTTGGCATA_1N0:TCAACAACCGGT+ACCTTGGTGGTA AV244713AV2244440148622080522580073_GAGTGGCGATAT_1N0:TCAACAACCGGT+ACCTTGGTGGTA AV244713AV2244440148622220207153417_GGGACACTGTAG_1N0:TCAACAACCGGT+ACCTTGGTGGTA AV244713AV2244440148621090512582433_CGCAGGCCCTAC_1N0:TCAACAACCGGT+ACCTTGGTGGTA 2🅰️AV244713AV2244440148612010414110810_TACATGGTCAAT_1N0TCCACAACCGGT+ACCTTGGTGGTA PolyA2 2🅰️AV244713AV2244440148612010414110810_TACATGGTCAAT_1N0TCCACAACCGGT+ACCTTGGTGGTA PolyA2 2🅰️AV244713AV2244440148612010414110810_TACATGGTCAAT_1N0TCCACAACCGGT+ACCTTGGTGGTA PolyA2 I am getting this problem: Command error: INFO: 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/2724747/singularity_cache/depot.galaxyproject.org-singularity-umi_tools-1.1.5--py39_ _hf95cd2a_0.img" with FUSE at /scratch/2724747/rootfs-18541205/root: exit status 1_ INFO: Converting SIF file to temporary sandbox... WARNING: While bind mounting '/scratch:/scratch': destination is already in the mount point list Traceback (most recent call last): _File "/usr/local/bin/umi_tools", line 11, in <module>_ sys.exit(main()) _File "/usr/local/lib/python3.9/site-packages/umi_tools/umi_tools.py", line 61, in main_ module.main(sys.argv) _File "/usr/local/lib/python3.9/site-packages/umi_tools/dedup.py", line 334, in main_ _reads, umis, umi_counts = processor(_ _File "/usr/local/lib/python3.9/site-packages/umi_tools/network.py", line 419, in __call___ clusters = self.UMIClusterer(counts, threshold) _File "/usr/local/lib/python3.9/site-packages/umi_tools/network.py", line 367, in __call___ _assert max(len_umis) == min(len_umis), (_ AssertionError: not all umis are the same length(!): 7 - 31 The Problem according the seqera AI 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!) ❌ 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??
t
You are running into a lot of problems, you may want to split the up into separate questions, if necessary. Some things that come to my mind: • You are using this with SLURM, but not in an efficient way -- you are submitting the entire pipeline (with potentially hundreds of processes, depending on your samples) as single gigantic job. It makes a lot more sense to have a simple (e.g. 1 CPU, 8 GB RAM) job that then farms out the processes to the cluster as individual SLURM jobs -- that is what Nextflow is for. To do that, you have to tell Nextflow about the system you are working with. See here for some tips on writing a config. • You have some issue with Singularity:
Copy code
INFO:    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. 🤞