Capture structure-track deps + pose entrypoint
- gpu/modal_app.py: add the `pose` local entrypoint used for the HDAC2 pose-RMSD validation (run: `modal run gpu/modal_app.py::pose`). - pyproject [structure] extra: add the deps we actually use locally (gemmi, spyrmsd, meeko, modal) for reproducibility; document the non-pip tools (Vina binary, open-babel) and that Boltz/cuequivariance are Modal-image-only. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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."""
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user