Skip to content

Commit e1c19b5

Browse files
authored
Merge branch 'main' into feat/add_worker_based_execution
2 parents 1ab7664 + 1290daa commit e1c19b5

3 files changed

Lines changed: 271 additions & 68 deletions

File tree

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ ci:
66
files: (^notebooks)
77
repos:
88
- repo: https://github.com/psf/black-pre-commit-mirror
9-
rev: 26.3.1
9+
rev: 26.5.1
1010
hooks:
1111
- id: black
1212
- repo: https://github.com/psf/black-pre-commit-mirror
13-
rev: 26.3.1
13+
rev: 26.5.1
1414
hooks:
1515
- id: black-jupyter

abfe_tutorial/abfe_analysis.ipynb

Lines changed: 103 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"text": [
3636
" % Total % Received % Xferd Average Speed Time Time Time Current\n",
3737
" Dload Upload Total Spent Left Speed\n",
38-
"100 3092k 100 3092k 0 0 432k 0 0:00:07 0:00:07 --:--:-- 501k\n",
38+
"100 3092k 100 3092k 0 0 1588k 0 0:00:01 0:00:01 --:--:-- 1587k\n",
3939
"Archive: abfe_results.zip\n",
4040
" inflating: abfe_results/README.md \n",
4141
" inflating: abfe_results/abfe_results_single_unit/results_2/1.json \n",
@@ -53,6 +53,92 @@
5353
"!unzip -o abfe_results.zip"
5454
]
5555
},
56+
{
57+
"cell_type": "markdown",
58+
"id": "0e15f538-1471-440f-b590-866a2258f0c7",
59+
"metadata": {},
60+
"source": [
61+
"## Analysing results from the command line\n",
62+
"\n",
63+
"The quickest way to get free energies out of your `openfe quickrun` results is\n",
64+
"`openfe gather-abfe`, which reads the result JSON files and prints a report\n",
65+
"directly. The default `--report dg` gives the overall binding free energy per\n",
66+
"ligand; `--report raw` gives the per-leg (complex and solvent) values. Add\n",
67+
"`-o out.tsv` to write a tab-separated file instead of printing, and\n",
68+
"`--allow-partial` to skip incomplete edges with a warning.\n",
69+
"\n",
70+
"*Note: `openfe gather-abfe` is currently experimental and may change in a future\n",
71+
"openfe release. It will also print an experimental-feature warning to stderr.*"
72+
]
73+
},
74+
{
75+
"cell_type": "code",
76+
"execution_count": 2,
77+
"id": "7bb3c09c-4aff-4e6a-9b39-4d0318b2a71b",
78+
"metadata": {},
79+
"outputs": [
80+
{
81+
"name": "stdout",
82+
"output_type": "stream",
83+
"text": [
84+
"\u001b[33mWARNING! Gathering of ABFE results with `openfe gather-abfe` is an experimental feature and is subject to change in a future release of openfe.\u001b[0m\n",
85+
"┌────────┬───────────────┬────────────────────────────────┐\n",
86+
"\u001b[1m \u001b[0m\u001b[1mligand\u001b[0m\u001b[1m \u001b[0m│\u001b[1m \u001b[0m\u001b[1mDG (kcal/mol)\u001b[0m\u001b[1m \u001b[0m│\u001b[1m \u001b[0m\u001b[1mstd dev uncertainty (kcal/mol)\u001b[0m\u001b[1m \u001b[0m│\n",
87+
"├────────┼───────────────┼────────────────────────────────┤\n",
88+
"│ 1 │ -20.87 │ 0.58 │\n",
89+
"└────────┴───────────────┴────────────────────────────────┘\n"
90+
]
91+
}
92+
],
93+
"source": [
94+
"# overall binding free energy (DG) per ligand\n",
95+
"!openfe gather-abfe abfe_results/abfe_results_multiple_units --report dg"
96+
]
97+
},
98+
{
99+
"cell_type": "code",
100+
"execution_count": 3,
101+
"id": "89f51d9d-1ea8-4d12-8d7c-7bce2dd6666a",
102+
"metadata": {},
103+
"outputs": [
104+
{
105+
"name": "stdout",
106+
"output_type": "stream",
107+
"text": [
108+
"\u001b[33mWARNING! Gathering of ABFE results with `openfe gather-abfe` is an experimental feature and is subject to change in a future release of openfe.\u001b[0m\n",
109+
"┌──────────────────────────┬────────┬───────────────┬──────────────────────────┐\n",
110+
"\u001b[1m \u001b[0m│\u001b[1m \u001b[0m│\u001b[1m \u001b[0m│\u001b[1m \u001b[0m\u001b[1mMBAR uncertainty \u001b[0m\u001b[1m \u001b[0m│\n",
111+
"\u001b[1m \u001b[0m\u001b[1mleg \u001b[0m\u001b[1m \u001b[0m│\u001b[1m \u001b[0m\u001b[1mligand\u001b[0m\u001b[1m \u001b[0m│\u001b[1m \u001b[0m\u001b[1mDG (kcal/mol)\u001b[0m\u001b[1m \u001b[0m│\u001b[1m \u001b[0m\u001b[1m(kcal/mol) \u001b[0m\u001b[1m \u001b[0m│\n",
112+
"├──────────────────────────┼────────┼───────────────┼──────────────────────────┤\n",
113+
"│ complex │ 1 │ 36.34 │ 0.91 │\n",
114+
"│ complex │ 1 │ 36.17 │ 0.80 │\n",
115+
"│ complex │ 1 │ 34.77 │ 0.81 │\n",
116+
"│ solvent │ 1 │ 6.5 │ 1.4 │\n",
117+
"│ solvent │ 1 │ 5.4 │ 1.4 │\n",
118+
"│ solvent │ 1 │ 5.5 │ 1.4 │\n",
119+
"│ standard_state_correcti… │ 1 │ -8.9 │ 0.0 │\n",
120+
"│ standard_state_correcti… │ 1 │ -9.3 │ 0.0 │\n",
121+
"│ standard_state_correcti… │ 1 │ -9.0 │ 0.0 │\n",
122+
"└──────────────────────────┴────────┴───────────────┴──────────────────────────┘\n"
123+
]
124+
}
125+
],
126+
"source": [
127+
"# raw per-leg (complex, solvent, and Boresch-restraint analytical correction) values\n",
128+
"!openfe gather-abfe abfe_results/abfe_results_multiple_units --report raw"
129+
]
130+
},
131+
{
132+
"cell_type": "markdown",
133+
"id": "7e0ce0ab-0777-44b2-b865-7eaedaba57d9",
134+
"metadata": {},
135+
"source": [
136+
"## Analysing results with the Python API\n",
137+
"\n",
138+
"For more control over how results are combined and analysed, you can work with\n",
139+
"the result JSONs directly in Python, as shown in the rest of this notebook."
140+
]
141+
},
56142
{
57143
"cell_type": "markdown",
58144
"id": "f2cff1e7-cf62-4839-b53d-62b59b7189b6",
@@ -64,7 +150,7 @@
64150
},
65151
{
66152
"cell_type": "code",
67-
"execution_count": 2,
153+
"execution_count": 4,
68154
"id": "7fbf1482-25ca-427b-a881-af88a983461c",
69155
"metadata": {},
70156
"outputs": [],
@@ -95,7 +181,7 @@
95181
},
96182
{
97183
"cell_type": "code",
98-
"execution_count": 3,
184+
"execution_count": 5,
99185
"id": "08afcbcf-34a8-4450-a967-eb4ed5800ee1",
100186
"metadata": {},
101187
"outputs": [],
@@ -127,7 +213,7 @@
127213
},
128214
{
129215
"cell_type": "code",
130-
"execution_count": 4,
216+
"execution_count": 6,
131217
"id": "04ccdedd-84e3-4ccc-ae42-4f3772acb115",
132218
"metadata": {},
133219
"outputs": [],
@@ -173,7 +259,7 @@
173259
},
174260
{
175261
"cell_type": "code",
176-
"execution_count": 5,
262+
"execution_count": 7,
177263
"id": "3733c540-de62-45a0-ba66-268397a38b49",
178264
"metadata": {},
179265
"outputs": [],
@@ -241,7 +327,7 @@
241327
},
242328
{
243329
"cell_type": "code",
244-
"execution_count": 6,
330+
"execution_count": 8,
245331
"id": "0621e3a2-7906-4661-a640-c414456f8869",
246332
"metadata": {},
247333
"outputs": [],
@@ -279,7 +365,7 @@
279365
},
280366
{
281367
"cell_type": "code",
282-
"execution_count": 7,
368+
"execution_count": 9,
283369
"id": "5821b7f7-6aed-4138-9502-44df3af52647",
284370
"metadata": {},
285371
"outputs": [],
@@ -311,7 +397,7 @@
311397
},
312398
{
313399
"cell_type": "code",
314-
"execution_count": 8,
400+
"execution_count": 10,
315401
"id": "e021b2ea-db13-4e47-a6d1-cf5229b5b494",
316402
"metadata": {},
317403
"outputs": [],
@@ -352,7 +438,7 @@
352438
},
353439
{
354440
"cell_type": "code",
355-
"execution_count": 9,
441+
"execution_count": 11,
356442
"id": "b077c4e2-373a-4314-a527-186bb4683262",
357443
"metadata": {},
358444
"outputs": [],
@@ -407,7 +493,7 @@
407493
},
408494
{
409495
"cell_type": "code",
410-
"execution_count": 10,
496+
"execution_count": 12,
411497
"id": "7bc49c0e-6fec-409c-a01c-42c35f57dcc6",
412498
"metadata": {},
413499
"outputs": [],
@@ -430,7 +516,7 @@
430516
},
431517
{
432518
"cell_type": "code",
433-
"execution_count": 11,
519+
"execution_count": 13,
434520
"id": "46996a74-709c-41f2-ac39-0f77fb33371e",
435521
"metadata": {},
436522
"outputs": [],
@@ -441,7 +527,7 @@
441527
},
442528
{
443529
"cell_type": "code",
444-
"execution_count": 12,
530+
"execution_count": 14,
445531
"id": "d1a6ad61-1e5a-4d8a-9067-9ed428ef145c",
446532
"metadata": {},
447533
"outputs": [
@@ -487,7 +573,7 @@
487573
"0 1 -20.87 0.47"
488574
]
489575
},
490-
"execution_count": 12,
576+
"execution_count": 14,
491577
"metadata": {},
492578
"output_type": "execute_result"
493579
}
@@ -507,7 +593,7 @@
507593
},
508594
{
509595
"cell_type": "code",
510-
"execution_count": 13,
596+
"execution_count": 15,
511597
"id": "8b2c1dd8-ffa3-4585-94a7-4a1ed1454f30",
512598
"metadata": {},
513599
"outputs": [],
@@ -518,7 +604,7 @@
518604
},
519605
{
520606
"cell_type": "code",
521-
"execution_count": 14,
607+
"execution_count": 16,
522608
"id": "08b72901-9c71-460b-b5da-9fb4a35e07f7",
523609
"metadata": {},
524610
"outputs": [
@@ -630,22 +716,14 @@
630716
"8 standard_state_correction 1 -9.0 0.0"
631717
]
632718
},
633-
"execution_count": 14,
719+
"execution_count": 16,
634720
"metadata": {},
635721
"output_type": "execute_result"
636722
}
637723
],
638724
"source": [
639725
"df_raw"
640726
]
641-
},
642-
{
643-
"cell_type": "code",
644-
"execution_count": null,
645-
"id": "bf160a28-3aa1-4661-8f06-3a4a71d34ff2",
646-
"metadata": {},
647-
"outputs": [],
648-
"source": []
649727
}
650728
],
651729
"metadata": {
@@ -664,7 +742,7 @@
664742
"name": "python",
665743
"nbconvert_exporter": "python",
666744
"pygments_lexer": "ipython3",
667-
"version": "3.12.13"
745+
"version": "3.13.11"
668746
},
669747
"widgets": {
670748
"application/vnd.jupyter.widget-state+json": {

0 commit comments

Comments
 (0)