Skip to content

Commit a1fa7ba

Browse files
authored
feat: bumped version of ABFE (#233)
1 parent f16012a commit a1fa7ba

File tree

3 files changed

+32
-13
lines changed

3 files changed

+32
-13
lines changed

notebooks/abfe.py

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ def _():
3434
@app.cell
3535
def _():
3636
sim = Complex.from_dir(EXAMPLE_DATA_DIR)
37-
sim.connect()
3837
return (sim,)
3938

4039

@@ -44,6 +43,26 @@ def _(sim):
4443
return
4544

4645

46+
@app.cell(hide_code=True)
47+
def _():
48+
mo.md(
49+
r"""
50+
## System preparation
51+
52+
Before we start a ABFE run, we can prepare the system using `sim.prepare`. Doing so shows a preview of the prepared system.
53+
54+
55+
"""
56+
)
57+
return
58+
59+
60+
@app.cell
61+
def _(sim):
62+
sim.prepare(ligand=sim.ligands[0])
63+
return
64+
65+
4766
@app.cell(hide_code=True)
4867
def _():
4968
mo.md(
@@ -64,9 +83,11 @@ def _():
6483

6584

6685
@app.cell
67-
def _():
68-
# sim.abfe.run_end_to_end(ligand_ids=["Ligands-1"])
69-
return
86+
def _(sim):
87+
sim.abfe.set_test_run()
88+
jobs = sim.abfe.run_end_to_end(ligands=[sim.ligands[0]])
89+
this_job = jobs[0]
90+
return (this_job,)
7091

7192

7293
@app.cell(hide_code=True)
@@ -82,9 +103,8 @@ def _():
82103

83104

84105
@app.cell
85-
def _(sim):
86-
job = sim.abfe.jobs[0]
87-
job
106+
def _(this_job):
107+
this_job
88108
return
89109

90110

@@ -101,8 +121,8 @@ def _():
101121

102122

103123
@app.cell
104-
def _():
105-
# job.cancel()
124+
def _(this_job):
125+
this_job.cancel()
106126
return
107127

108128

src/drug_discovery/abfe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class ABFE(WorkflowStep):
2828
Objects instantiated here are meant to be used within the Complex class."""
2929

3030
"""tool version to use for ABFE"""
31-
tool_version = "0.2.6"
31+
tool_version = "0.2.7"
3232
_tool_key = "deeporigin.abfe-end-to-end" # Tool key for ABFE jobs
3333

3434
_max_atom_count: int = 100_000

src/drug_discovery/structures/ligand.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
ligand.visualize()
5454
"""
5555

56-
# from deeporigin.drug_discovery.utilities.props import predict_properties, protonate
5756
from dataclasses import dataclass, field
5857
import os
5958
from pathlib import Path
@@ -979,9 +978,9 @@ def show_ligands(ligands: list[Ligand]):
979978
# re‑index your DataFrame
980979
df = df[new_order]
981980

982-
from deeporigin.utils.notebook import _in_marimo
981+
from deeporigin.utils.notebook import get_notebook_environment
983982

984-
if _in_marimo():
983+
if get_notebook_environment() == "marimo":
985984
import marimo as mo
986985

987986
return mo.plain(df)

0 commit comments

Comments
 (0)