NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

NanoSpring: reference-free lossless compression of nanopore sequencing reads using an approximate assembly approach

Qingxi Meng, Shubham Chandak, Yifan Zhu, Tsachy WeissmanbioRxiv 2021

Abstract

The amount of data produced by genome sequencing experiments has been growing rapidly over the past several years, making compression important for efficient storage, transfer and analysis of the data. In recent years, nanopore sequencing technologies have seen increasing adoption since they are portable, real-time and provide long reads. However, there has been limited progress on compression of nanopore sequencing reads obtained in FASTQ files since most existing tools are either general-purpose or specialized for short read data. We present NanoSpring, a reference-free compressor for nanopore sequencing reads, relying on an approximate assembly approach. We evaluate NanoSpring on a variety of datasets including bacterial, metagenomic, plant, animal, and human whole genome data. For recently basecalled high quality nanopore datasets, NanoSpring, which focuses only on the base sequences in the FASTQ file, uses just 0.35-0.65 bits per base which is 3-6x lower than general purpose compressors like gzip. NanoSpring is competitive in compression ratio and compression resource usage with the state-of-the-art tool CoLoRd while being significantly faster at decompression.

Introduction

The field of genomics is currently facing a data explosion. As Oxford Nanopore Technologies (ONT) becomes more prevalent due to its portability and "long read" capabilities, the storage requirements for FASTQ files have grown exponentially. Traditional compression tools like gzip are general-purpose and fail to exploit the biological redundancy inherent in DNA. Furthermore, specialized compressors for short-read data (e.g., Illumina) are unsuitable for nanopore reads due to their extreme length and higher error rates, including frequent insertions and deletions. While reference-based compressors exist, they require a known genome, which is often unavailable in metagenomics or de novo sequencing. NanoSpring addresses these challenges by providing a high-performance, reference-free solution using an approximate assembly strategy.

Methods

NanoSpring’s core innovation is its approximate assembly approach, which builds a consensus sequence on the fly without an external reference. The process involves several key stages:

  1. MinHash Indexing: Rapidly identifies overlapping reads, remaining robust against high error rates.
  2. Consensus Graphs: Reads are organized into a directed acyclic graph (DAG). The algorithm identifies the "heaviest" path to determine a consensus sequence for a group of reads (a contig).
  3. Delta Encoding: Instead of storing full reads, NanoSpring stores the consensus sequence once. For individual reads, it records only the "errors" relative to that consensus—such as start positions, substitutions, and indels.
  4. Stream Compression: Data types (consensus, error positions, error bases) are separated into distinct streams and further compressed using specialized tools like LZMA2 or BSC.
Figure 1: Graph-based representation of consensus and read errors (substitutions, deletions, and insertions) used for delta encoding.

Results and Discussion

NanoSpring was evaluated across a diverse range of organisms, including bacteria (S. aureus), metagenomic standards (Zymo), plants (Banana), and human datasets (NA12878, CHM13).

Compression Performance

On high-quality human datasets, NanoSpring achieves a compression ratio of 0.35 to 0.65 bits per base. This represents a 3-6x improvement over standard gzip (which typically requires ~2.2 bits per base). For an 84 GB human dataset, NanoSpring reduced the sequence data to less than 7 GB. The tool also demonstrates a "virtuous cycle": as basecalling accuracy improves, NanoSpring becomes even more effective because fewer errors need to be stored relative to the consensus.

Figure 4: Contribution to total compressed size in bits per base across various datasets, highlighting the efficiency of the consensus-based approach.

Efficiency and Scalability

NanoSpring is designed for practical use, prioritizing fast decompression to allow researchers to quickly retrieve data for analysis. It is significantly faster at decompression than its closest assembly-based competitor, CoLoRd. Additionally, the compression ratio improves with sequencing depth (coverage), as the fixed cost of the consensus sequence is amortized over a larger number of reads.

Conclusion

NanoSpring provides a state-of-the-art solution for the lossless compression of nanopore nucleotide sequences. While currently focused on DNA sequences, future iterations aim to integrate quality score and read identifier compression to provide a comprehensive FASTQ storage solution. By leveraging biological redundancy through approximate assembly, NanoSpring makes the storage and transfer of massive genomic datasets significantly more manageable.

Summary updated

BibTeX
@misc{meng2021nanospring,
  author = {Qingxi Meng and Shubham Chandak and Yifan Zhu and Tsachy Weissman},
  title = {{NanoSpring: reference-free lossless compression of nanopore sequencing reads using an approximate assembly approach}},
  year = {2021},
  doi = {10.1101/2021.06.09.447198},
  howpublished = {bioRxiv},
}
Figure