diff --git a/gpu/modal_app.py b/gpu/modal_app.py index a6effdf..65dfc83 100644 --- a/gpu/modal_app.py +++ b/gpu/modal_app.py @@ -164,6 +164,27 @@ def cofold(label: str, protein_seq: str, ligand_smiles: str, cofactor_ccds: list # ------------------------------------------------------------------------------- driver (local) +@app.local_entrypoint() +def pose() -> None: + """Save the predicted HDAC2/vorinostat complex for local pose-RMSD validation. + + Run: `modal run gpu/modal_app.py::pose`. Weights are cached, so this is one fast GPU call. + The returned PDB (protein + vorinostat + Zn) is scored locally against 4LXZ by + scripts/pose_rmsd.py (align predicted protein to crystal, compare ligand). + """ + target = "HDAC2" + pdb, res, drug, cofactors = TARGETS[target] + seq = binding_chain_sequence(pdb, res) + r = cofold.remote(f"{target}_{drug}_pose", seq, pubchem_smiles(drug), cofactors) + out = Path("data/processed/binding"); out.mkdir(parents=True, exist_ok=True) + if r.get("structure"): + dest = out / f"{target}_{drug}_pred.pdb" + dest.write_text(r["structure"]) + print(f"saved {dest}; affinity={r['affinity']}, P(binder)={r['prob_binder']}") + else: + print("no structure returned") + + @app.local_entrypoint() def main() -> None: """Fan out one GPU call per (target, ligand) pair; tabulate affinities; positive-control test.""" diff --git a/pyproject.toml b/pyproject.toml index 7487a83..3ee4d40 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,11 +33,17 @@ dev = [ "pytest>=8.0", "ruff>=0.5", ] -# Structure-based binding track (PLAN §12). Docking tool (vina/smina) is NOT pip-installable on -# ARM Mac — install via conda/micromamba or use a GPU AF3-class model; see docs/structure_binding_notes.md. +# Structure-based binding track (PLAN §12); see docs/structure_binding_notes.md. +# Non-pip tools (install separately): AutoDock Vina binary (tools/vina, from the AutoDock-Vina +# GitHub release) and open-babel (brew). Boltz-2 + cuequivariance run only in the Modal GPU image +# (gpu/modal_app.py), not locally. structure = [ - "rdkit>=2024.3", - "requests>=2.31", + "rdkit>=2024.3", # ligand prep, fingerprints + "requests>=2.31", # PubChem / RCSB fetch + "gemmi>=0.6", # structure parsing + superposition + "spyrmsd>=0.9", # symmetry-corrected pose RMSD + "meeko>=0.7", # production docking ligand prep + "modal>=1.5", # ephemeral GPU orchestration ] [tool.setuptools.packages.find]