EnzymeRanker-X
EnzymeRanker-X is a sequence-based enzyme classification system that predicts Enzyme Commission (EC) numbers from protein amino acid sequences.
The system uses MMseqs2 for sequence similarity search against a reference database built from the training dataset. The EC annotations associated with the best-matching reference sequence are used to generate the final prediction.
Method
The prediction pipeline consists of three main stages:
- Reference database construction: Training sequences are grouped by exact sequence identity, and their associated EC annotations are stored.
- Sequence retrieval: Input protein sequences are searched against the reference database using MMseqs2.
- EC prediction: The best matching reference sequence is selected, and one EC number is assigned to the query.
For sequences without a database match, the system uses a global frequency-based fallback prediction.
Repository Structure
EnzymeRanker-X/
βββ assets/
β βββ annotations.json
β βββ ec_vocabulary.json
β βββ label_counts.json
β βββ model_metadata.json
β βββ targetDB*
βββ Dockerfile
βββ predict.py
βββ train_submission.py
βββ requirements.txt
βββ README.md
The assets/ directory contains the generated reference database and annotation files required for inference.
Requirements
- Python 3.11
- MMseqs2
- Docker
- Git LFS (for downloading the large database files)
Building the Reference Database
The reference database can be generated from the training dataset using:
brew install mmseqs2
python train_submission.py \
--train data/raw/train.parquet \
--output assets \
--threads 4
This generates the MMseqs2 database, EC annotation mappings, vocabulary, and label-frequency metadata.
The generated assets/ directory must be present when building the Docker image.
Building the Docker Image
Build the image for the competition's Linux x86-64 environment:
docker build --platform linux/amd64 -t enzymeranker-x .
Running Predictions
The prediction script accepts a Parquet file containing id and sequence columns and writes predictions in JSONL format.
Example:
mkdir -p output
docker run --rm \
--platform linux/amd64 \
--network none \
--cpus 2 \
--memory 16g \
-v "$PWD/data:/input:ro" \
-v "$PWD/output:/output" \
enzymeranker-x \
python /app/predict.py \
--input /input/val_inputs.parquet \
--output /output/predictions.jsonl
Adjust the input volume mount if the Parquet file is stored elsewhere.
Input and Output Format
Input β Parquet
| Column | Description |
|---|---|
id |
Unique protein identifier |
sequence |
Amino acid sequence |
Output β JSONL
Each output line contains the identifier and its predicted EC number:
{"id": "protein_001", "prediction": ["3.2.2.6"]}
The inference pipeline retains the first identifier for each exact duplicate sequence and produces one top-1 EC prediction per unique sequence.
Inference Constraints
- No network access is required during inference.
- Predictions are generated using the packaged reference database.
- Temporary inference files are stored under
/tmp. - The prediction output contains one record per unique input sequence.
- Each prediction contains one EC number.