microsoft/bioemu
Inference code for scalable emulation of protein equilibrium ensembles with generative deep learning
BioEmu – 基于扩散的蛋白质结构生成器
它是什么 – BioEmu(生物分子模拟器)是一个 Python 库,仅根据氨基酸序列即可采样单链蛋白质的合理 3D 结构。它使用在分子动力学模拟上训练的扩散模型实现,并附带模型权重,因此您可以在本地或 Azure AI Foundry 上运行推理。
主要功能
- 快速采样:每个 GPU 可采样数千个结构(例如,在 A100 上,100 个氨基酸的蛋白质约需 4 分钟)。
- 物理引导:在扩散过程中通过顺序蒙特卡洛(SMC)或费曼-卡克校正器(FKC)应用可选势能(Cα-Cα 距离、空间冲突避免),以减少非物理的链断裂。
- 侧链重建和短 MD 松弛:通过可选的
bioemu[md]扩展实现,该扩展封装了 HPacker 工具和简短的 NVT 平衡。 - 零设置 MSA/嵌入:内置的 ColabFold/AlphaFold2 副本会在首次运行采样器时自动获取 MSA 并计算嵌入。
- Azure AI Foundry 支持一键云执行。
安装
# 核心包(仅 Linux,Python ≥3.10)
pip install bioemu
# 使用 GPU 加速(CUDA)– 拉取 torch-CUDA 轮子
pip install "bioemu[cuda]"
# 可选的侧链/MD 工具
pip install "bioemu[md]"
首次运行将下载 AlphaFold2 权重(约 3.5 GB)到 ~/.cache/colabfold/。
基本用法(CLI)
python -m bioemu.sample \
--sequence GYDPETGTWG \
--num_samples 10 \
--output_dir ~/test_chignolin
或通过 Python API:
from bioemu.sample import main as sample
sample(sequence='GYDPETGTWG', num_samples=10, output_dir='~/test_chignolin')
模型检查点自动从 Microsoft BioEmu HuggingFace 仓库获取;您可以使用 --model_name="bioemu-v1.1" 选择特定版本。
物理引导(推荐用于真实骨架)
python -m bioemu.sample \
--sequence GYDPETGTWG \
--num_samples 100 \
--output_dir ~/steered \
--denoiser_config src/bioemu/config/steering/physical_steering.yaml
YAML 配置允许您调整:
num_particles(每个输出样本的扩散粒子数)ess_threshold(何时重新采样粒子)- 应用势能的扩散时间
start/end - 使用哪些势能(例如,
CaCaDistance、PairwiseClash)。
侧链重建和 MD 松弛
python -m bioemu.sidechain_relax \
--pdb-path samples.pdb \
--xtc-path samples.xtc \
--md-protocol nvt_equil # 可选的短 NVT 运行
该脚本在需要时会在隔离的虚拟环境中安装 HPacker。使用 --no-md-equil 跳过 MD 步骤。
更多信息
- 论文和引用:Scalable emulation of protein equilibrium ensembles with generative deep learning(Science, 2025)。DOI 10.1126/science.adv9817。
- 模型权重:托管在 HuggingFace 上的
microsoft/bioemu。 - 训练数据:CATH、Octapeptides、MegaSim(提供 Zenodo 链接)。
- 基准测试:参见配套的
bioemu-benchmarks仓库以复现论文结果。 - Azure AI Foundry:按照
AZURE_AI_FOUNDRY.md进行云托管部署。
许可证和归属 BioEmu 本身以 MIT 许可证发布。它捆绑了 AlphaFold2(Apache 2.0)、OpenFold(Apache 2.0)和 ColabFold(MIT)的代码。使用该库时,请引用 Science 论文和 README 顶部显示的 Zenodo DOI。
本摘要仅基于仓库的 README;未推断任何额外功能。
相关
- 项目
- 项目
- 项目
- Dispatch
- 项目