DigestedRust

A high-performance Rust engine for building and searching databases of enzymatically digested proteins

Open source AGPL-3.0 Rust Python bindings

Overview

DigestedRust is a Rust implementation of DigestedProteinDB. It builds a peptide index from UniProtKB entries digested in silico and retrieves candidate peptides by precursor mass. We developed it for databases the size of the complete UniProtKB/TrEMBL release, where memory use and query time become the limiting factors.

The original Java implementation is still available and is sufficient for smaller databases and for testing. DigestedRust can be run from the command line, called from Python, or included in other software. The source code is available under the AGPL-3.0 licence on GitHub.

Main features

Mass-range search

Returns all peptides within a given precursor mass window, together with the UniProt accession and NCBI taxonomy ID of the source protein.

Custom databases

Indexes can be built for selected organisms or taxonomic groups, with a chosen enzyme, number of missed cleavages and peptide length range.

Out-of-core processing

The digest is not loaded into memory. The index is kept on disk in RocksDB, so memory use stays low even for TrEMBL-sized databases.

Command-line tools

The massq search tool and the database build steps run from the command line and can be used in scripts or HPC batch jobs.

Library use

The search core is a Rust library and can be integrated into other proteomics software or web services.

Python bindings (massq_py)

The massq_py module keeps the database open between queries, which avoids repeated start-up cost in web applications. The GIL is released during the scan, so queries can run in parallel threads.

Benchmark

The values below were measured on the largest database we have built so far, the complete UniProtKB/TrEMBL release 2026_01. Results for smaller databases will be added later.

Database and benchmark details
Database version UniProtKB/TrEMBL (Release 2026_01)
Taxonomic scope All organisms (no taxonomic restriction)
Scale 202.55 million proteins / 17.20 billion peptides
Digestion parameters Enzyme: Trypsin
Missed cleavages: up to 2
Peptide length: 6–50 amino acids
Query time approx. 150 ms average time per mass-range query
Disk size approx. 255 GB (Snappy/Zstd compression, 5-bit amino acid encoding)
Memory use approx. 316 MB peak RAM (out-of-core indexing)
Storage RocksDB key-value store

Example search

Search of the TrEMBL database for peptides with a monoisotopic mass between 1800.0000 and 1800.0002 Da.

DigestedRust — bash
user@proteomics-hpc:~$ massq 1800.0000 1800.0002 --db-path ./uniprot_trembl_db

#       Mass      Peptide             Accession   TaxID
1       1800.0001
                AGASCPICKKEIQLVIK   Q2HJ21      9913
                AGASCPICKKEIQLVIK   O15151      9606
                AVARMSVLSELCLPLAK   Q1WRS8      362948
                GGKGDLCIVLNVLLMQK   Q83NI2      218496
                GGKGDLCIVLNVLLMQK   Q83MZ4      203267
                GLMPLGITDEIRKMVK    A2RMH5      416870
                GLMPLGITDEIRKMVK    Q02XB8      272622
                ILMGASVGIPASSLCIIR  Q92275      5334
                KGQIVMTSDKPPKMLK    A0RLX8      360106
                KTMPLILSGVDVVAMAR   O49289      3702
                MIPMIVLATTNQNKVK    Q6AQD7      177439
                ... (1118 additional entries) ...

2       1800.0002
                VEEIYEDDEMNT        A0A1Y2ULM3  9606
                CHGWGGCHHIR         A0A8R8NSG9  10090
                ... (2394 additional entries) ...
... 
[SUCCESS] Found 239 peptides matching criteria.
Execution time: 469.129µs
user@proteomics-hpc:~$ _

Python usage (massq_py)

The database should be opened once, when the application starts, and the same object reused for all queries, so that the block cache stays in memory. Build instructions and an example Django integration are given in the README.

from massq_py import MassqDb

db = MassqDb(
    db_path="/path/to/db/rocksdb",
    block_cache_gb=8,
    with_taxonomy=True,
)

count = db.count_range(1000.0, 1001.0)
json_str = db.search_json(1000.0, 1001.0)
# [{"mass": 1000.1234, "peptide": "PEPTIDE", "accession": "P12345", "tax_id": 9606, "species": "Homo sapiens"}, ...]

Architecture and workflow

The diagram shows the two parts of the workflow. On the left is database construction: UniProtKB entries are digested in silico, and the resulting peptides are encoded and written to a RocksDB index. On the right is the search: an experimental precursor mass range is looked up in the index and the matching peptides are returned.

Phase 1: Database Construction (Build Workflow) Pre-Build Configuration Multi-Stage Optimization Phase 2: Mass-Based Search (Query Workflow) UniProtKB Data In Silico Digestion Engine RocksDB Index NCBI Taxonomy Selection (TaxID / Division) Enzyme Selection (Trypsin/Chymotrypsin) Digestion Parameters (Length 6-50aa, MC=2) Mass Discretization (4 Decimal Places) 5-bit Peptide Encoding Base36 Accession Serialization Experimental Mass Input (Mass + Tolerance) Search Engine (Rust Core) Output: Peptides + Accessions + TaxIDs Binary Search & Sequential Scan

Downloads

Binaries and Python wheels are available from GitHub Releases. Pre-built databases will be provided later.

Command-line tools

The massq search tool and the database build tools for Linux (x86_64, aarch64), macOS and Windows, and massq_py wheels for Python.

tar -xzf digested-rust-<version>-linux-x86_64.tar.gz
./digested-rust-<version>-linux-x86_64/massq --help
pip install massq_py-*.whl

Pre-built databases

Complete UniProtKB/TrEMBL 2026_01 digest (trypsin, up to 2 missed cleavages), approx. 255 GB.

Download links will be added here.

Java and Rust implementations

Both implementations are open source. They differ mainly in the database size they are intended for.

DigestedProteinDB (Java)
  • Original implementation
  • In silico digestion and mass search
  • Suitable for smaller databases and teaching
  • Easy to run for testing
Source code
DigestedRust (Rust)
  • Tested on the complete UniProtKB/TrEMBL (17.2 billion peptides)
  • Command-line tools for building and searching
  • Python bindings (massq_py)
  • Custom databases (organisms, enzyme, digestion parameters)
  • Suitable for HPC environments
Source code

Possible applications

  • preparation of large peptide databases for proteomics
  • reduction of the search space in metaproteomics
  • filtering of candidate peptides by precursor mass in DDA and DIA workflows
  • peptide indexing in proteomics core facilities
  • search back end for other proteomics software

Contact and contributions

Bug reports and suggestions can be submitted as GitHub issues, and pull requests are welcome. If you need a database built for a specific organism or set of parameters, or are interested in collaboration, please contact us by e-mail.

DigestedRust is released under the GNU AGPL-3.0 licence.