Skip to content

Commit 8c6181e

Browse files
committed
clean up output
1 parent 71ff04c commit 8c6181e

1 file changed

Lines changed: 91 additions & 51 deletions

File tree

cookbook/openfold3_to_openfe.ipynb

Lines changed: 91 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@
227227
"\n",
228228
"<div class=\"alert alert-block alert-warning\"> \n",
229229
"⚠️ <b>Important Note:</b>\n",
230-
" Here we use the first model for each complex predicted by OpenFold3. In practice you would filter through all predicted models, possibly using pose busters (https://github.com/maabuu/posebusters) and some other scoring metrics to identify the most plausible inputs.\n",
230+
" Here we use the first model for each complex predicted by OpenFold3. In practice you would filter through all predicted models, possibly using pose busters (github.com/maabuu/posebusters) and some other scoring metrics to identify the most plausible inputs.\n",
231231
"</div>"
232232
]
233233
},
@@ -264,9 +264,7 @@
264264
"cell_type": "code",
265265
"execution_count": 4,
266266
"id": "25ef33bf-fb1a-45da-96e4-004f77ef7d34",
267-
"metadata": {
268-
"scrolled": true
269-
},
267+
"metadata": {},
270268
"outputs": [
271269
{
272270
"name": "stdout",
@@ -292,25 +290,25 @@
292290
"text": [
293291
"/Users/atravitz/micromamba/envs/openfe-notebooks/lib/python3.13/site-packages/MDAnalysis/coordinates/PDB.py:885: UserWarning: Unit cell dimensions not found. CRYST1 record set to unitary values.\n",
294292
" warnings.warn(\n",
295-
"[11:04:36] WARNING: More than one matching pattern found - picking one\n",
293+
"[15:27:28] WARNING: More than one matching pattern found - picking one\n",
296294
"\n",
297-
"[11:04:36] WARNING: More than one matching pattern found - picking one\n",
295+
"[15:27:28] WARNING: More than one matching pattern found - picking one\n",
298296
"\n",
299-
"[11:04:36] WARNING: More than one matching pattern found - picking one\n",
297+
"[15:27:28] WARNING: More than one matching pattern found - picking one\n",
300298
"\n",
301-
"[11:04:36] WARNING: More than one matching pattern found - picking one\n",
299+
"[15:27:28] WARNING: More than one matching pattern found - picking one\n",
302300
"\n",
303-
"[11:04:36] WARNING: More than one matching pattern found - picking one\n",
301+
"[15:27:28] WARNING: More than one matching pattern found - picking one\n",
304302
"\n",
305-
"[11:04:36] WARNING: More than one matching pattern found - picking one\n",
303+
"[15:27:29] WARNING: More than one matching pattern found - picking one\n",
306304
"\n",
307-
"[11:04:36] WARNING: More than one matching pattern found - picking one\n",
305+
"[15:27:29] WARNING: More than one matching pattern found - picking one\n",
308306
"\n",
309-
"[11:04:36] WARNING: More than one matching pattern found - picking one\n",
307+
"[15:27:29] WARNING: More than one matching pattern found - picking one\n",
310308
"\n",
311-
"[11:04:36] WARNING: More than one matching pattern found - picking one\n",
309+
"[15:27:29] WARNING: More than one matching pattern found - picking one\n",
312310
"\n",
313-
"[11:04:36] WARNING: More than one matching pattern found - picking one\n",
311+
"[15:27:29] WARNING: More than one matching pattern found - picking one\n",
314312
"\n"
315313
]
316314
}
@@ -373,19 +371,19 @@
373371
"name": "stderr",
374372
"output_type": "stream",
375373
"text": [
376-
"[11:04:36] WARNING: More than one matching pattern found - picking one\n",
374+
"[15:27:29] WARNING: More than one matching pattern found - picking one\n",
377375
"\n",
378-
"[11:04:36] WARNING: More than one matching pattern found - picking one\n",
376+
"[15:27:29] WARNING: More than one matching pattern found - picking one\n",
379377
"\n",
380-
"[11:04:36] WARNING: More than one matching pattern found - picking one\n",
378+
"[15:27:29] WARNING: More than one matching pattern found - picking one\n",
381379
"\n",
382-
"[11:04:36] WARNING: More than one matching pattern found - picking one\n",
380+
"[15:27:29] WARNING: More than one matching pattern found - picking one\n",
383381
"\n",
384-
"[11:04:37] WARNING: More than one matching pattern found - picking one\n",
382+
"[15:27:29] WARNING: More than one matching pattern found - picking one\n",
385383
"\n",
386-
"[11:04:37] WARNING: More than one matching pattern found - picking one\n",
384+
"[15:27:29] WARNING: More than one matching pattern found - picking one\n",
387385
"\n",
388-
"[11:04:37] WARNING: More than one matching pattern found - picking one\n",
386+
"[15:27:29] WARNING: More than one matching pattern found - picking one\n",
389387
"\n"
390388
]
391389
},
@@ -409,11 +407,11 @@
409407
"name": "stderr",
410408
"output_type": "stream",
411409
"text": [
412-
"[11:04:37] WARNING: More than one matching pattern found - picking one\n",
410+
"[15:27:29] WARNING: More than one matching pattern found - picking one\n",
413411
"\n",
414-
"[11:04:37] WARNING: More than one matching pattern found - picking one\n",
412+
"[15:27:29] WARNING: More than one matching pattern found - picking one\n",
415413
"\n",
416-
"[11:04:37] WARNING: More than one matching pattern found - picking one\n",
414+
"[15:27:29] WARNING: More than one matching pattern found - picking one\n",
417415
"\n"
418416
]
419417
}
@@ -430,7 +428,7 @@
430428
" ligand = pdb.name.split('_seed')[0]\n",
431429
" mob = mda.Universe(pdb)\n",
432430
"\n",
433-
" # 2) Align mobile → reference using protein backbone\n",
431+
" # Align mobile → reference using protein backbone\n",
434432
" ref_prot = ref.select_atoms(\"protein and backbone\")\n",
435433
" mob_prot = mob.select_atoms(\"protein and backbone\")\n",
436434
" \n",
@@ -461,7 +459,7 @@
461459
"id": "fe3ca792-4615-4be3-8a41-feb0819e968d",
462460
"metadata": {},
463461
"source": [
464-
"<div class=\"alert alert-block alert-danger\"> \n",
462+
"<div class=\"alert alert-block alert-warning\"> \n",
465463
"⚠️ <b>Important Note:</b>\n",
466464
" <br><br>\n",
467465
" Here simply we assign ligand protonation states to those we defined at the start of this exercise. Additionally, below we will assign protein protonation states using PDBFixer at pH 7 without accounting for the ligand.<br><br>\n",
@@ -514,7 +512,7 @@
514512
"name": "stderr",
515513
"output_type": "stream",
516514
"text": [
517-
"Generating charges: 100%|███████████████████████| 10/10 [00:05<00:00, 1.73it/s]\n"
515+
"Generating charges: 100%|███████████████████████| 10/10 [00:05<00:00, 1.75it/s]\n"
518516
]
519517
}
520518
],
@@ -563,13 +561,13 @@
563561
"name": "stderr",
564562
"output_type": "stream",
565563
"text": [
566-
"/Users/atravitz/micromamba/envs/openfe-notebooks/lib/python3.13/site-packages/gufe/components/explicitmoleculecomponent.py:59: UserWarning: Molecule (name='') doesn't have any hydrogen atoms present. If this is unexpected, consider loading the molecule with `removeHs=False`\n",
564+
"/Users/atravitz/micromamba/envs/openfe-notebooks/lib/python3.13/site-packages/gufe/components/explicitmoleculecomponent.py:59: UserWarning: Molecule (name='tyk2') doesn't have any hydrogen atoms present. If this is unexpected, consider loading the molecule with `removeHs=False`\n",
567565
" warnings.warn(\n"
568566
]
569567
}
570568
],
571569
"source": [
572-
"protein = openfe.ProteinComponent.from_pdb_file(\"openfold_to_openfe/p_aligned/protein.pdb\")"
570+
"protein = openfe.ProteinComponent.from_pdb_file(\"openfold_to_openfe/p_aligned/protein.pdb\", name=\"tyk2\")"
573571
]
574572
},
575573
{
@@ -598,7 +596,7 @@
598596
"## 4. Creating a Binding Free Energy Transformation\n",
599597
"\n",
600598
"### 4a) Absolute Binding Free Energy\n",
601-
"Using these inputs, we can create ABFE Transformations. For the sake of simplicity, we will only create a Transformation for `lig_jmc_27`.\n",
599+
"Using these inputs, we can create ABFE Transformations. For the sake of simplicity, we will only create a Transformation for `lig_jmc_27`, but this process is generalizable to the rest of the ligands in the series.\n",
602600
"\n",
603601
"First we create the `ChemicalSystems` defining the end states of the simulation:"
604602
]
@@ -608,17 +606,42 @@
608606
"execution_count": 10,
609607
"id": "c405e50c-1df3-4bef-8278-393550e1fc6a",
610608
"metadata": {},
611-
"outputs": [],
609+
"outputs": [
610+
{
611+
"data": {
612+
"text/plain": [
613+
"SmallMoleculeComponent(name=lig_jmc_27)"
614+
]
615+
},
616+
"execution_count": 10,
617+
"metadata": {},
618+
"output_type": "execute_result"
619+
}
620+
],
612621
"source": [
613-
"ligand = [l for l in charged_ligands if l.name == 'lig_jmc_27'][0]"
622+
"# choose the first ligand\n",
623+
"ligand = [l for l in charged_ligands if l.name == 'lig_jmc_27'][0]\n",
624+
"ligand"
614625
]
615626
},
616627
{
617628
"cell_type": "code",
618629
"execution_count": 11,
619630
"id": "987a1657-82d0-4310-9fe7-4eecd289632a",
620631
"metadata": {},
621-
"outputs": [],
632+
"outputs": [
633+
{
634+
"data": {
635+
"text/plain": [
636+
"(ChemicalSystem(name=state_A, components={'ligand': SmallMoleculeComponent(name=lig_jmc_27), 'protein': ProteinComponent(name=tyk2), 'solvent': SolventComponent(name=O, Na+, Cl-)}),\n",
637+
" ChemicalSystem(name=state_B, components={'protein': ProteinComponent(name=tyk2), 'solvent': SolventComponent(name=O, Na+, Cl-)}))"
638+
]
639+
},
640+
"execution_count": 11,
641+
"metadata": {},
642+
"output_type": "execute_result"
643+
}
644+
],
622645
"source": [
623646
"# Create the two end states\n",
624647
"\n",
@@ -627,13 +650,15 @@
627650
" 'ligand': ligand,\n",
628651
" 'protein': protein,\n",
629652
" 'solvent': solvent,\n",
630-
"})\n",
653+
"}, name=\"state_A\")\n",
631654
"\n",
632655
"# state B is the system without the ligand\n",
633656
"stateB = openfe.ChemicalSystem({\n",
634657
" 'protein': protein,\n",
635658
" 'solvent': solvent,\n",
636-
"})"
659+
"}, name=\"state_B\")\n",
660+
"\n",
661+
"stateA, stateB"
637662
]
638663
},
639664
{
@@ -682,14 +707,22 @@
682707
")"
683708
]
684709
},
710+
{
711+
"cell_type": "markdown",
712+
"id": "f89a9800-9d25-470c-845f-87479095806e",
713+
"metadata": {},
714+
"source": [
715+
"This transformation can now be run using `openfe quickrun`."
716+
]
717+
},
685718
{
686719
"cell_type": "markdown",
687720
"id": "f9e4f4a1-ed28-4d33-b73b-865dc5023b93",
688721
"metadata": {},
689722
"source": [
690723
"### 4b) Separated Topologies Relative Binding Free Energy Transformation\n",
691724
"\n",
692-
"Next we create a SepTop RBFE Transformation. Here we will do the transformation between `lig_jmc_27` and `lig_ejm_46`."
725+
"We can instead build a SepTop RBFE Transformation. Here we will do the transformation between `lig_jmc_27` and `lig_ejm_46`."
693726
]
694727
},
695728
{
@@ -717,14 +750,14 @@
717750
" 'ligand': ligandA,\n",
718751
" 'protein': protein,\n",
719752
" 'solvent': solvent,\n",
720-
"})\n",
753+
"}, name=\"state_A\",)\n",
721754
"\n",
722755
"# state B is the system with lig_ejm_46\n",
723756
"stateB = openfe.ChemicalSystem({\n",
724757
" 'ligand': ligandB,\n",
725758
" 'protein': protein,\n",
726759
" 'solvent': solvent,\n",
727-
"})"
760+
"}, name=\"state_B\",)"
728761
]
729762
},
730763
{
@@ -765,6 +798,14 @@
765798
")"
766799
]
767800
},
801+
{
802+
"cell_type": "markdown",
803+
"id": "d59f5d1b-f078-49c2-9965-9cb8abc64a71",
804+
"metadata": {},
805+
"source": [
806+
"This transformation can now be run using `openfe quickrun`."
807+
]
808+
},
768809
{
769810
"cell_type": "markdown",
770811
"id": "316727a4-aa8b-43dd-916d-b73244ee829a",
@@ -801,7 +842,6 @@
801842
"source": [
802843
"<div class=\"alert alert-block alert-warning\"> \n",
803844
"⚠️ <b>Important Note:</b>\n",
804-
" <br><br>\n",
805845
" This alignment method is naive and error prone. In practice care would be required to make sure that the ligands are properly aligned.\n",
806846
"</div>"
807847
]
@@ -904,14 +944,14 @@
904944
" 'ligand': ligandA,\n",
905945
" 'protein': protein,\n",
906946
" 'solvent': solvent,\n",
907-
"})\n",
947+
"}, name=\"state_A_complex\",)\n",
908948
"\n",
909949
"# state B is the system with lig_ejm_46\n",
910950
"stateB_complex = openfe.ChemicalSystem({\n",
911951
" 'ligand': ligandB_aligned,\n",
912952
" 'protein': protein,\n",
913953
" 'solvent': solvent,\n",
914-
"})"
954+
"}, name=\"state_B_complex\")"
915955
]
916956
},
917957
{
@@ -927,13 +967,13 @@
927967
"stateA_solvent = openfe.ChemicalSystem({\n",
928968
" 'ligand': ligandA,\n",
929969
" 'solvent': solvent,\n",
930-
"})\n",
970+
"}, name=\"state_A_solvent\",)\n",
931971
"\n",
932972
"# state B is the system with lig_ejm_46\n",
933973
"stateB_solvent = openfe.ChemicalSystem({\n",
934974
" 'ligand': ligandB_aligned,\n",
935975
" 'solvent': solvent,\n",
936-
"})"
976+
"},name=\"state_B_solvent\",)"
937977
]
938978
},
939979
{
@@ -998,6 +1038,14 @@
9981038
")"
9991039
]
10001040
},
1041+
{
1042+
"cell_type": "markdown",
1043+
"id": "f08aaff4-97d0-4f53-bb32-1c7e247432aa",
1044+
"metadata": {},
1045+
"source": [
1046+
"This transformation can now be run using `openfe quickrun`."
1047+
]
1048+
},
10011049
{
10021050
"cell_type": "markdown",
10031051
"id": "6cae5156-f80f-4520-baee-4199774d441a",
@@ -1008,14 +1056,6 @@
10081056
"In practice, one would create entire network of Transformations, and then run all the simulations.\n",
10091057
"This notebook will not cover these aspects. To find out more about this, please see the [OpenFE Tutorials](https://docs.openfree.energy/en/latest/tutorials/index.html)."
10101058
]
1011-
},
1012-
{
1013-
"cell_type": "code",
1014-
"execution_count": null,
1015-
"id": "ac79eed4-0030-4a9a-b86e-39c53681446b",
1016-
"metadata": {},
1017-
"outputs": [],
1018-
"source": []
10191059
}
10201060
],
10211061
"metadata": {

0 commit comments

Comments
 (0)