Bio Free Energy Calculations 标志

Bio Free Energy Calculations

组织
PKU-YuanGroup
bio-free-energy-calculations

通过 OpenFE、FEP+、GROMACS、AMBER pmemd 和 OpenMM 执行炼金自由能计算,包括相对结合自由能(RBFE / FEP+)和绝对结合自由能(ABFE),并明确设置 lambda 调度、软核势、MBAR/BAR 分析、循环闭合验证,以及适合相应方案的增强采样。比较 ML 替代方案(Boltz-2 affinity、DeepDock)。适用于在对接精度之外按结合亲和力为类似物排序、开展前瞻性先导化合物优化,或验证 SAR 预测。

Add to TypingMind

概览

发布者PKU-YuanGroup
代码仓库OpenAI4S
技能名称bio-free-energy-calculations
星标数
622
复刻数
72
附带文件
2
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 2 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 PKU-YuanGroup 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Bio Free Energy Calculations AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/PKU-YuanGroup/OpenAI4S/tree/main/skills/bioskills/bio-chemoinformatics-free-energy-calculations
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/PKU-YuanGroup/OpenAI4S.git /tmp/OpenAI4S
mkdir -p .claude/skills
cp -r /tmp/OpenAI4S/skills/bioskills/bio-chemoinformatics-free-energy-calculations .claude/skills/bio-free-energy-calculations
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Bio Free Energy Calculations,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Bio Free Energy Calculations。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Bio Free Energy Calculations 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Version Compatibility

Reference examples tested with: OpenFE 1.7+, OpenMM 8.1+, GROMACS 2024+, AMBER pmemd 22+, alchemlyb 2.1+, pymbar 4.0+, RDKit 2024.09+.

Before using code patterns, verify installed versions match. If versions differ:

  • Python: pip show <package> then help(module.function) to check signatures
  • CLI: openfe --version; gmx --version; pmemd.cuda --version

If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.

Free Energy Calculations

Predict binding free-energy differences (RBFE) or standard binding free energies (ABFE) using alchemical methods. FEP+ is a commercial workflow and OpenFE is an open-source framework. Accuracy and cost vary substantially with system, perturbation, force field, setup, sampling, and evaluation design; report the protocol and benchmark relevant to the intended decision. The Boltz-2 report includes benchmark-specific comparisons with FEP methods but does not replace prospective validation on the project chemistry.

For docking input poses, see chemoinformatics/virtual-screening. For pose validation before FEP, see chemoinformatics/pose-validation. For ML alternatives, see chemoinformatics/ml-docking-rescoring.

FEP Method Taxonomy

MethodCost / pairAccuracyUse caseFails when
FEP+ (Schrödinger)System- and protocol-dependent GPU costPublished commercial RBFE workflowCommercial lead optimizationLicense and reproducibility constraints
OpenFE RBFESystem- and protocol-dependent GPU costOpen-source RBFE with documented protocolsOpen-source campaignsMapping/setup/sampling require review
OpenFE ABFEGenerally more setup and sampling than one RBFE edgeStandard binding free energyNo congeneric reference ligand requiredRestraints and end-state corrections
GROMACS / AMBER RBFEImplementation-dependentCustom alchemical workflowsExpert-controlled setupManual validation burden
FEP-SPell-ABFEProtocol/system-dependentAutomated ABFE workflowEvaluate published and project benchmarksLimited adoption
QligFEP v2.1Protocol/system-dependentQ-based ligand FEPEvaluate published and project benchmarksDifferent approximations/tooling
MM/PBSA / MM/GBSALower-cost endpoint analysisApproximate endpoint scoreExploratory within-series comparisonEntropy, sampling, and model dependence
Boltz-2 affinityseconds GPU0.66 Pearson on reported FEP benchmark subsetML alternative; reported >=1000x lower costNovel chemotypes
ALEPB / EE-AMBERProtocol/system-dependentSpecialized methodsEvaluate matched evidenceLimited tooling

Decision: For congeneric lead-optimization questions, evaluate a validated RBFE protocol and perturbation network. Use endpoint methods only for decisions supported by a project-specific benchmark. Candidate counts and escalation gates should follow compute budget, uncertainty, and prospective validation rather than a universal top-N rule.

Decision Tree by Scenario

ScenarioRecommended workflow
Rank close analogs (R-group SAR)RBFE via OpenFE (cycle: lig1↔lig2↔lig3)
Cross-scaffold rankingABFE per ligand; or coordinated RBFE with star network
Congeneric lead-optimization setRBFE with a connected, redundancy-aware perturbation graph
Single ligand affinityABFE (no reference needed)
Lower-cost exploratory rankingA project-validated endpoint or ML method, followed by orthogonal confirmation
Novel scaffold prospectiveTreat ML affinity as triage; validate selected decisions prospectively
Selectivity (target vs off-target)RBFE on both proteins; report delta-delta-G
Allosteric vs orthostericABFE comparable; check pose stability with MD
Ions / metal centersSpecialized force field (ZAFF, MCPB.py); not standard FEP

Relative Binding Free Energy (RBFE) Setup

Goal: Calculate delta-delta-G between two ligands (lig1 -> lig2) in pocket.

Approach: Alchemical transformation lig1 -> lig2 in both bound state (pocket + ligand + water) and unbound state (ligand + water alone). Thermodynamic cycle:

delta(delta-G_binding) = (delta-G_lig1->lig2 in pocket) - (delta-G_lig1->lig2 in solvent)
python
# OpenFE simplified setup (real usage requires complete protocol setup)
from openfe import SmallMoleculeComponent, ProteinComponent, SolventComponent
from openfe.protocols.openmm_rfe import RelativeHybridTopologyProtocol

protein = ProteinComponent.from_pdb_file('receptor.pdb')
ligA = SmallMoleculeComponent.from_sdf_file('ligand_A.sdf')
ligB = SmallMoleculeComponent.from_sdf_file('ligand_B.sdf')
solvent = SolventComponent()

protocol = RelativeHybridTopologyProtocol(
    RelativeHybridTopologyProtocol.default_settings()
)

The protocol object does not itself choose an atom mapping or define a simulation. Create or inspect a mapping (Kartograf is the OpenFE 1.7 CLI default; LOMAP is also supported), construct bound and solvent Transformation objects, create their protocol DAGs, and run them through openfe quickrun or the documented Python execution interface. Always inspect the selected mapping before running.

Lambda Window Scheduling

StageLambda valuesPurpose
Decoupling (vdW)0.0, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 1.0Turn off ligand vdW
Charging (Coulomb)0.0, 0.25, 0.5, 0.75, 1.0Turn off ligand partial charges
Restraint (ABFE only)0.0, 0.1, 0.3, 0.5, 0.7, 0.9, 1.0Boresch-style restraints

The 12-20 windows and 5-20 ns per-window ranges are repository starting ranges, not universal prescriptions. Select and extend them from overlap, exchange, and replicate-convergence diagnostics for the system; total cost therefore varies substantially.

Enhanced Sampling

REST2 (Replica Exchange with Solute Tempering) is one enhanced-sampling approach used in some FEP workflows. It scales selected interactions to improve barrier crossing, but suitability and implementation are engine- and protocol-specific.

In FEP+, REST2 region typically includes:

  • The entire ligand
  • Flexible binding-site loops
  • Catalytic / ionic residues with high pKa shift potential

FEP+ can use a configured REST2 region. OpenFE's RelativeHybridTopologyProtocol uses Hamiltonian replica exchange across its lambda states by default; that is not the same as REST2, and OpenFE does not automatically apply REST2. Use only enhanced-sampling modes supported and documented by the selected protocol and version.

MBAR/BAR Analysis

After production simulation, extract delta-G via MBAR (Multistate Bennett Acceptance Ratio) or BAR (Bennett Acceptance Ratio). MBAR uses data from all windows simultaneously; BAR uses adjacent windows.

python
from alchemlyb import concat
from alchemlyb.parsing import gmx
from alchemlyb.estimators import MBAR
from alchemlyb.postprocessors.units import to_kcalmol

u_nks = []
for window in range(12):
    df = gmx.extract_u_nk(f'window_{window}.xvg', T=300)
    u_nks.append(df)

u_nk = concat(u_nks)
mbar = MBAR().fit(u_nk)
delta_g = to_kcalmol(mbar.delta_f_).iloc[0, -1]
d_delta_g = to_kcalmol(mbar.d_delta_f_).iloc[0, -1]
print(f'delta-G: {delta_g:.2f} +/- {d_delta_g:.2f} kcal/mol')

MBAR.delta_f_ and d_delta_f_ are dimensionless (in kT) until explicitly converted. The parser shown above reads GROMACS XVG files. For other engines, use the engine-specific parser supported by the installed alchemlyb version.

Cycle Closure Analysis

For a single directed thermodynamic cycle, the signed closure residual is the sum of its edges and should be consistent with zero within uncertainty. An RMS closure statistic requires residuals from multiple cycles and a stated aggregation convention.

python
def cycle_closure_residual(cycle):
    # cycle is list of edges, each (lig_i, lig_j, delta_g, sd)
    total = sum(d_g for _, _, d_g, _ in cycle)
    total_var = sum(sd**2 for _, _, _, sd in cycle)
    return total, total_var ** 0.5

Interpret each closure residual relative to propagated edge uncertainties, replicate behavior, shared-edge correlations, network topology, and the decision supported. If reporting RMS across cycles, state which cycles were included and avoid treating correlated cycles as independent observations.

Absolute Binding Free Energy (ABFE)

ABFE computes delta-G of binding for a single ligand (no reference compound).

Goal: Estimate the standard binding free energy of a single ligand prospectively. Conversion to an equilibrium dissociation constant requires an explicit standard-state convention; ABFE does not generically predict an assay Ki.

Approach: Decouple ligand from solvated state and from pocket-bound state separately; correction terms for analytical end states.

Use OpenFE's documented AbsoluteBindingProtocol workflow: construct the ligand and complex chemical systems, select and inspect the restraint setup, create the corresponding Transformation objects, serialize them with Transformation.to_json(), and execute each transformation with openfe quickrun. Do not substitute an ad hoc absolute-free-energy CLI; OpenFE does not provide that command.

ABFE is harder than RBFE: requires Boresch-style restraints to keep ligand near pocket during decoupling. Restraint contribution must be analytically corrected.

ABFE cost relative to RBFE depends on the protocols, number of legs/windows/repeats, and convergence requirements; estimate it from the explicit campaign plan.

MM/PBSA, MM/GBSA Endpoint Methods

Lower-cost endpoint alternatives whose usefulness must be established on a matched benchmark:

bash
# MM/GBSA via AMBER MMPBSA.py
MMPBSA.py -i input.in -cp complex.parm7 -rp receptor.parm7 \
          -lp ligand.parm7 -y trajectory.nc

Sample input:

&general
  startframe = 100, endframe = 1000, interval = 10
/
&gb
  igb = 5
/
&pb
  istrng = 0.150
/

Use case: Exploratory ranking when a matched retrospective benchmark shows the endpoint method supports the intended decision. Do not transfer generic correlation ranges across targets or protocols.

Force Field Selection

Force fieldUse forNotes
OPLS4 (Schrödinger)FEP+ defaultCommercial; well-tested
OpenFF 2.1.1 (Sage)OpenFE 1.7 documented defaultInspect serialized settings; newer OpenFE releases use different defaults
GAFF2AMBER FEPUse for ligand only; protein FF14SB
GAFFLegacyReplaced by GAFF2
CGenFFCHARMM-style FEPCHARMM force-field family
ANI-2xMixed QM/MMExperimental for FEP
MACE-OFFModern ML force fieldPromising for FEP, limited tooling

For OpenFE 1.7, the versioned documentation shows OpenFF 2.1.1 for the ligand and Amber-family protein/water XMLs including ff14SB and TIP3P. Inspect and serialize the actual protocol settings because defaults change between releases.

Per-Tool Failure Modes

Insufficient sampling

Trigger: Production length is insufficient for a slow ligand or protein degree of freedom.

Mechanism: Replica exchange improves state mixing but is not a panacea; some conformational changes remain slow.

Symptom: Replicates, time-sliced estimates, overlap/exchange diagnostics, or closure residuals are inconsistent with the reported uncertainty.

Fix: Increase sampling, inspect exchange and state overlap, run independent repeats, and investigate slow protein/ligand degrees of freedom. Use only protocol-supported enhanced sampling; check whether the pose is genuinely stable.

Force-field artifacts

Trigger: Charged ligand or charged pocket residue.

Mechanism: GAFF2/SAGE may misparameterize unusual functional groups (perfluoro, charged sulfonate near Asp/Glu).

Symptom: A transformation is an outlier relative to experiment, replicates, or network consistency.

Fix: Visual inspection; check ligand topology with rdkit; consider non-bonded fix or fragment-specific parameters.

Mapping ambiguity

Trigger: Two ligands differ in scaffold (not just R-groups).

Mechanism: LOMAP atom mapping may not find good correspondence; results from ambiguous mappings unreliable.

Symptom: Mapping score low; large dummy-atom count; cycle closure errors.

Fix: Manual mapping using OpenFE's editor; or use ABFE per ligand instead of RBFE.

Restraint contribution wrong (ABFE)

Trigger: Boresch restraint applied to flexible region of ligand.

Mechanism: Analytical restraint correction assumes harmonic potential at well-defined minimum.

Symptom: ABFE shows a systematic offset or strong sensitivity to restraint choices.

Fix: Choose Boresch restraint atoms from rigid ligand core; not flexible side chains.

MM/GBSA -- bias from entropy missing

Trigger: Comparing ligands of very different size.

Mechanism: MM/GBSA misses entropy contribution; larger ligands appear more favorable.

Symptom: Larger ligands always rank higher.

Fix: Use MM/GBSA only for within-series ranking; supplement with FEP for cross-size.

Boltz-2 affinity -- chemotype OOD

Trigger: Novel chemotype outside training distribution.

Mechanism: Boltz-2 affinity training uses standardized public biochemical-assay data, including PubChem and ChEMBL sources, alongside its structural training. Novel targets, chemotypes, and assay contexts can still extrapolate.

Symptom: Boltz-2 affinity and FEP affinity disagree.

Fix: Use Boltz-2 as a benchmarked triage model and validate selected candidates with orthogonal computation and experiment. Do not interpret structure-confidence outputs as calibrated affinity intervals.

Reconciliation: FEP+ vs OpenFE

AspectFEP+OpenFE
Force fieldOPLS4 (proprietary)OpenFF 2.1.1 in versioned OpenFE 1.7 defaults; inspect serialized settings
WorkflowSchrödinger GUIPython CLI/API
Atom mappingProduct workflowKartograf CLI default in OpenFE 1.7; LOMAP also supported
Reported accuracyBenchmark-dependentBenchmark-dependent; compare matched protocols and systems
CostSchrödinger licenseFree + compute time
DecisionCommercial team defaultOpen-source / academic / cost-sensitive

Choose OpenFE or a commercial workflow according to validated performance, auditability, available expertise, licensing, and integration requirements.

Common Errors

SymptomCauseFix
Lambda window simulation divergesBad initial poseRe-relax pose with MM minimization first
Closure residual is inconsistent with propagated uncertainty or independent repeatsSampling, mapping, force-field, or correlated-edge issueInspect signed residuals, overlap, mapping, and independent repeats before extending sampling
MBAR returns NaNInsufficient overlap between windowsAdd intermediate lambda windows
Restraint contribution wrongBoresch atoms on flexible regionChoose 3 atoms on rigid ligand core
Slow binding-site rearrangementStandard sampling does not cross the barrierIncrease sampling/repeats and use only engine- and protocol-documented enhanced sampling
ABFE systematic offsetRestraint, standard-state, sampling, or force-field issueInspect the protocol's documented restraint/free-energy terms and signs; do not invent an ad hoc correction variable
MM/GBSA rmsd doesn't match dockingDifferent trajectory framesCompute MM/GBSA on MD-relaxed pose

References

  • Mey ASJS et al., Living J. Comput. Mol. Sci. 2:18378 (2020) -- alchemical free-energy best practices (DOI 10.33011/livecoms.2.1.18378).
  • Wang L et al., J. Am. Chem. Soc. 137:2695-2703 (2015) -- FEP+ method (DOI 10.1021/ja512751q).
  • Open Free Energy developers. OpenFE software, Zenodo (2023-present) -- open-source alchemical free-energy framework (DOI 10.5281/zenodo.8344247).
  • Cournia Z et al., J. Chem. Inf. Model. 60:4153-4169 (2020) -- rigorous ABFE as a final stage in virtual screening (DOI 10.1021/acs.jcim.0c00116).
  • Aldeghi M, Bluck JP, Biggin PC. Methods Mol. Biol. 1762:199-232 (2018) -- beginner's guide to absolute alchemical ligand-binding free energies (DOI 10.1007/978-1-4939-7756-7_11).
  • Passaro S et al. bioRxiv (2025) -- Boltz-2 affinity prediction preprint (DOI 10.1101/2025.06.14.659707).
  • Shirts MR, Chodera JD. J. Chem. Phys. 129:124105 (2008) -- MBAR (DOI 10.1063/1.2978177).
  • Bennett CH. J. Comput. Phys. 22:245-268 (1976) -- BAR (DOI 10.1016/0021-9991(76)90078-4).
  • OpenFE 1.7 documentation: https://docs.openfree.energy/en/v1.7.0/
  • alchemlyb documentation: https://alchemlyb.readthedocs.io/

Related Skills

  • chemoinformatics/virtual-screening - Source poses for FEP input
  • chemoinformatics/pose-validation - PoseBusters-validate before FEP
  • chemoinformatics/conformer-generation - Generate ligand 3D for FEP setup
  • chemoinformatics/molecular-standardization - Standardize ligand before FEP
  • chemoinformatics/ml-docking-rescoring - Boltz-2 affinity as alternative
  • chemoinformatics/qsar-modeling - Surrogate models for high-throughput

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Bio Free Energy Calculations AI 技能有什么作用?

通过 OpenFE、FEP+、GROMACS、AMBER pmemd 和 OpenMM 执行炼金自由能计算,包括相对结合自由能(RBFE / FEP+)和绝对结合自由能(ABFE),并明确设置 lambda 调度、软核势、MBAR/BAR 分析、循环闭合验证,以及适合相应方案的增强采样。比较 ML 替代方案(Boltz-2 affinity、DeepDock)。适用于在对接精度之外按结合亲和力为类似物排序、开展前瞻性先导化合物优化,或验证 SAR 预测。

为什么在 TypingMind 中使用 Bio Free Energy Calculations?

因为您只需安装一次,就能搭配任何模型使用。Bio Free Energy Calculations 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Bio Free Energy Calculations?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/PKU-YuanGroup/OpenAI4S/tree/main/skills/bioskills/bio-chemoinformatics-free-energy-calculations。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Bio Free Energy Calculations?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Bio Free Energy Calculations 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Bio Free Energy Calculations 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Bio Free Energy Calculations AI 技能免费吗?

是的。PKU-YuanGroup 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇