GenScore

Model Overview

GenScore is a protein-ligand scoring framework that can predict protein-small molecule binding affinity and evaluate docking pose quality. It demonstrates balanced scoring, ranking, docking, and virtual screening capabilities across multiple datasets.

Model Description

GenScore is based on graph neural networks and extends RTMScore.

Weights and datasets are not provided at the moment. They will be uploaded to Hugging Face soon, and command-line downloads will be supported later.

Use Cases

Use case Description
Protein-ligand scoring Predicts binding scores for a given protein, or an extracted binding pocket, and ligand conformation.
Automatic pocket generation Automatically extracts the binding pocket from a full protein structure based on the reference ligand position.
Contribution analysis Outputs atom-level and residue-level contributions to the final score for interpretability analysis.
Model training Trains the GenScore scoring network using preprocessed PDBbind protein-ligand graph data.
CASF-2016 benchmark evaluation Supports three standard tests: scoring/ranking, docking, and virtual screening.

Usage

1. Using OneCode

You can try intelligent one-click AI4S programming through the OneCode online environment:

Try intelligent one-click AI4S programming

2. Manual Installation and Usage

Hardware Requirements

  • Running on a GPU or DCU is recommended.
  • CPU can be used for connectivity checks, but it is relatively slow.
  • DCU users need to install DTK in advance. DTK 25.04.2 or later is recommended, or the OneScience-recommended version that matches the current cluster.

Software Requirements

DCU users who want to learn more about adaptation details can contact liubiao@sugon.com.

Environment Checks

  • NVIDIA GPU:
nvidia-smi
  • Hygon DCU:
hy-smi

Quick Start

1. Install the Runtime Environment

conda create -n onescience311 python=3.11 -y
conda activate onescience311
pip install onescience[bio] -i http://mirrors.onescience.ai:3141/pypi/simple/  --trusted-host mirrors.onescience.ai

If the following code cannot find required libraries at runtime, activate CUDA as shown below.

source ${ROCM_PATH}/cuda/env.sh
export LD_LIBRARY_PATH="$CONDA_PREFIX/lib:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="$CONDA_PREFIX/lib/python3.11/site-packages/fastpt/torch/lib:$LD_LIBRARY_PATH"

2. Download the Model Package

# By default, the package is downloaded to the GenScore folder under the current path. To change this, adjust the path after local_dir.
hf download OneScience-Group/GenScore --local-dir ./model

cd model

Training Weights and Datasets

Weights and datasets are not provided at the moment. They will be uploaded to Hugging Face soon, and command-line downloads will be supported later.

3. Usage Modes

1. Protein-Ligand Scoring Inference (run_genscore.sh)

cd ./scripts
bash run_genscore.sh

This script runs four inference examples in sequence, covering common use cases:

  1. GT model + automatic pocket generation: inputs a full protein, a reference ligand, and a decoy ligand, then automatically generates the binding pocket and scores it.
  2. GatedGCN model + pre-extracted pocket: inputs a pre-extracted pocket PDB and a decoy ligand for scoring.
  3. Atom contribution analysis: uses the GatedGCN model to compute each atom's contribution to the score.
  4. Residue contribution analysis: uses the GatedGCN model to compute each residue's contribution to the score.

2. Model Training

2.1 Small-Scale Smoke Test (train_genscore_smoke.sh)
cd ./scripts
bash train_genscore_smoke.sh

Default configuration:

Parameter Default value
Number of training epochs 100
Batch size 16
Number of validation samples 1500
Encoder gatedgcn
Output model genscore_smoke_bs16.pth
2.2 Full Training (train_genscore_full.sh)
cd ./scripts
bash train_genscore_full.sh

Key parameters can be overridden through environment variables:

Environment variable Description Default value
GENSCORE_DATA_DIR Training data directory ${ONESCIENCE_DATASETS_DIR}/GenScore/genscore_data/rtmscore_s
GENSCORE_DATA_PREFIX Data file prefix v2020_train
GENSCORE_ENCODER Graph encoder type gatedgcn
GENSCORE_MODEL_PATH Output model path examples/biosciences/genscore/genscore_${GENSCORE_ENCODER}_full_3000.pth
GENSCORE_NUM_EPOCHS Number of training epochs 3000
GENSCORE_BATCH_SIZE Batch size 64
GENSCORE_NUM_WORKERS Number of data loading workers 8
GENSCORE_VALNUM Number of validation samples 1500
GENSCORE_PATIENCE Early-stopping patience 70

3. CASF-2016 Benchmark Evaluation (run_genscore_benchmarks.sh)

cd ./scripts
bash run_genscore_benchmarks.sh all

You can also run a single evaluation task:

bash run_genscore_benchmarks.sh scoring
bash run_genscore_benchmarks.sh docking
bash run_genscore_benchmarks.sh screening

Evaluation task descriptions:

Task Description
scoring Scoring capability evaluation (scoring/ranking)
docking Docking capability evaluation (docking power)
screening Virtual screening capability evaluation (screening power)

Data Preprocessing

Training requires preprocessed PDBbind graph data, including:

<data_prefix>_ids.npy
<data_prefix>_lig.pt
<data_prefix>_prot.pt

You can preprocess the raw PDBbind data with the following command:

cd ./scripts
export PYTHONPATH=../../../src:$PYTHONPATH
python preprocess_pdbbind.py \
  --dir /path/to/pdbbind \
  --ref /path/to/pdbbind_2020_general.csv \
  --cutoff 10.0 \
  --outprefix /path/to/preprocessed/pdbbind/v2020_train

Main parameters:

Parameter Description
--dir Raw PDBbind data directory
--ref PDBbind index CSV file
--cutoff Protein-ligand distance cutoff, default 10.0 Å
--outprefix Output file prefix

Notes

  • Make sure the ONESCIENCE_DATASETS_DIR environment variable is correctly set before running the scripts.
  • The scripts automatically set ROCm/DCU-related LD_LIBRARY_PATH values and can run directly on Hygon DCU platforms.
  • Automatic pocket generation depends on OpenBabel and ProDy. If OpenBabel requires explicit data paths, set BABEL_LIBDIR and BABEL_DATADIR in advance.
  • Training and inference use a single device by default (HIP_VISIBLE_DEVICES=0 or CUDA_VISIBLE_DEVICES=0). For multi-device training, adjust the parallel strategy in the training scripts.
  • The training scripts check whether <data_prefix>_ids.npy, <data_prefix>_lig.pt, and <data_prefix>_prot.pt exist. If any are missing, the scripts will report an error and exit.
  • The docking and screening tasks in CASF-2016 evaluation require complete CASF-2016 and PDBbind v2020 data.

Official OneScience Information

Citation and License

If you use GenScore in your research, please cite the original work:

@article{genScore,
  title={GenScore: a generalized protein-ligand scoring framework},
  author={Shen, Chao and Hu, Yafeng and Wang, Zhe and Zhang, Xujun and Li, Jianxin and Wang, Guisheng and Wang, Tingjun and Chen, Yen-Wei and Pan, Peichen and Hou, Tingjun},
  journal={Journal of Chemical Information and Modeling},
  year={2023}
}

For more information, see the official GenScore repository: https://github.com/sc8668/GenScore

For license information, refer to the description in the official GenScore repository.


中文说明

模型概述

GenScore 是一个蛋白质-配体评分框架,可预测蛋白质与小分子的结合亲和力,并评估分子对接(molecular docking)构象的质量。它在多个数据集上展现出均衡的评分、排序、分子对接和虚拟筛选能力。

模型描述

GenScore 基于图神经网络,是对 RTMScore 的扩展。

目前尚未提供权重和数据集。它们将很快上传至 Hugging Face,之后将支持命令行下载。

使用场景

使用场景 说明
蛋白质-配体评分 对给定的蛋白质或提取的结合口袋及配体构象预测结合得分。
自动生成口袋 根据参考配体的位置,从完整蛋白质结构中自动提取结合口袋。
贡献分析 输出原子级和残基级对最终评分的贡献,供可解释性分析使用。
模型训练 使用预处理的 PDBbind 蛋白质-配体图数据训练 GenScore 评分网络。
CASF-2016 基准评估 支持三项标准测试,即评分/排序、分子对接和虚拟筛选。

使用方法

1. 使用 OneCode

可通过 OneCode 在线环境体验智能一键 AI4S 编程。

体验智能一键 AI4S 编程

2. 手动安装和使用

硬件要求

  • 建议在 GPU 或 DCU 上运行。
  • 可使用 CPU 检查连通性,但速度较慢。
  • DCU 用户需要提前安装 DTK。建议使用 DTK 25.04.2 或更高版本,或使用 OneScience 推荐的与当前集群匹配的版本。

软件要求

如需了解更多适配详情,DCU 用户可联系 liubiao@sugon.com。

环境检查

  • NVIDIA GPU
nvidia-smi
  • Hygon DCU
hy-smi

快速开始

1. 安装运行环境

conda create -n onescience311 python=3.11 -y
conda activate onescience311
pip install onescience[bio] -i http://mirrors.onescience.ai:3141/pypi/simple/  --trusted-host mirrors.onescience.ai

如果以下代码在运行时找不到所需库,请按下文所示激活 CUDA。

source ${ROCM_PATH}/cuda/env.sh
export LD_LIBRARY_PATH="$CONDA_PREFIX/lib:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="$CONDA_PREFIX/lib/python3.11/site-packages/fastpt/torch/lib:$LD_LIBRARY_PATH"

2. 下载模型包

# By default, the package is downloaded to the GenScore folder under the current path. To change this, adjust the path after local_dir.
hf download OneScience-Group/GenScore --local-dir ./model

cd model

训练权重与数据集

目前尚未提供权重和数据集。它们将很快上传至 Hugging Face,之后将支持命令行下载。

3. 使用模式

1. 蛋白质-配体评分推理(inference)(run_genscore.sh)
cd ./scripts
bash run_genscore.sh

该脚本依次运行四个推理示例,涵盖常见使用场景。

  1. GT 模型 + 自动生成口袋:输入完整蛋白质、参考配体和诱饵配体,然后自动生成结合口袋并评分。
  2. GatedGCN 模型 + 预提取口袋:输入预提取的口袋 PDB 和诱饵配体进行评分。
  3. 原子贡献分析:使用 GatedGCN 模型计算每个原子对评分的贡献。
  4. 残基贡献分析:使用 GatedGCN 模型计算每个残基对评分的贡献。
2. 模型训练
2.1 小规模冒烟测试(train_genscore_smoke.sh)
cd ./scripts
bash train_genscore_smoke.sh

默认配置

参数 默认值
训练轮数 100
批大小 16
验证样本数 1500
编码器 gatedgcn
输出模型 genscore_smoke_bs16.pth
2.2 完整训练(train_genscore_full.sh)
cd ./scripts
bash train_genscore_full.sh

可通过环境变量覆盖关键参数。

环境变量 说明 默认值
GENSCORE_DATA_DIR 训练数据目录 ${ONESCIENCE_DATASETS_DIR}/GenScore/genscore_data/rtmscore_s
GENSCORE_DATA_PREFIX 数据文件前缀 v2020_train
GENSCORE_ENCODER 图编码器类型 gatedgcn
GENSCORE_MODEL_PATH 输出模型路径 examples/biosciences/genscore/genscore_${GENSCORE_ENCODER}_full_3000.pth
GENSCORE_NUM_EPOCHS 训练轮数 3000
GENSCORE_BATCH_SIZE 批大小 64
GENSCORE_NUM_WORKERS 数据加载工作进程数 8
GENSCORE_VALNUM 验证样本数 1500
GENSCORE_PATIENCE 提前停止的耐心值 70

3. CASF-2016 基准评估(run_genscore_benchmarks.sh)
cd ./scripts
bash run_genscore_benchmarks.sh all

也可以运行单项评估任务。

bash run_genscore_benchmarks.sh scoring
bash run_genscore_benchmarks.sh docking
bash run_genscore_benchmarks.sh screening

评估任务说明

任务 说明
scoring 评分能力评估(评分/排序)
docking 分子对接能力评估(对接能力)
screening 虚拟筛选能力评估(筛选能力)

数据预处理

训练需要使用预处理的 PDBbind 图数据,包括以下文件。

<data_prefix>_ids.npy
<data_prefix>_lig.pt
<data_prefix>_prot.pt

可使用以下命令预处理原始 PDBbind 数据。

cd ./scripts
export PYTHONPATH=../../../src:$PYTHONPATH
python preprocess_pdbbind.py \
  --dir /path/to/pdbbind \
  --ref /path/to/pdbbind_2020_general.csv \
  --cutoff 10.0 \
  --outprefix /path/to/preprocessed/pdbbind/v2020_train

主要参数

参数 说明
--dir 原始 PDBbind 数据目录
--ref PDBbind 索引 CSV 文件
--cutoff 蛋白质-配体距离截断值,默认为 10.0 Å
--outprefix 输出文件前缀

注意事项

  • 运行脚本前,请确保正确设置 ONESCIENCE_DATASETS_DIR 环境变量。
  • 脚本会自动设置与 ROCm/DCU 相关的 LD_LIBRARY_PATH 值,可以直接在 Hygon DCU 平台上运行。
  • 自动生成口袋依赖 OpenBabel 和 ProDy。如果 OpenBabel 要求显式指定数据路径,请提前设置 BABEL_LIBDIR 和 BABEL_DATADIR。
  • 训练和推理默认使用单个设备(HIP_VISIBLE_DEVICES=0 或 CUDA_VISIBLE_DEVICES=0)。如需进行多设备训练,请调整训练脚本中的并行策略。
  • 训练脚本会检查 <data_prefix>_ids.npy、<data_prefix>_lig.pt 和 <data_prefix>_prot.pt 是否存在。如果有任何文件缺失,脚本将报错并退出。
  • CASF-2016 评估的 docking 和 screening 任务需要完整的 CASF-2016 和 PDBbind v2020 数据。

OneScience 官方信息

引用与许可证

如果在研究中使用 GenScore,请引用原始工作。

@article{genScore,
  title={GenScore: a generalized protein-ligand scoring framework},
  author={Shen, Chao and Hu, Yafeng and Wang, Zhe and Zhang, Xujun and Li, Jianxin and Wang, Guisheng and Wang, Tingjun and Chen, Yen-Wei and Pan, Peichen and Hou, Tingjun},
  journal={Journal of Chemical Information and Modeling},
  year={2023}
}

更多信息见 GenScore 官方仓库 https://github.com/sc8668/GenScore

许可证信息请参阅 GenScore 官方仓库中的说明。

Downloads last month
15
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support