Skip to main content

ECRECer

ECRECer predicts and recommends Enzyme Commission (EC) numbers from protein FASTA sequences. It implements the hierarchical dual-core multitask learning workflow described in the ECRECer papers, with local inference support for annotation, recommendation, and hybrid sequence-alignment modes.

Installation

Install the Python package from a built wheel or PyPI package:

python -m pip install ecrecer

The package intentionally does not include large data files, UniProt snapshots, feature banks, or trained model weights. Prepare those artifacts separately and point ECRECer at their root directory with ECRECER_ROOT.

For the RTX 5090 runtime, install PyTorch from the CUDA 13.0 PyTorch index first, then install the pinned runtime stack:

python -m pip install --index-url https://download.pytorch.org/whl/cu130 torch==2.13.0+cu130
python -m pip install -r requirements/runtime-5090.txt

Artifact Layout

ECRECER_ROOT should contain the same runtime artifact layout used by the repository checkout:

ECRECER_ROOT/
  data/
    dict/
    featureBank/
    uniprot/
  model/
  results/
  tmp/

Required production artifacts include:

  • data/uniprot/sprot_latest.feather
  • data/featureBank/embd_esm32.feather
  • data/dict/dict_label_task1.h5
  • data/dict/dict_label_task2.h5
  • data/dict/dict_label_task3.h5
  • model/isenzyme.h5
  • model/howmany_enzyme.h5
  • model/ec.h5

Set the artifact root before running:

export ECRECER_ROOT=/path/to/ecrecer_artifacts

Quick Start

Use data/sample_10.fasta for a minimal local run when the artifact root is this repository checkout:

export ECRECER_ROOT=/path/to/ecrecer_artifacts
ecrecer -i "$ECRECER_ROOT/data/sample_10.fasta" -o /tmp/ecrecer_sample10.tsv -mode p -topk 5
sed -n '1,5p' /tmp/ecrecer_sample10.tsv

Command Line Usage

Prediction mode writes final EC predictions:

ecrecer -i input.fasta -o output.tsv -mode p -topk 5

Recommendation mode writes top-k EC candidates with scores:

ecrecer -i input.fasta -o recommendations.tsv -mode r -topk 10

Hybrid mode also uses DIAMOND sequence alignment and requires a DIAMOND executable plus a production BLAST database under data/uniprot_blast_db/:

ecrecer -i input.fasta -o hybrid.tsv -mode h -topk 10

Legacy script usage is still supported:

python production.py -i input.fasta -o output.tsv -mode p -topk 5

Input And Output Example

Input is a standard FASTA file:

>query_1
MKTAYIAKQRQISFVKSHFSRQDILD
>query_2
MGSSHHHHHHSSGLVPRGSHM

Prediction mode (-mode p) writes a tab-separated table with one row per input sequence:

id_input	ec_pred
query_1	2.6.1.19
query_2	-

Recommendation mode (-mode r) returns top-k candidate EC numbers and probabilities:

id_input	dmlf_recomendations
query_1	[('2.6.1.19', 0.685800), ('2.6.1.22', 0.248600)]

- indicates a predicted non-enzyme or no EC assignment. For exact values, use the output generated by the installed model artifacts.

GPU Runtime Notes

  • The validated 5090 stack uses PyTorch 2.13.0+cu130 for ESM embedding.
  • Existing .h5 prediction heads are loaded through TensorFlow/Keras compatibility wrappers.
  • TensorFlow 2.21.0 can see RTX 5090 GPUs but may JIT kernels from PTX because current wheels do not ship native kernels for compute capability 12.0a.

Docker And Singularity

Container images remain useful for users who prefer a prebuilt runtime:

docker pull kingstdio/ecrecer
sudo docker run -it -d --gpus all --name ecrecer -v "$PWD":/home kingstdio/ecrecer
sudo docker exec ecrecer python /ecrecer/production.py -i /home/input.fasta -o /home/output.tsv -mode h -topk 10
wget -c https://tibd-public-datasets.s3.us-east-1.amazonaws.com/ecrecer/sifimages/ecrecer.sif
singularity run --nv ecrecer.sif python /ecrecer/production.py -i input.fasta -o output.tsv -mode h -topk 10

Citation

If ECRECer is useful in your work, please cite:

@article{shi2023enzyme,
  title={Enzyme Commission Number Prediction and Benchmarking with Hierarchical Dual-core Multitask Learning Framework},
  author={Shi, Zhenkun and Deng, Rui and Yuan, Qianqian and Mao, Zhitao and Wang, Ruoyu and Li, Haoran and Liao, Xiaoping and Ma, Hongwu},
  journal={Research},
  year={2023},
  publisher={AAAS}
}

Earlier preprint:

Shi, Zhenkun, Qianqian Yuan, Ruoyu Wang, Haoran Li, Xiaoping Liao, and Hongwu Ma. ECRECer: Enzyme Commission Number Recommendation and Benchmarking based on Multiagent Dual-core Learning. arXiv:2202.03632.

License

ECRECer is released under the MIT License. See LICENSE.

Metadata

Release files for ecrecer 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ecrecer 1.0.4
File Size Uploaded
ecrecer-1.0.4.tar.gz 32.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ecrecer 1.0.4
File Interpreter ABI Platform
ecrecer-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 64.5 kB

Release files / ecrecer-1.0.4.tar.gz

Download URL ecrecer-1.0.4.tar.gz
Size 32.0 kB
Tags Source
SHA-256 checksum
How to use checksums
03f0b1300f1947e698528070ca370b8c28c655d54fd48a2cdd586e295d6bdf40
BLAKE2b-256 checksum
How to use checksums
dd8c79bd1a2a0138cb25dea65b9ce84b9e3658b2a42327e23dc0cfc1258ff92d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / ecrecer-1.0.4-py3-none-any.whl

Download URL ecrecer-1.0.4-py3-none-any.whl
Size 32.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a6da997c30a0f54bb4a4ddead6edec521ed238fd7188e523d82d1f10fd26898f
BLAKE2b-256 checksum
How to use checksums
9ad6ae47359b6cb825d937a6c15b59d7559e2c802b9c080682aa7ea31629e7ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release history Release notifications | RSS feed

1.0.5

2 release files

This release

1.0.4 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page