Skip to content
Apex
All recipes
Drug discovery

Run a FEP+ binding-affinity campaign over a ligand library

Score a 120-ligand library against four protein targets with alchemical FEP. Returns relative ΔΔG and per-edge uncertainty.

Artefact returned
Ranked ligand list · ΔΔG table · convergence diagnostics
Typical runtime
~6 h wall · 1,200 CU
Cost
≈ $3.8k campaign + Team seats
01 · The recipe

The expanded snippet.

The version that lands in production — with the annotations a colleague would want when picking up the work. Copy-paste, swap in your inputs, run.

from apex import Aether

simos = Aether(api_key=os.environ["APEX_API_KEY"])

# Score a 120-ligand library across four protein targets using alchemical FEP+.
# Returns relative binding free energies vs the reference ligand and per-edge
# standard error. Run committed for production campaigns.
campaign = simos.fep(
    targets=["pdb:1abc", "pdb:2def", "pdb:3ghi", "pdb:4jkl"],
    library="s3://my-bucket/ligands.sdf",
    reference="ligand_001",
    method="fep+",
    forcefield="opls4",
    convergence={
        "target_se_kcal_per_mol": 0.3,
        "max_wall_time_h": 12,
    },
    committed=True,
)

# Stream results as edges converge.
for edge in campaign.edges(stream=True):
    if edge.converged:
        print(
            f"{edge.target}  {edge.ligand}  "
            f"ddG = {edge.ddg_kcal_per_mol:+.2f}  se = {edge.se:.2f}"
        )

# Top-10 by mean ddG across all four targets.
ranked = campaign.rank(across="targets", policy="mean_ddg_ascending")
for r in ranked[:10]:
    print(r.ligand, r.mean_ddg, r.per_target)
02 · Reproduction notes

The numbers in this recipe are real.

What we ran. What we used for inputs. Where the reproduction kit lives, and what reproduces within published bounds.

  • 01Library: SDF with explicit hydrogens. The cookbook repo ships a 120-ligand panel under CC-BY.
  • 02Targets: four kinase structures from the PDB. Apo and holo states both supported.
  • 03Reproduces the FEP+ 8-target benchmark at 1.06 kcal/mol RMSE on Bio 12B.
  • 04Wall time scales with library size × targets; estimate uses 120 ligands × 4 targets.
03 · How to adapt this

Make it your workload.

The recipe is a starting point. The four variations below are the ones we get asked about most. Anything else, write to docs@apexworldlabs.com.

  • Larger libraries: just point library= at a bigger SDF or a Parquet manifest. The runtime parallelises across edges.
  • Different force field: opls4, amber99sb-ildn, charmm36m are supported. Custom force fields under enterprise.
  • Add covalent ligands: pass covalent=True and the runtime applies the alchemical-attachment protocol.
  • Add metadynamics: pass enhanced_sampling="metadynamics" for systems with significant conformational sampling needs.

Adapt this to your stack.

Swap in your geometry / target / repo and run it. If your workload is novel, send it and we will co-author the recipe with you.