Skip to content

Commit

Permalink
Add notebooks for cookbook (#84)
Browse files Browse the repository at this point in the history
* Add smallligandcomponent->ligandnetwork notebook

* More cookbooks

* Add LigandNetwork visualization notebook

* Hide cells with uncooperative widgets in sphinx

* Add protocol creation cookbook

* Line length discipline

* Nbsphinx-compatible cookbook notebooks

* Update cookbook/generate_ligand_network.ipynb

Co-authored-by: David W.H. Swenson <[email protected]>

* Update cookbook/generate_ligand_network.ipynb

Co-authored-by: David W.H. Swenson <[email protected]>

* Update cookbook/hand_write_ligand_network.ipynb

Co-authored-by: David W.H. Swenson <[email protected]>

* Update cookbook/hand_write_ligand_network.ipynb

Co-authored-by: David W.H. Swenson <[email protected]>

* Apply suggestions from code review

* Update cookbook/load_ligand_network.ipynb

Co-authored-by: David W.H. Swenson <[email protected]>

* Update cookbook/load_ligand_network.ipynb

Co-authored-by: David W.H. Swenson <[email protected]>

* Update cookbook/load_ligand_network.ipynb

Co-authored-by: David W.H. Swenson <[email protected]>

* Tweak phrasing

* Apply suggestions from code review

* Include 2d mapping visualization

* visualizing nodes -> visualizing ligand overlap

* Describe protocol immutability in choose_protocol.ipynb

* Add comment describing name choice

* Rename load_ligand_network

* Update binder environment

* Remove broken widget

* switch GHA Python to 3.11 as well

---------

Co-authored-by: David W.H. Swenson <[email protected]>
  • Loading branch information
Yoshanuikabundi and dwhswenson authored Oct 10, 2023
1 parent e06c524 commit e797390
Show file tree
Hide file tree
Showing 17 changed files with 5,789 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies:
- MDAnalysis
- click
- coverage
- ipywidgets==7.*
- ipywidgets
- lomap2
- lxml
- mdtraj
Expand All @@ -24,9 +24,9 @@ dependencies:
- pytest-cov
- pytest-xdist
- pydantic
- python==3.10.*
- python==3.11.*
- rdkit
- typing_extensions
- gufe>=0.7.1
- openfe>=0.10.1
- gufe>=0.9.4
- openfe>=0.13.0
- py3dmol
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.10",]
python-version: ["3.11",]

steps:
- uses: actions/[email protected]
Expand Down
1 change: 1 addition & 0 deletions cookbook/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
transformations/
33 changes: 33 additions & 0 deletions cookbook/assets/benzene.mol2
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@<TRIPOS>MOLECULE
benzene
12 12 1 0 0
SMALL
NO_CHARGES
@<TRIPOS>ATOM
1 C1 1.207 2.091 0.000 C.ar 1 BENZENE 0.000
2 C2 2.414 1.394 0.000 C.ar 1 BENZENE 0.000
3 C3 2.414 0.000 0.000 C.ar 1 BENZENE 0.000
4 C4 1.207 -0.697 0.000 C.ar 1 BENZENE 0.000
5 C5 0.000 0.000 0.000 C.ar 1 BENZENE 0.000
6 C6 0.000 1.394 0.000 C.ar 1 BENZENE 0.000
7 H1 1.207 3.175 0.000 H 1 BENZENE 0.000
8 H2 3.353 1.936 0.000 H 1 BENZENE 0.000
9 H3 3.353 -0.542 0.000 H 1 BENZENE 0.000
10 H4 1.207 -1.781 0.000 H 1 BENZENE 0.000
11 H5 -0.939 -0.542 0.000 H 1 BENZENE 0.000
12 H6 -0.939 1.936 0.000 H 1 BENZENE 0.000
@<TRIPOS>BOND
1 1 2 ar
2 1 6 ar
3 2 3 ar
4 3 4 ar
5 4 5 ar
6 5 6 ar
7 1 7 1
8 2 8 1
9 3 9 1
10 4 10 1
11 5 11 1
12 6 12 1
@<TRIPOS>SUBSTRUCTURE
1 BENZENE 1 PERM 0 **** **** 0 ROOT
30 changes: 30 additions & 0 deletions cookbook/assets/benzene.sdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
benzene
PyMOL2.5 3D 0

12 12 0 0 0 0 0 0 0 0999 V2000
25.9780 5.3270 4.7790 C 0 0 0 0 0 0 0 0 0 0 0 0
26.3950 5.0740 3.4990 C 0 0 0 0 0 0 0 0 0 0 0 0
27.3400 5.8600 2.9020 C 0 0 0 0 0 0 0 0 0 0 0 0
27.8370 6.9210 3.5690 C 0 0 0 0 0 0 0 0 0 0 0 0
27.4200 7.1960 4.8560 C 0 0 0 0 0 0 0 0 0 0 0 0
26.4980 6.3790 5.4690 C 0 0 0 0 0 0 0 0 0 0 0 0
25.2298 4.6859 5.2451 H 0 0 0 0 0 0 0 0 0 0 0 0
25.9676 4.2351 2.9497 H 0 0 0 0 0 0 0 0 0 0 0 0
27.6890 5.6311 1.8951 H 0 0 0 0 0 0 0 0 0 0 0 0
28.5730 7.5660 3.0889 H 0 0 0 0 0 0 0 0 0 0 0 0
27.8209 8.0598 5.3863 H 0 0 0 0 0 0 0 0 0 0 0 0
26.1874 6.5720 6.4958 H 0 0 0 0 0 0 0 0 0 0 0 0
1 2 4 0 0 0 0
1 6 4 0 0 0 0
1 7 1 0 0 0 0
2 3 4 0 0 0 0
2 8 1 0 0 0 0
3 4 4 0 0 0 0
3 9 1 0 0 0 0
4 5 4 0 0 0 0
4 10 1 0 0 0 0
5 6 4 0 0 0 0
5 11 1 0 0 0 0
6 12 1 0 0 0 0
M END
$$$$
240 changes: 240 additions & 0 deletions cookbook/assets/somebenzenes.sdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
benzene
PyMOL2.5 3D 0

12 12 0 0 0 0 0 0 0 0999 V2000
25.9780 5.3270 4.7790 C 0 0 0 0 0 0 0 0 0 0 0 0
26.3950 5.0740 3.4990 C 0 0 0 0 0 0 0 0 0 0 0 0
27.3400 5.8600 2.9020 C 0 0 0 0 0 0 0 0 0 0 0 0
27.8370 6.9210 3.5690 C 0 0 0 0 0 0 0 0 0 0 0 0
27.4200 7.1960 4.8560 C 0 0 0 0 0 0 0 0 0 0 0 0
26.4980 6.3790 5.4690 C 0 0 0 0 0 0 0 0 0 0 0 0
25.2298 4.6859 5.2451 H 0 0 0 0 0 0 0 0 0 0 0 0
25.9676 4.2351 2.9497 H 0 0 0 0 0 0 0 0 0 0 0 0
27.6890 5.6311 1.8951 H 0 0 0 0 0 0 0 0 0 0 0 0
28.5730 7.5660 3.0889 H 0 0 0 0 0 0 0 0 0 0 0 0
27.8209 8.0598 5.3863 H 0 0 0 0 0 0 0 0 0 0 0 0
26.1874 6.5720 6.4958 H 0 0 0 0 0 0 0 0 0 0 0 0
1 2 4 0 0 0 0
1 6 4 0 0 0 0
1 7 1 0 0 0 0
2 3 4 0 0 0 0
2 8 1 0 0 0 0
3 4 4 0 0 0 0
3 9 1 0 0 0 0
4 5 4 0 0 0 0
4 10 1 0 0 0 0
5 6 4 0 0 0 0
5 11 1 0 0 0 0
6 12 1 0 0 0 0
M END
$$$$
toluene
PyMOL2.5 3D 0

15 15 0 0 0 0 0 0 0 0999 V2000
28.9072 8.7434 5.1220 H 0 0 0 0 0 0 0 0 0 0 0 0
28.1966 8.1433 6.6393 H 0 0 0 0 0 0 0 0 0 0 0 0
27.9864 8.4164 5.6052 C 0 0 0 0 0 0 0 0 0 0 0 0
27.2579 9.2269 5.5838 H 0 0 0 0 0 0 0 0 0 0 0 0
25.9780 5.3270 4.7790 C 0 0 0 0 0 0 0 0 0 0 0 0
26.3950 5.0740 3.4990 C 0 0 0 0 0 0 0 0 0 0 0 0
27.3400 5.8600 2.9020 C 0 0 0 0 0 0 0 0 0 0 0 0
27.8370 6.9210 3.5690 C 0 0 0 0 0 0 0 0 0 0 0 0
27.4200 7.1960 4.8560 C 0 0 0 0 0 0 0 0 0 0 0 0
26.4980 6.3790 5.4690 C 0 0 0 0 0 0 0 0 0 0 0 0
25.2298 4.6859 5.2451 H 0 0 0 0 0 0 0 0 0 0 0 0
25.9676 4.2351 2.9497 H 0 0 0 0 0 0 0 0 0 0 0 0
27.6890 5.6311 1.8951 H 0 0 0 0 0 0 0 0 0 0 0 0
28.5730 7.5660 3.0889 H 0 0 0 0 0 0 0 0 0 0 0 0
26.1874 6.5720 6.4958 H 0 0 0 0 0 0 0 0 0 0 0 0
1 3 1 0 0 0 0
2 3 1 0 0 0 0
3 4 1 0 0 0 0
5 6 4 0 0 0 0
5 10 4 0 0 0 0
5 11 1 0 0 0 0
6 7 4 0 0 0 0
6 12 1 0 0 0 0
7 8 4 0 0 0 0
7 13 1 0 0 0 0
8 9 4 0 0 0 0
8 14 1 0 0 0 0
3 9 1 0 0 0 0
9 10 4 0 0 0 0
10 15 1 0 0 0 0
M END
$$$$
phenol
PyMOL2.5 3D 0

13 13 0 0 0 0 0 0 0 0999 V2000
25.9780 5.3270 4.7790 C 0 0 0 0 0 0 0 0 0 0 0 0
26.3950 5.0740 3.4990 C 0 0 0 0 0 0 0 0 0 0 0 0
27.3400 5.8600 2.9020 C 0 0 0 0 0 0 0 0 0 0 0 0
27.8370 6.9210 3.5690 C 0 0 0 0 0 0 0 0 0 0 0 0
27.4200 7.1960 4.8560 C 0 0 0 0 0 0 0 0 0 0 0 0
26.4980 6.3790 5.4690 C 0 0 0 0 0 0 0 0 0 0 0 0
25.2298 4.6859 5.2451 H 0 0 0 0 0 0 0 0 0 0 0 0
25.9676 4.2351 2.9497 H 0 0 0 0 0 0 0 0 0 0 0 0
27.6890 5.6311 1.8951 H 0 0 0 0 0 0 0 0 0 0 0 0
28.5730 7.5660 3.0889 H 0 0 0 0 0 0 0 0 0 0 0 0
28.1311 8.0887 6.4624 H 0 0 0 0 0 0 0 0 0 0 0 0
26.1874 6.5720 6.4958 H 0 0 0 0 0 0 0 0 0 0 0 0
27.9460 8.3293 5.5517 O 0 0 0 0 0 0 0 0 0 0 0 0
1 2 4 0 0 0 0
1 6 4 0 0 0 0
1 7 1 0 0 0 0
2 3 4 0 0 0 0
2 8 1 0 0 0 0
3 4 4 0 0 0 0
3 9 1 0 0 0 0
4 5 4 0 0 0 0
4 10 1 0 0 0 0
5 6 4 0 0 0 0
5 13 1 0 0 0 0
6 12 1 0 0 0 0
11 13 1 0 0 0 0
M END
$$$$
benzonitrile
PyMOL2.5 3D 0

13 13 0 0 0 0 0 0 0 0999 V2000
28.5559 9.5700 6.2831 N 0 0 0 0 0 0 0 0 0 0 0 0
27.9981 8.4043 5.5824 C 0 0 0 0 0 0 0 0 0 0 0 0
25.9780 5.3270 4.7790 C 0 0 0 0 0 0 0 0 0 0 0 0
26.3950 5.0740 3.4990 C 0 0 0 0 0 0 0 0 0 0 0 0
27.3400 5.8600 2.9020 C 0 0 0 0 0 0 0 0 0 0 0 0
27.8370 6.9210 3.5690 C 0 0 0 0 0 0 0 0 0 0 0 0
27.4200 7.1960 4.8560 C 0 0 0 0 0 0 0 0 0 0 0 0
26.4980 6.3790 5.4690 C 0 0 0 0 0 0 0 0 0 0 0 0
25.2298 4.6859 5.2451 H 0 0 0 0 0 0 0 0 0 0 0 0
25.9676 4.2351 2.9497 H 0 0 0 0 0 0 0 0 0 0 0 0
27.6890 5.6311 1.8951 H 0 0 0 0 0 0 0 0 0 0 0 0
28.5730 7.5660 3.0889 H 0 0 0 0 0 0 0 0 0 0 0 0
26.1874 6.5720 6.4958 H 0 0 0 0 0 0 0 0 0 0 0 0
1 2 3 0 0 0 0
3 4 4 0 0 0 0
3 8 4 0 0 0 0
3 9 1 0 0 0 0
4 5 4 0 0 0 0
4 10 1 0 0 0 0
5 6 4 0 0 0 0
5 11 1 0 0 0 0
6 7 4 0 0 0 0
6 12 1 0 0 0 0
2 7 1 0 0 0 0
7 8 4 0 0 0 0
8 13 1 0 0 0 0
M END
$$$$
anisole
PyMOL2.5 3D 0

16 16 0 0 0 0 0 0 0 0999 V2000
29.2873 8.8784 4.9226 C 0 0 0 0 0 0 0 0 0 0 0 0
29.5502 9.7990 5.4437 H 0 0 0 0 0 0 0 0 0 0 0 0
28.0548 8.3459 5.4720 O 0 0 0 0 0 0 0 0 0 0 0 0
30.0866 8.1484 5.0502 H 0 0 0 0 0 0 0 0 0 0 0 0
29.1525 9.0868 3.8612 H 0 0 0 0 0 0 0 0 0 0 0 0
25.9780 5.3270 4.7790 C 0 0 0 0 0 0 0 0 0 0 0 0
26.3950 5.0740 3.4990 C 0 0 0 0 0 0 0 0 0 0 0 0
27.3400 5.8600 2.9020 C 0 0 0 0 0 0 0 0 0 0 0 0
27.8370 6.9210 3.5690 C 0 0 0 0 0 0 0 0 0 0 0 0
27.4200 7.1960 4.8560 C 0 0 0 0 0 0 0 0 0 0 0 0
26.4980 6.3790 5.4690 C 0 0 0 0 0 0 0 0 0 0 0 0
25.2298 4.6859 5.2451 H 0 0 0 0 0 0 0 0 0 0 0 0
25.9676 4.2351 2.9497 H 0 0 0 0 0 0 0 0 0 0 0 0
27.6890 5.6311 1.8951 H 0 0 0 0 0 0 0 0 0 0 0 0
28.5730 7.5660 3.0889 H 0 0 0 0 0 0 0 0 0 0 0 0
26.1874 6.5720 6.4958 H 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0 0 0 0
1 4 1 0 0 0 0
1 5 1 0 0 0 0
1 3 1 0 0 0 0
6 7 4 0 0 0 0
6 11 4 0 0 0 0
6 12 1 0 0 0 0
7 8 4 0 0 0 0
7 13 1 0 0 0 0
8 9 4 0 0 0 0
8 14 1 0 0 0 0
9 10 4 0 0 0 0
9 15 1 0 0 0 0
3 10 1 0 0 0 0
10 11 4 0 0 0 0
11 16 1 0 0 0 0
M END
$$$$
benzaldehyde
PyMOL2.5 3D 0

14 14 0 0 0 0 0 0 0 0999 V2000
29.2079 8.8492 4.9632 O 0 0 0 0 0 0 0 0 0 0 0 0
27.5482 8.8691 6.4597 H 0 0 0 0 0 0 0 0 0 0 0 0
27.9981 8.4043 5.5824 C 0 0 0 0 0 0 0 0 0 0 0 0
25.9780 5.3270 4.7790 C 0 0 0 0 0 0 0 0 0 0 0 0
26.3950 5.0740 3.4990 C 0 0 0 0 0 0 0 0 0 0 0 0
27.3400 5.8600 2.9020 C 0 0 0 0 0 0 0 0 0 0 0 0
27.8370 6.9210 3.5690 C 0 0 0 0 0 0 0 0 0 0 0 0
27.4200 7.1960 4.8560 C 0 0 0 0 0 0 0 0 0 0 0 0
26.4980 6.3790 5.4690 C 0 0 0 0 0 0 0 0 0 0 0 0
25.2298 4.6859 5.2451 H 0 0 0 0 0 0 0 0 0 0 0 0
25.9676 4.2351 2.9497 H 0 0 0 0 0 0 0 0 0 0 0 0
27.6890 5.6311 1.8951 H 0 0 0 0 0 0 0 0 0 0 0 0
28.5730 7.5660 3.0889 H 0 0 0 0 0 0 0 0 0 0 0 0
26.1874 6.5720 6.4958 H 0 0 0 0 0 0 0 0 0 0 0 0
1 3 2 0 0 0 0
2 3 1 0 0 0 0
4 5 4 0 0 0 0
4 9 4 0 0 0 0
4 10 1 0 0 0 0
5 6 4 0 0 0 0
5 11 1 0 0 0 0
6 7 4 0 0 0 0
6 12 1 0 0 0 0
7 8 4 0 0 0 0
7 13 1 0 0 0 0
3 8 1 0 0 0 0
8 9 4 0 0 0 0
9 14 1 0 0 0 0
M END
$$$$
styrene
PyMOL2.5 3D 0

16 16 0 0 0 0 0 0 0 0999 V2000
29.2873 8.8784 4.9226 C 0 0 0 0 0 0 0 0 0 0 0 0
29.6609 8.3486 4.0463 H 0 0 0 0 0 0 0 0 0 0 0 0
29.8344 9.7353 5.3157 H 0 0 0 0 0 0 0 0 0 0 0 0
27.5365 8.8812 6.4825 H 0 0 0 0 0 0 0 0 0 0 0 0
27.9864 8.4164 5.6052 C 0 0 0 0 0 0 0 0 0 0 0 0
25.9780 5.3270 4.7790 C 0 0 0 0 0 0 0 0 0 0 0 0
26.3950 5.0740 3.4990 C 0 0 0 0 0 0 0 0 0 0 0 0
27.3400 5.8600 2.9020 C 0 0 0 0 0 0 0 0 0 0 0 0
27.8370 6.9210 3.5690 C 0 0 0 0 0 0 0 0 0 0 0 0
27.4200 7.1960 4.8560 C 0 0 0 0 0 0 0 0 0 0 0 0
26.4980 6.3790 5.4690 C 0 0 0 0 0 0 0 0 0 0 0 0
25.2298 4.6859 5.2451 H 0 0 0 0 0 0 0 0 0 0 0 0
25.9676 4.2351 2.9497 H 0 0 0 0 0 0 0 0 0 0 0 0
27.6890 5.6311 1.8951 H 0 0 0 0 0 0 0 0 0 0 0 0
28.5730 7.5660 3.0889 H 0 0 0 0 0 0 0 0 0 0 0 0
26.1874 6.5720 6.4958 H 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0 0 0 0
1 3 1 0 0 0 0
1 5 2 0 0 0 0
4 5 1 0 0 0 0
6 7 4 0 0 0 0
6 11 4 0 0 0 0
6 12 1 0 0 0 0
7 8 4 0 0 0 0
7 13 1 0 0 0 0
8 9 4 0 0 0 0
8 14 1 0 0 0 0
9 10 4 0 0 0 0
9 15 1 0 0 0 0
5 10 1 0 0 0 0
10 11 4 0 0 0 0
11 16 1 0 0 0 0
M END
$$$$
6 changes: 6 additions & 0 deletions cookbook/assets/somebenzenes_fepp.edge
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
1c91235:9c91235 # benzene -> toluene
1c91235:7876633 # benzene -> phenol
1c91235:2a51f95 # benzene -> benzonitrile
1c91235:efja0bc # benzene -> anisole
1c91235:7877722 # benzene -> styrene
1c91235:99930cd # benzene -> benzaldehyde
8 changes: 8 additions & 0 deletions cookbook/assets/somebenzenes_nes.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Total number of edges: 6
# ------------------------
benzene >> toluene
benzene >> phenol
benzene >> benzonitrile
benzene >> anisole
benzene >> styrene
benzene >> benzaldehyde
Loading

0 comments on commit e797390

Please sign in to comment.