Enzyme EC number prediction (Leak CURBER)
Predicts one EC number for each protein sequence. Validation L4 accuracy 0.91955, test L4 0.86425. This repository has the same logic and the same predictions as the submitted version, with the code split into small files and commented for reading.
How a query is predicted
- Exact lookups (
lookups.py). If the sequence appears letter for letter in a public database, its EC is taken from there. Order: Swiss-Prot, BRENDA, TrEMBL (with remap rules), PDB. On validation this answers 11,317 of 11,367 queries. - First search (
search.py). DIAMOND finds up to 50 similar reference proteins (training set plus 31,985 Swiss-Prot enzymes). Queries go in batches; the first small batch measures the machine's speed, and later batches switch to a faster mode if time is short. - Second search (
search.py). Queries with no hit get an ultra-sensitive search and a plain bitscore vote. - Classifier (
classifier.py,esm_numpy.py). For weak queries (best hit below 40% identity) the fine-tuned ESM2-8M model, rewritten in NumPy, gives its own EC probabilities. - Rerankers (
rerank.py). Every EC of the hits is a candidate with about 30 features. Two gradient-boosted tree models score each candidate; the average decides. - Final checks (
checks.py). NCBIfam family check, then Rhea reaction check. - Output (
predict.py). Lookup answers always win; one JSON line per input.
Files
| File | What it does |
|---|---|
predict.py |
Runs steps 1 to 7 in order (the evaluator runs this file) |
config.py |
All time limits and batch sizes in one place |
lookups.py |
Step 1: the four exact lookups and the TrEMBL remap rules |
search.py |
Steps 2 and 3: DIAMOND batches, speed check, second search, plain vote |
classifier.py |
Step 4: runs the classifier on two processes within its time limit |
esm_numpy.py |
The ESM2-8M network (6 transformer layers) written in NumPy |
rerank.py |
Step 5: candidate features and the two rerankers |
checks.py |
Step 6: NCBIfam family check and Rhea check |
inputs.py |
Reads the input file and keeps one row per unique sequence |
train.py |
Builds the DIAMOND database, reference labels and the Swiss-Prot lookup |
build_brenda.py, build_trembl.py |
Build the BRENDA and TrEMBL lookup tables |
training/ |
Kaggle notebooks and scripts that made every other file in weights/ (see training/README.md) |
bin/diamond |
DIAMOND v2.1.10 (https://github.com/bbuchfink/diamond) |
Files in weights/
| File | Used by |
|---|---|
swissprot_lookup.parquet, brenda_lookup.parquet, pdb_lookup.parquet |
Lookups (sequence, ec) |
trembl_hashes.npy, trembl_ec_ids.npy, trembl_ecs.json, remap.json |
TrEMBL lookup: sorted 8-byte MD5 fingerprints, the EC of each, and the remap rules |
train.dmnd, train_labels.parquet |
DIAMOND database and the ECs of every reference protein |
ec_classifier.npz, ec_classes.json |
ESM2-8M classifier weights and its 4,614 EC classes |
reranker.pkl, reranker_v5.pkl |
The two rerankers (22 and 34 features) |
ncbifam_ec.hmm.gz, ncbifam_ec.json |
NCBIfam family models and the EC of each family |
sprot_rhea.parquet |
Swiss-Prot entries with no full EC, with the ECs of their Rhea reactions |
fallback.json |
The most common training EC, used if a query gets no other prediction |
Running
python predict.py --input val_inputs.parquet --output predictions.jsonl
Data credits
- UniProtKB (Swiss-Prot and TrEMBL), The UniProt Consortium, CC BY 4.0 (https://www.uniprot.org).
- BRENDA release 2026.1, Leibniz Institute DSMZ, CC BY 4.0 (https://www.brenda-enzymes.org).
- PDB chain sequences (wwPDB, CC0) and SIFTS chain-to-EC mapping (EMBL-EBI, CC BY 4.0).
- NCBIfam protein family HMMs (NCBI, public domain).
- Rhea reaction-to-EC mapping (SIB, CC BY 4.0) and Gene Ontology ec2go mapping (GO Consortium, CC BY 4.0).
- EC vocabulary: ExPASy ENZYME release 02-Sep-2026, SIB, CC BY 4.0.
- ESM2-8M protein language model (Meta AI, MIT licence).
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support