Back to blog
Troubleshooting

RNA-Seq Read Length: Why Trimming Removes All Your Reads

By Abdullah Shahid · · 7 min read

A pipeline run fails at quantification with a message about an empty file. Quality control passed. Trimming reported success. Nothing looked wrong until the run stopped.

Almost always, the cause is read length. This post explains what read length is, how trimming filters interact with it, why a mismatch silently empties your FASTQ files, and what to do about it.

What Read Length Actually Is

Every read in a FASTQ file is a string of bases. Its length is set by the sequencer during the run, not by your sample. A typical bulk RNA-seq run produces reads of 50, 75, 100, or 150 bp.

For paired-end data you get two files per sample, _1.fastq.gz and _2.fastq.gz. In standard bulk RNA-seq, both mates are the same length, because both are sequencing the same cDNA fragment from opposite ends. 100 bp and 100 bp. 150 bp and 150 bp.

You can check in one line:

Terminal window
zcat sample_1.fastq.gz | head -2 | tail -1 | wc -c
zcat sample_2.fastq.gz | head -2 | tail -1 | wc -c

If those two numbers are very different, stop and read the next section before running anything.

The Minimum Length Filter

Trimming tools such as fastp cut adapter sequence and low-quality tails off the ends of reads. After cutting, a read may be too short to map uniquely to a transcriptome — a 20 bp fragment matches too many places in the genome to be informative.

So every trimmer applies a minimum length filter and discards anything below it. The common default is 36 bp.

The critical detail for paired-end data: if one mate falls below the threshold, the entire pair is discarded. Mates are only useful together, so the trimmer cannot keep an orphan. This is correct behaviour, and it is also the mechanism that can quietly empty an entire dataset.

The Mismatch: Asymmetric Read Lengths

Consider a sample where read 1 is 27 bp and read 2 is 99 bp.

That is not bulk RNA-seq. It is the signature of single-cell or barcoded chemistry, most commonly 10x Genomics. In those protocols the two reads do different jobs:

  • Read 1 carries a cell barcode and a UMI — roughly 26–28 bp, and it contains no transcript sequence at all.
  • Read 2 carries the actual cDNA — 90–150 bp.

Run that through a bulk pipeline with a 36 bp minimum and the arithmetic is unforgiving. Every single read 1 is 27 bp, which is below 36. Every read 1 fails. Because one mate failing discards the pair, every pair is dropped. A sample with 60 million reads produces a trimmed file containing zero.

Uneven read lengths are the tell

If read 1 is dramatically shorter than read 2 — especially around 26–28 bp against 90 bp or more — the data is almost certainly single-cell, not bulk. A bulk differential expression pipeline cannot analyze it, no matter how the parameters are set.

Other read structures cause the same collapse:

  • Very short legacy reads. Some older archived studies used 25–35 bp single-end reads. These sit right at or below common trimming defaults.
  • Aggressive quality trimming on a poor run. If quality collapses mid-read across the whole flow cell, sliding-window trimming can cut most reads below the threshold.

Why You See That Specific Error

Here is the failure sequence, and why the error surfaces late:

  1. Quality control passes. QC measures base quality, adapter content, GC, and duplication. Q30 can be 92% — the bases genuinely are high quality. QC does not judge whether the library type fits the workflow.
  2. Trimming “succeeds”. The trimmer runs without crashing. It reports how many reads passed the filter. If that number is zero, it still exits normally and writes a valid, empty FASTQ file.
  3. Quantification fails. Salmon opens the trimmed file, finds zero bytes, and refuses to run:
ERROR: file [SRR_1.trimmed.fastq.gz] appears to be empty (i.e. it has size 0).
This is likely an error. Please re-run salmon with a corrected input file.

The error names the quantification step, but the cause is two steps upstream. That is what makes this failure confusing: the message points at the symptom, not the source.

A note on Salmon's version banner

Salmon output often starts with Version Server Response: Not Found. That line is harmless — Salmon pings a version-check server that is usually unreachable inside a container. It is never the reason a run failed. Look further down for a line starting with ERROR:.

What To Do About It

First, identify which case you are in. Compare the two mate lengths.

If read 1 is short and read 2 is long (barcoded/single-cell data): parameters cannot rescue this. Read 1 holds barcodes, not transcript sequence, so there is no bulk expression signal to recover. Lowering the minimum length only produces unmappable 27 bp fragments. Use a different study or dataset with standard bulk paired-end RNA-seq, or analyze the data with a single-cell pipeline built for it. If you are choosing between the two designs, see Bulk RNA-Seq vs Single-Cell: When To Use Each.

If both reads are short but symmetric (e.g. 30 bp and 30 bp): this is genuine bulk data with legacy read lengths. Lower the minimum length filter to roughly 25 bp and re-run. Expect a lower mapping rate; short reads are inherently more ambiguous.

If reads are normal length but trimming still removed most of them: your trimming settings are too aggressive for the run’s quality profile. Relax the quality threshold or the sliding-window settings rather than the length filter. Trimming Adapters: Trimmomatic and fastp Side by Side walks through what each parameter does.

Other Read-Level Issues Worth Checking

Read length is the most common silent failure, but a few others cause similar late-stage errors:

  • Mislabelled paired-end data. If _1 and _2 files hold unequal read counts, or one is truncated by an interrupted download, quantification fails on mismatched mates. Re-download and verify checksums.
  • Single-end data submitted as paired. Some archive records list two files that are actually technical replicates, not mates. Check the study’s library layout before importing.
  • Interleaved FASTQ. One file containing both mates alternating. Most pipelines expect two separate files and will misread this.
  • Wrong strandedness. This does not fail loudly — it produces a plausible-looking mapping rate with distorted counts. Salmon’s automatic library type detection (-l A) handles it in most cases.
  • Heavy rRNA contamination. Reads map, but a large fraction land on ribosomal RNA, leaving too few informative reads for reliable differential expression. Watch total mapping rate against the fraction assigned to protein-coding genes.

The Short Version

Trimming removes reads shorter than a minimum length. In paired-end data, one failing mate discards the pair. When read 1 is much shorter than read 2, the library is single-cell rather than bulk, and every pair is discarded — leaving an empty file that fails at quantification with an error naming the wrong step.

Check your two mate lengths before you run. If they are wildly uneven, the dataset is the problem, not the settings.

If you want to read more about what happens before this point, Raw Reads to Counts: The Bulk RNA-Seq Pipeline Explained covers the full path from FASTQ to a count matrix.

Further reading

Read another related post

View all posts