Skip to main content

DMLF: Enzyme Commission Number Predicting and Benchmarking with Multi-agent Dual-core Learning

ECRECer is the official implementation of the hierarchical dual-core multitask learning framework described in the ECRECer papers. It is an Enzyme Commission (EC) number prediction and recommendation tool that accepts protein FASTA sequences and returns EC predictions, ranked EC recommendations, or hybrid results that combine prediction, recommendation, and sequence alignment.

Web Server

For the simplest use, visit the ECRECer web server:

https://ecrecer.biodesign.ac.cn

Papers

  1. Zhenkun Shi, 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.
  2. Zhenkun Shi, Rui Deng, Qianqian Yuan, Zhitao Mao, Ruoyu Wang, Haoran Li, Xiaoping Liao, and Hongwu Ma. Enzyme Commission Number Prediction and Benchmarking with Hierarchical Dual-core Multitask Learning Framework. Research, 2023.

Installation

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

python -m pip install ecrecer

The package installs the Python runtime dependencies needed for local inference. Large runtime artifacts are prepared with ecrecer-setup after installation.

Step-by-step Local Pipeline

  1. Install ECRECer:
python -m pip install ecrecer
  1. Download and prepare runtime artifacts. This creates the directory layout, installs the bundled label dictionaries and sample FASTA file, and downloads the trained models, UniProt cache, and ESM32 feature bank:
ecrecer-setup --target ~/ecrecer_artifacts

The default artifact download is about 4.2 GB. For hybrid mode, also download the DIAMOND database:

ecrecer-setup --target ~/ecrecer_artifacts --with-hybrid
  1. Point ECRECer at the artifact directory:
export ECRECER_ROOT=~/ecrecer_artifacts
  1. Run the bundled sample in recommendation mode:
ecrecer -i "$ECRECER_ROOT/data/sample_10.fasta" -o ecrecer_sample10.tsv -mode r -topk 5
sed -n 1,5p ecrecer_sample10.tsv
  1. Run your own FASTA file:
ecrecer -i input.fasta -o output.tsv -mode p -topk 5

Artifact Layout

ecrecer-setup creates an ECRECER_ROOT directory with this runtime artifact layout:

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

Preprocessed benchmark datasets are available separately from the public archive:

https://tibd-public-datasets.s3.amazonaws.com/ecrecer/ecrecer_datasets.zip

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

ECRECer uses the installed TensorFlow and PyTorch runtimes automatically. No separate ECRECer package is needed for different NVIDIA GPU models. For GPU acceleration, use a recent NVIDIA driver and a Python environment where TensorFlow and PyTorch can see the GPU; otherwise ECRECer runs with the available CPU/GPU backend.

Docker And Singularity

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

docker pull kingstdio/ecrecer

# GPU runtime
sudo docker run -it -d --gpus all --name ecrecer -v "$PWD":/home kingstdio/ecrecer

# CPU runtime
sudo docker run -it -d --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

# CPU runtime
singularity run 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.

Stargazers Over Time

Stargazers over time

Metadata

Release files for ecrecer 1.0.5

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.5
File Size Uploaded
ecrecer-1.0.5.tar.gz 59.1 kB Details

Built distribution (wheel)

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

Total release size: 116.8 kB

Release files / ecrecer-1.0.5.tar.gz

Download URL ecrecer-1.0.5.tar.gz
Size 59.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a89592bf40e0785e7b74cb0406887f747a4bc145f059dbfffef491804e8470ff
BLAKE2b-256 checksum
How to use checksums
e50c4413d9682ec57eeb0e46e30cdca21e68cab00d811535c13439a36f1bb71e
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.5-py3-none-any.whl

Download URL ecrecer-1.0.5-py3-none-any.whl
Size 57.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b72db6ce7049df4caddf66fa6d51a83fe9ac7a89e5a3474dd3d51bf0c327bfa
BLAKE2b-256 checksum
How to use checksums
41100df8b22c87c5e65720c80f24d590e87cab3a18a82d9c8d3e4ed779633af4
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

This release

1.0.5 This release

2 release files

1.0.4

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