Download README.md from OneScience-Group/TargetDiff: direct link, hf CLI and curl.
- Browser
- Download file 26.4 kB
-
https://huggingface.co/OneScience-Group/TargetDiff/resolve/main/README.md
- Command line
-
hf download hf://OneScience-Group/TargetDiff/README.md
-
curl -L -o README.md https://huggingface.co/OneScience-Group/TargetDiff/resolve/main/README.md
frameworks:
- ''
language:
- en
license: mit
tags:
- OneScience
- affinity prediction
- molecule generation
TargetDiff
Model Overview
TargetDiff is a bioinformatics model for target-aware molecule generation and protein-ligand affinity prediction.
The original paper is 3D Equivariant Diffusion for Target-Aware Molecule Generation and Affinity Prediction (ICLR 2023).
Model Description
TargetDiff is based on a 3D equivariant diffusion network. Given a protein binding pocket, it generates candidate small molecules and can use an EGNN property prediction branch to predict protein-ligand complex affinity.
The current package organizes TargetDiff example scripts, a snapshot of the model implementation, sample inputs, and pretrained weights in the same directory. Datasets will be uploaded later.
Use Cases
| Use case | Description |
|---|---|
| Protein-ligand affinity prediction | Takes a protein PDB file and ligand SDF file as input, and outputs molar concentration predictions for Ki, Kd, or IC50 |
| Target-aware small molecule generation | Takes a protein binding pocket PDB file as input, and outputs generated molecule sample.pt files and SDF files for molecules that can be reconstructed |
| Diffusion model training | Trains the TargetDiff molecule generation model using CrossDocked2020 pocket data |
| Property prediction training | Trains an EGNN affinity prediction model using PDBbind data |
| Generated result evaluation | Computes metrics such as stability, reconstruction success rate, QED, SA, and optional Vina docking metrics for sampling results |
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
First enter an environment where the OneScience bioinformatics dependencies have been installed.
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
hf download OneScience-Group/targetdiff --local-dir ./targetdiff
cd targetdiff
Training Weights and Datasets
Training weights are already included in the weights folder and can be used directly after downloading the model package.
Datasets will be uploaded to Hugging Face soon, and command-line downloads will be supported later.
3. Affinity Prediction
3.1 Affinity Prediction Training
bash scripts/train_prop.sh
This script automatically performs the following steps:
- Extract binding pockets from the PDBbind refined set.
- Split the training, validation, and test sets according to the coreset.
- Train an EGNN-based protein-ligand binding affinity prediction model.
3.2 Affinity Prediction Evaluation
Use the trained affinity prediction model to evaluate on the test set. The expected official metrics on PDBBind v2016 are:
| RMSE | MAE | R² | Pearson | Spearman |
|---|---|---|---|---|
| 1.316 | 1.031 | 0.633 | 0.797 | 0.782 |
Run:
export PYTHONPATH=../../../src:$PYTHONPATH
python scripts/property_prediction/eval_prop.py \
--ckpt_path ${ONESCIENCE_MODELS_DIR}/targetdiff/pretrained_models/egnn_pdbbind_v2016.pt \
--device cuda
3.3 Affinity Prediction Inference
bash scripts/inference.sh
By default, this script performs affinity prediction on the example protein-ligand pair 3ug2, using the default weights and example data:
- Model weights:
${ONESCIENCE_MODELS_DIR}/targetdiff/pretrained_models/egnn_pdbbind_v2016.pt - Protein:
${ONESCIENCE_DATASETS_DIR}/targetdiff/examples/3ug2_protein.pdb - Ligand:
${ONESCIENCE_DATASETS_DIR}/targetdiff/examples/3ug2_ligand.sdf - Affinity type: default
Kd - Compute device: default
cuda
4. Molecular Sampling
4.1 Single Test-Set Sample
export PYTHONPATH=../../../src:$PYTHONPATH
python -m scripts.sample_diffusion configs/sampling.yml -i 0 --batch_size 50 --result_path ./outputs
This script reads the diffusion model checkpoint from configs/sampling.yml, generates candidate ligand molecules for the i-th pocket in the test set, and saves the result as result_i.pt.
4.2 Multi-GPU Batch Sampling
bash scripts/batch_sample_diffusion.sh configs/sampling.yml outputs 4 0 0
Parameter descriptions:
| Parameter | Description |
|---|---|
$1 |
Sampling configuration file path |
$2 |
Result output directory |
$3 |
Total number of worker nodes |
$4 |
Current node index, starting from 0 |
$5 |
Starting data index |
Example of multi-GPU parallel sampling:
CUDA_VISIBLE_DEVICES=0 bash scripts/batch_sample_diffusion.sh configs/sampling.yml outputs 4 0 0 &
CUDA_VISIBLE_DEVICES=1 bash scripts/batch_sample_diffusion.sh configs/sampling.yml outputs 4 1 0 &
CUDA_VISIBLE_DEVICES=2 bash scripts/batch_sample_diffusion.sh configs/sampling.yml outputs 4 2 0 &
CUDA_VISIBLE_DEVICES=3 bash scripts/batch_sample_diffusion.sh configs/sampling.yml outputs 4 3 0 &
wait
The script internally fixes TOTAL_TASKS=100 and BATCH_SIZE=50, and assigns samples to nodes by index modulo.
4.3 Sampling for a Custom PDB Pocket
export PYTHONPATH=../../../src:$PYTHONPATH
python -m scripts.sample_for_pocket configs/sampling.yml \
--pdb_path /path/to/pocket.pdb \
--result_path ./outputs_pdb \
--num_samples 5 \
--batch_size 1
Parameter descriptions:
| Parameter | Required | Description |
|---|---|---|
config |
Yes | Sampling configuration file path |
--pdb_path |
Yes | Protein pocket PDB file path. A 10 Å pocket is recommended. |
--result_path |
No | Result output directory, default ./outputs_pdb |
--num_samples |
No | Number of molecules to sample, read from the configuration file by default |
--batch_size |
No | Batch size, default 100 |
--device |
No | Compute device, default cuda:0 |
Sampling results are saved as outputs_pdb/sample.pt, and successfully reconstructed molecules are additionally written to outputs_pdb/sdf/.
5. Generated Molecule Evaluation
5.1 Evaluation from Sampling Results
If docking evaluation is required (vina_score / vina_dock / qvina), also install:
pip install meeko==0.1.dev3 scipy pdb2pqr vina==1.2.2
python -m pip install git+https://github.com/Valdes-Tresanco-MS/AutoDockTools_py3
export PYTHONPATH=../../../src:$PYTHONPATH
python scripts/evaluate_diffusion.py ./outputs --docking_mode vina_score --protein_root /path/to/protein_root
Parameter descriptions:
| Parameter | Required | Description |
|---|---|---|
sample_path |
Yes | Sampling result directory containing result_*.pt files |
--docking_mode |
Yes | Docking mode. Options: none, vina_score, vina_dock, qvina |
--protein_root |
No | Root directory of the original protein files, used for docking evaluation |
--eval_step |
No | Which sampling step to evaluate, default -1 (the final step) |
--eval_num_examples |
No | Number of samples to evaluate, default all |
--exhaustiveness |
No | Docking search intensity, default 16 |
--save |
No | Whether to save evaluation results, default True |
Supported docking modes:
| Mode | Description |
|---|---|
none |
Computes only metrics such as validity, uniqueness, and novelty, without docking |
vina_score |
Uses AutoDock Vina to score generated molecules |
vina_dock |
Uses AutoDock Vina to redock generated molecules |
qvina |
Uses QuickVina for docking |
The first run in vina_score or vina_dock mode may take some time to prepare pdbqt and pqr files.
5.2 Evaluation from Meta Files
The official project provides sampled and docked meta files, including TargetDiff and baselines such as CVAE, AR, and Pocket2Mol. These files can be downloaded and evaluated directly:
| Meta file | Corresponding paper |
|---|---|
crossdocked_test_vina_docked.pt |
Original test-set docking results |
cvae_vina_docked.pt |
liGAN |
ar_vina_docked.pt |
AR |
pocket2mol_vina_docked.pt |
Pocket2Mol |
targetdiff_vina_docked.pt |
TargetDiff |
Official meta file download URL: https://drive.google.com/drive/folders/19imu-mlwrjnQhgbXpwsLgA17s1Rv70YS?usp=share_link
Evaluation command:
export PYTHONPATH=../../../src:$PYTHONPATH
python scripts/evaluate_from_meta.py sampling_results/targetdiff_vina_docked.pt --result_path eval_targetdiff
Parameter descriptions:
| Parameter | Required | Description |
|---|---|---|
meta_file |
Yes | .pt file containing sampling and docking results |
--result_path |
No | Evaluation result output directory, default eval_results |
6. Diffusion Model Training
bash train_diffusion.sh
By default, this reads configs/training.yml, trains on the CrossDocked2020 pocket dataset, and saves logs and checkpoints to ./logs_diffusion/.
Custom configuration or parameter overrides:
# Specify a custom configuration file
bash train_diffusion.sh configs/custom_training.yml
# Override training parameters from the command line
bash train_diffusion.sh --train.batch_size 8 --train.max_iters 500000
Main training parameters:
| Parameter | Default value | Description |
|---|---|---|
data.path |
${ONESCIENCE_DATASETS_DIR}/targetdiff/data/crossdocked_v1.1_rmsd1.0_pocket10 |
Training data directory |
data.split |
${ONESCIENCE_DATASETS_DIR}/targetdiff/data/crossdocked_pocket10_pose_split.pt |
Training/validation/test split file |
train.batch_size |
4 |
Batch size |
train.max_iters |
10000000 |
Maximum number of iterations |
train.lr |
5.e-4 |
Learning rate |
logdir |
./logs_diffusion |
Log output directory |
7. Data Preprocessing
7.1 CrossDocked2020 Data Preprocessing
To process CrossDocked2020 data from scratch, follow these steps:
Download CrossDocked2020 v1.1 and save it to
data/CrossDocked2020.Filter samples with RMSD < 1 Å:
export PYTHONPATH=../../../src:$PYTHONPATH python scripts/data_preparation/clean_crossdocked.py \ --source data/CrossDocked2020 \ --dest data/crossdocked_v1.1_rmsd1.0 \ --rmsd_thr 1.0Extract 10 Å binding pockets from proteins:
python scripts/data_preparation/extract_pockets.py \ --source data/crossdocked_v1.1_rmsd1.0 \ --dest data/crossdocked_v1.1_rmsd1.0_pocket10Split the training and test sets:
python scripts/data_preparation/split_pl_dataset.py \ --path data/crossdocked_v1.1_rmsd1.0_pocket10 \ --dest data/crossdocked_pocket10_pose_split.pt \ --fixed_split data/split_by_name.pt
7.2 PDBbind Data Preprocessing
The affinity prediction training script train_prop.sh automatically performs pocket extraction and dataset splitting. To run these steps separately, use the following commands:
export PYTHONPATH=../../../src:$PYTHONPATH
python scripts/property_prediction/extract_pockets.py \
--source data/pdbbind_v2020 \
--dest data/pdbbind_v2020_processed \
--subset refined \
--num_workers 16
python scripts/property_prediction/pdbbind_split.py \
--split_mode coreset \
--index_path data/pdbbind_v2020_processed/pocket_10_refined/index.pkl \
--test_path data/pdbbind_v2016/coreset \
--save_path data/pdbbind_v2020_processed/pocket_10_refined/split.pt
Official OneScience Information
| Platform | OneScience main repository | Skills repository |
|---|---|---|
| Gitee | https://gitee.com/onescience-ai/onescience | https://gitee.com/onescience-ai/oneskills |
| GitHub | https://github.com/onescience-ai/OneScience | https://github.com/onescience-ai/oneskills |
Citation and License
- The original TargetDiff code is licensed under the MIT License. This repository retains source attribution and is organized for OneScience Hugging Face automated runtime scenarios.
- If you use TargetDiff results in research, we recommend citing the original TargetDiff paper and relevant OneScience project information. Depending on the actual task, also add citations for datasets or tools such as CrossDocked2020, PDBbind, RDKit, OpenBabel, and Vina/QVina.
@inproceedings{guan3d,
title={3D Equivariant Diffusion for Target-Aware Molecule Generation and Affinity Prediction},
author={Guan, Jiaqi and Qian, Wesley Wei and Peng, Xingang and Su, Yufeng and Peng, Jian and Ma, Jianzhu},
booktitle={International Conference on Learning Representations},
year={2023}
}
中文说明
模型概述
TargetDiff 是用于靶标感知分子生成和蛋白质-配体亲和力预测的生物信息学模型。
原始论文为 _面向靶标感知分子生成和亲和力预测的 3D 等变扩散_(ICLR 2023)。
模型描述
TargetDiff 基于 3D 等变扩散网络。给定蛋白质结合口袋,它会生成候选小分子,并可使用 EGNN 属性预测分支预测蛋白质-配体复合物的亲和力。
当前软件包将 TargetDiff 示例脚本、模型实现快照、样例输入和预训练权重组织在同一目录中。数据集将于后续上传。
使用场景
| 使用场景 | 说明 |
|---|---|
| 蛋白质-配体亲和力预测 | 以蛋白质 PDB 文件和配体 SDF 文件为输入,输出 Ki、Kd 或 IC50 的摩尔浓度预测值 |
| 靶标感知小分子生成 | 以蛋白质结合口袋 PDB 文件为输入,输出生成分子的 sample.pt 文件以及可重建分子的 SDF 文件 |
| 扩散模型训练 | 使用 CrossDocked2020 口袋数据训练 TargetDiff 分子生成模型 |
| 属性预测训练 | 使用 PDBbind 数据训练 EGNN 亲和力预测模型 |
| 生成结果评估 | 计算采样结果的稳定性、重建成功率、QED、SA 及可选的 Vina 分子对接(molecular docking)指标 |
使用方法
1. 使用 OneCode
可通过 OneCode 在线环境体验智能一键 AI4S 编程。
2. 手动安装与使用
硬件要求
- 建议在 GPU 或 DCU 上运行。
- 可使用 CPU 进行连通性检查,但速度相对较慢。
- DCU 用户需要提前安装 DTK。建议使用 DTK 25.04.2 或更高版本,或使用 OneScience 推荐的与当前集群匹配的版本。
软件要求
先进入已安装 OneScience 生物信息学依赖的环境。
环境检查
- 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. 下载模型
hf download OneScience-Group/targetdiff --local-dir ./targetdiff
cd targetdiff
训练权重与数据集
训练权重已包含在 weights 文件夹中,下载模型包后可直接使用。
数据集将很快上传至 Hugging Face,之后将支持命令行下载。
3. 亲和力预测
3.1 亲和力预测训练
bash scripts/train_prop.sh
此脚本自动执行以下步骤。
- 从 PDBbind refined set 提取结合口袋。
- 按 coreset 划分训练集、验证集和测试集。
- 训练基于 EGNN 的蛋白质-配体结合亲和力预测模型。
3.2 亲和力预测评估
使用已训练的亲和力预测模型在测试集上评估。PDBBind v2016 上预期的官方指标如下。
| RMSE | MAE | R² | Pearson | Spearman |
|---|---|---|---|---|
| 1.316 | 1.031 | 0.633 | 0.797 | 0.782 |
运行以下命令。
export PYTHONPATH=../../../src:$PYTHONPATH
python scripts/property_prediction/eval_prop.py \
--ckpt_path ${ONESCIENCE_MODELS_DIR}/targetdiff/pretrained_models/egnn_pdbbind_v2016.pt \
--device cuda
3.3 亲和力预测推理(inference)
bash scripts/inference.sh
默认情况下,脚本使用默认权重和示例数据,对示例蛋白质-配体对 3ug2 进行亲和力预测。
- 模型权重
${ONESCIENCE_MODELS_DIR}/targetdiff/pretrained_models/egnn_pdbbind_v2016.pt - 蛋白质
${ONESCIENCE_DATASETS_DIR}/targetdiff/examples/3ug2_protein.pdb - 配体
${ONESCIENCE_DATASETS_DIR}/targetdiff/examples/3ug2_ligand.sdf - 亲和力类型,默认为
Kd - 计算设备,默认为
cuda
4. 分子采样
4.1 单个测试集样本
export PYTHONPATH=../../../src:$PYTHONPATH
python -m scripts.sample_diffusion configs/sampling.yml -i 0 --batch_size 50 --result_path ./outputs
此脚本从 configs/sampling.yml 读取扩散模型权重(检查点)(checkpoint),为测试集中的第 i 个口袋生成候选配体分子,将结果保存为 result_i.pt。
4.2 多 GPU 批量采样
bash scripts/batch_sample_diffusion.sh configs/sampling.yml outputs 4 0 0
参数说明
| 参数 | 说明 |
|---|---|
$1 |
采样配置文件路径 |
$2 |
结果输出目录 |
$3 |
工作节点总数 |
$4 |
当前节点索引,从 0 开始 |
$5 |
起始数据索引 |
多 GPU 并行采样示例
CUDA_VISIBLE_DEVICES=0 bash scripts/batch_sample_diffusion.sh configs/sampling.yml outputs 4 0 0 &
CUDA_VISIBLE_DEVICES=1 bash scripts/batch_sample_diffusion.sh configs/sampling.yml outputs 4 1 0 &
CUDA_VISIBLE_DEVICES=2 bash scripts/batch_sample_diffusion.sh configs/sampling.yml outputs 4 2 0 &
CUDA_VISIBLE_DEVICES=3 bash scripts/batch_sample_diffusion.sh configs/sampling.yml outputs 4 3 0 &
wait
脚本内部固定 TOTAL_TASKS=100 和 BATCH_SIZE=50,并按索引取模将样本分配给各节点。
4.3 对自定义 PDB 口袋采样
export PYTHONPATH=../../../src:$PYTHONPATH
python -m scripts.sample_for_pocket configs/sampling.yml \
--pdb_path /path/to/pocket.pdb \
--result_path ./outputs_pdb \
--num_samples 5 \
--batch_size 1
参数说明
| 参数 | 必需 | 说明 |
|---|---|---|
config |
是 | 采样配置文件路径 |
--pdb_path |
是 | 蛋白质口袋 PDB 文件路径。建议使用 10 Å 的口袋。 |
--result_path |
否 | 结果输出目录,默认为 ./outputs_pdb |
--num_samples |
否 | 要采样的分子数量,默认从配置文件读取 |
--batch_size |
否 | 批大小,默认为 100 |
--device |
否 | 计算设备,默认为 cuda:0 |
采样结果保存为 outputs_pdb/sample.pt,成功重建的分子还会写入 outputs_pdb/sdf/。
5. 生成分子评估
5.1 根据采样结果评估
如需进行分子对接评估(vina_score / vina_dock / qvina),还需安装以下依赖。
pip install meeko==0.1.dev3 scipy pdb2pqr vina==1.2.2
python -m pip install git+https://github.com/Valdes-Tresanco-MS/AutoDockTools_py3
export PYTHONPATH=../../../src:$PYTHONPATH
python scripts/evaluate_diffusion.py ./outputs --docking_mode vina_score --protein_root /path/to/protein_root
参数说明
| 参数 | 必需 | 说明 |
|---|---|---|
sample_path |
是 | 包含 result_*.pt 文件的采样结果目录 |
--docking_mode |
是 | 分子对接模式。选项为 none、vina_score、vina_dock、qvina |
--protein_root |
否 | 原始蛋白质文件根目录,用于分子对接评估 |
--eval_step |
否 | 要评估的采样步骤,默认为 -1(最后一步) |
--eval_num_examples |
否 | 要评估的样本数,默认为全部 |
--exhaustiveness |
否 | 分子对接搜索强度,默认为 16 |
--save |
否 | 是否保存评估结果,默认为 True |
支持的分子对接模式
| 模式 | 说明 |
|---|---|
none |
仅计算有效性、唯一性和新颖性等指标,无需分子对接 |
vina_score |
使用 AutoDock Vina 为生成的分子评分 |
vina_dock |
使用 AutoDock Vina 对生成的分子重新进行分子对接 |
qvina |
使用 QuickVina 进行分子对接 |
首次以 vina_score 或 vina_dock 模式运行时,准备 pdbqt 和 pqr 文件可能需要一些时间。
5.2 根据元数据文件评估
官方项目提供已采样并完成分子对接的元数据文件,涵盖 TargetDiff 及 CVAE、AR 和 Pocket2Mol 等基线。可直接下载并评估这些文件。
| 元数据文件 | 对应论文 |
|---|---|
crossdocked_test_vina_docked.pt |
原始测试集的分子对接结果 |
cvae_vina_docked.pt |
liGAN |
ar_vina_docked.pt |
AR |
pocket2mol_vina_docked.pt |
Pocket2Mol |
targetdiff_vina_docked.pt |
TargetDiff |
官方元数据文件下载地址 https://drive.google.com/drive/folders/19imu-mlwrjnQhgbXpwsLgA17s1Rv70YS?usp=share_link
评估命令
export PYTHONPATH=../../../src:$PYTHONPATH
python scripts/evaluate_from_meta.py sampling_results/targetdiff_vina_docked.pt --result_path eval_targetdiff
参数说明
| 参数 | 必需 | 说明 |
|---|---|---|
meta_file |
是 | 包含采样和分子对接结果的 .pt 文件 |
--result_path |
否 | 评估结果输出目录,默认为 eval_results |
6. 扩散模型训练
bash train_diffusion.sh
默认读取 configs/training.yml,在 CrossDocked2020 口袋数据集上训练,并将日志和模型权重(检查点)保存到 ./logs_diffusion/。
自定义配置或覆盖参数
# Specify a custom configuration file
bash train_diffusion.sh configs/custom_training.yml
# Override training parameters from the command line
bash train_diffusion.sh --train.batch_size 8 --train.max_iters 500000
主要训练参数
| 参数 | 默认值 | 说明 |
|---|---|---|
data.path |
${ONESCIENCE_DATASETS_DIR}/targetdiff/data/crossdocked_v1.1_rmsd1.0_pocket10 |
训练数据目录 |
data.split |
${ONESCIENCE_DATASETS_DIR}/targetdiff/data/crossdocked_pocket10_pose_split.pt |
训练/验证/测试划分文件 |
train.batch_size |
4 |
批大小 |
train.max_iters |
10000000 |
最大迭代次数 |
train.lr |
5.e-4 |
学习率 |
logdir |
./logs_diffusion |
日志输出目录 |
7. 数据预处理
7.1 CrossDocked2020 数据预处理
要从头处理 CrossDocked2020 数据,请执行以下步骤。
下载 CrossDocked2020 v1.1 并保存至
data/CrossDocked2020。筛选 RMSD < 1 Å 的样本。
export PYTHONPATH=../../../src:$PYTHONPATH python scripts/data_preparation/clean_crossdocked.py \ --source data/CrossDocked2020 \ --dest data/crossdocked_v1.1_rmsd1.0 \ --rmsd_thr 1.0从蛋白质中提取 10 Å 结合口袋。
python scripts/data_preparation/extract_pockets.py \ --source data/crossdocked_v1.1_rmsd1.0 \ --dest data/crossdocked_v1.1_rmsd1.0_pocket10划分训练集和测试集。
python scripts/data_preparation/split_pl_dataset.py \ --path data/crossdocked_v1.1_rmsd1.0_pocket10 \ --dest data/crossdocked_pocket10_pose_split.pt \ --fixed_split data/split_by_name.pt
7.2 PDBbind 数据预处理
亲和力预测训练脚本 train_prop.sh 自动执行口袋提取和数据集划分。如需分别运行这些步骤,请使用以下命令。
export PYTHONPATH=../../../src:$PYTHONPATH
python scripts/property_prediction/extract_pockets.py \
--source data/pdbbind_v2020 \
--dest data/pdbbind_v2020_processed \
--subset refined \
--num_workers 16
python scripts/property_prediction/pdbbind_split.py \
--split_mode coreset \
--index_path data/pdbbind_v2020_processed/pocket_10_refined/index.pkl \
--test_path data/pdbbind_v2016/coreset \
--save_path data/pdbbind_v2020_processed/pocket_10_refined/split.pt
OneScience 官方信息
| 平台 | OneScience 主仓库 | Skills 仓库 |
|---|---|---|
| Gitee | https://gitee.com/onescience-ai/onescience | https://gitee.com/onescience-ai/oneskills |
| GitHub | https://github.com/onescience-ai/OneScience | https://github.com/onescience-ai/oneskills |
引用与许可证
- TargetDiff 原始代码采用 MIT 许可证。本仓库保留来源署名,并按 OneScience Hugging Face 自动运行场景组织。
- 若在研究中使用 TargetDiff 结果,建议引用 TargetDiff 原始论文和相关 OneScience 项目信息。根据实际任务,也请引用 CrossDocked2020、PDBbind、RDKit、OpenBabel 和 Vina/QVina 等数据集或工具。
@inproceedings{guan3d,
title={3D Equivariant Diffusion for Target-Aware Molecule Generation and Affinity Prediction},
author={Guan, Jiaqi and Qian, Wesley Wei and Peng, Xingang and Su, Yufeng and Peng, Jian and Ma, Jianzhu},
booktitle={International Conference on Learning Representations},
year={2023}
}