Skip to content

Commit

Permalink
Merge pull request #47 from openforcefield/update_smirnoff_workshop
Browse files Browse the repository at this point in the history
Update SMIRNOFF workshop materials
  • Loading branch information
Yoshanuikabundi authored Apr 9, 2024
2 parents b05c7d9 + ad5eaef commit a8a8e32
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 59 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,10 @@
<Proper smirks="[*:1]-[*:2]#[*:3]-[*:4]" periodicity1="1" phase1="0.0 * degree ** 1" id="t165" k1="0.0 * mole ** -1 * kilocalorie ** 1" idivf1="1.0"></Proper>
<Proper smirks="[*:1]~[*:2]-[*:3]#[*:4]" periodicity1="1" phase1="0.0 * degree ** 1" id="t166" k1="0.0 * mole ** -1 * kilocalorie ** 1" idivf1="1.0"></Proper>
<Proper smirks="[*:1]~[*:2]=[#6,#7,#16,#15;X2:3]=[*:4]" periodicity1="1" phase1="0.0 * degree ** 1" id="t167" k1="0.0 * mole ** -1 * kilocalorie ** 1" idivf1="1.0"></Proper>
<Proper smirks="[#6H2X4x0!r+0A:1](-;!@[#1H0X1x0!r+0A])(-;!@[#1H0X1x0!r+0A])(-;!@[#6H2X4x0!r+0A,#6H3X4x0!r+0A](-;!@[#1H0X1x0!r+0A,#6H2X4x0!r+0A])(-;!@[#1H0X1x0!r+0A])-;!@[#1H0X1x0!r+0A])-;!@[#6H2X4x0!r+0A:2](-;!@[#1H0X1x0!r+0A])(-;!@[#1H0X1x0!r+0A])-;!@[#6H0X3x0!r+0A:3](-;!@[#8H1X2x0!r+0A]-;!@[#1H0X1x0!r+0A])=;!@[#8H0X1x0!r+0A:4]" periodicity1="1" periodicity2="2" periodicity3="3" periodicity4="4" phase1="0 * degree ** 1" phase2="180 * degree ** 1" phase3="0 * degree ** 1" phase4="180 * degree ** 1" id="t183" k1="2.339482342559e-05 * kilocalories_per_mole ** 1" k2="-0.09629862049992 * mole ** -1 * kilocalorie ** 1" k3="1.502296337255e-06 * kilocalories_per_mole ** 1" k4="6.115051851251e-06 * kilocalories_per_mole ** 1" idivf1="1.0" idivf2="1.0" idivf3="1.0" idivf4="1.0"></Proper>
<Proper smirks="[#6H2X4x0!r+0A:1](-;!@[#1H0X1x0!r+0A])(-;!@[#1H0X1x0!r+0A])(-;!@[#6H2X4x0!r+0A,#6H3X4x0!r+0A](-;!@[#1H0X1x0!r+0A,#6H2X4x0!r+0A])(-;!@[#1H0X1x0!r+0A])-;!@[#1H0X1x0!r+0A])-;!@[#6H2X4x0!r+0A:2](-;!@[#1H0X1x0!r+0A])(-;!@[#1H0X1x0!r+0A])-;!@[#6H0X3x0!r+0A:3](=;!@[#8H0X1x0!r+0A])-;!@[#8H1X2x0!r+0A:4]-;!@[#1H0X1x0!r+0A]" periodicity1="1" periodicity2="2" periodicity3="3" periodicity4="4" phase1="0 * degree ** 1" phase2="180 * degree ** 1" phase3="0 * degree ** 1" phase4="180 * degree ** 1" id="t184" k1="-2.665103673882e-05 * kilocalories_per_mole ** 1" k2="0.570167135834 * kilocalories_per_mole ** 1" k3="0.1812559079425 * mole ** -1 * kilocalorie ** 1" k4="4.541093756891e-06 * kilocalories_per_mole ** 1" idivf1="1.0" idivf2="1.0" idivf3="1.0" idivf4="1.0"></Proper>
<Proper smirks="[#1H0X1x0!r+0A:1]-;!@[#6H2X4x0!r+0A:2](-;!@[#1H0X1x0!r+0A])(-;!@[#6H2X4x0!r+0A](-;!@[#1H0X1x0!r+0A])(-;!@[#1H0X1x0!r+0A])-;!@[#6H2X4x0!r+0A,#6H3X4x0!r+0A](-;!@[#1H0X1x0!r+0A,#6H2X4x0!r+0A])(-;!@[#1H0X1x0!r+0A])-;!@[#1H0X1x0!r+0A])-;!@[#6H0X3x0!r+0A:3](-;!@[#8H1X2x0!r+0A]-;!@[#1H0X1x0!r+0A])=;!@[#8H0X1x0!r+0A:4]" periodicity1="1" periodicity2="2" periodicity3="3" periodicity4="4" phase1="0 * degree ** 1" phase2="180 * degree ** 1" phase3="0 * degree ** 1" phase4="180 * degree ** 1" id="t185" k1="0.9162555051511 * mole ** -1 * kilocalorie ** 1" k2="0.2080633644506 * mole ** -1 * kilocalorie ** 1" k3="-0.1737773653881 * mole ** -1 * kilocalorie ** 1" k4="-0.004756813549828 * kilocalories_per_mole ** 1" idivf1="1.0" idivf2="1.0" idivf3="1.0" idivf4="1.0"></Proper>
<Proper smirks="[#1H0X1x0!r+0A:1]-;!@[#6H2X4x0!r+0A:2](-;!@[#1H0X1x0!r+0A])(-;!@[#6H2X4x0!r+0A](-;!@[#1H0X1x0!r+0A])(-;!@[#1H0X1x0!r+0A])-;!@[#6H2X4x0!r+0A,#6H3X4x0!r+0A](-;!@[#1H0X1x0!r+0A,#6H2X4x0!r+0A])(-;!@[#1H0X1x0!r+0A])-;!@[#1H0X1x0!r+0A])-;!@[#6H0X3x0!r+0A:3](=;!@[#8H0X1x0!r+0A])-;!@[#8H1X2x0!r+0A:4]-;!@[#1H0X1x0!r+0A]" periodicity1="1" periodicity2="2" periodicity3="3" periodicity4="4" phase1="0 * degree ** 1" phase2="180 * degree ** 1" phase3="0 * degree ** 1" phase4="180 * degree ** 1" id="t186" k1="0.2912505051823 * kilocalories_per_mole ** 1" k2="-1.528497551787e-05 * kilocalories_per_mole ** 1" k3="-0.2013576311107 * mole ** -1 * kilocalorie ** 1" k4="-1.188164284603e-05 * kilocalories_per_mole ** 1" idivf1="1.0" idivf2="1.0" idivf3="1.0" idivf4="1.0"></Proper>
<Proper smirks="[#6H2X4x0!r+0A:1](-;!@[#1H0X1x0!r+0A])(-;!@[#1H0X1x0!r+0A])(-;!@[#6H2X4x0!r+0A,#6H3X4x0!r+0A](-;!@[#1H0X1x0!r+0A,#6H2X4x0!r+0A])(-;!@[#1H0X1x0!r+0A])-;!@[#1H0X1x0!r+0A])-;!@[#6H2X4x0!r+0A:2](-;!@[#1H0X1x0!r+0A])(-;!@[#1H0X1x0!r+0A])-;!@[#6H0X3x0!r+0A:3](-;!@[#8H1X2x0!r+0A]-;!@[#1H0X1x0!r+0A])=;!@[#8H0X1x0!r+0A:4]" periodicity1="1" periodicity2="2" periodicity3="3" periodicity4="4" phase1="0 * degree ** 1" phase2="180 * degree ** 1" phase3="0 * degree ** 1" phase4="180 * degree ** 1" id="t183" k1="2.311750799844e-05 * kilocalories_per_mole ** 1" k2="-0.09934852329684 * mole ** -1 * kilocalorie ** 1" k3="1.505881066552e-06 * kilocalories_per_mole ** 1" k4="6.156327275483e-06 * kilocalories_per_mole ** 1" idivf1="1.0" idivf2="1.0" idivf3="1.0" idivf4="1.0"></Proper>
<Proper smirks="[#6H2X4x0!r+0A:1](-;!@[#1H0X1x0!r+0A])(-;!@[#1H0X1x0!r+0A])(-;!@[#6H2X4x0!r+0A,#6H3X4x0!r+0A](-;!@[#1H0X1x0!r+0A,#6H2X4x0!r+0A])(-;!@[#1H0X1x0!r+0A])-;!@[#1H0X1x0!r+0A])-;!@[#6H2X4x0!r+0A:2](-;!@[#1H0X1x0!r+0A])(-;!@[#1H0X1x0!r+0A])-;!@[#6H0X3x0!r+0A:3](=;!@[#8H0X1x0!r+0A])-;!@[#8H1X2x0!r+0A:4]-;!@[#1H0X1x0!r+0A]" periodicity1="1" periodicity2="2" periodicity3="3" periodicity4="4" phase1="0 * degree ** 1" phase2="180 * degree ** 1" phase3="0 * degree ** 1" phase4="180 * degree ** 1" id="t184" k1="-2.672553443299e-05 * kilocalories_per_mole ** 1" k2="0.5733687344026 * kilocalories_per_mole ** 1" k3="0.1812558882216 * mole ** -1 * kilocalorie ** 1" k4="4.510013887253e-06 * kilocalories_per_mole ** 1" idivf1="1.0" idivf2="1.0" idivf3="1.0" idivf4="1.0"></Proper>
<Proper smirks="[#1H0X1x0!r+0A:1]-;!@[#6H2X4x0!r+0A:2](-;!@[#1H0X1x0!r+0A])(-;!@[#6H2X4x0!r+0A](-;!@[#1H0X1x0!r+0A])(-;!@[#1H0X1x0!r+0A])-;!@[#6H2X4x0!r+0A,#6H3X4x0!r+0A](-;!@[#1H0X1x0!r+0A,#6H2X4x0!r+0A])(-;!@[#1H0X1x0!r+0A])-;!@[#1H0X1x0!r+0A])-;!@[#6H0X3x0!r+0A:3](-;!@[#8H1X2x0!r+0A]-;!@[#1H0X1x0!r+0A])=;!@[#8H0X1x0!r+0A:4]" periodicity1="1" periodicity2="2" periodicity3="3" periodicity4="4" phase1="0 * degree ** 1" phase2="180 * degree ** 1" phase3="0 * degree ** 1" phase4="180 * degree ** 1" id="t185" k1="0.9162450108759 * mole ** -1 * kilocalorie ** 1" k2="0.2080640783886 * mole ** -1 * kilocalorie ** 1" k3="-0.1737774081048 * mole ** -1 * kilocalorie ** 1" k4="-0.005008864859333 * kilocalories_per_mole ** 1" idivf1="1.0" idivf2="1.0" idivf3="1.0" idivf4="1.0"></Proper>
<Proper smirks="[#1H0X1x0!r+0A:1]-;!@[#6H2X4x0!r+0A:2](-;!@[#1H0X1x0!r+0A])(-;!@[#6H2X4x0!r+0A](-;!@[#1H0X1x0!r+0A])(-;!@[#1H0X1x0!r+0A])-;!@[#6H2X4x0!r+0A,#6H3X4x0!r+0A](-;!@[#1H0X1x0!r+0A,#6H2X4x0!r+0A])(-;!@[#1H0X1x0!r+0A])-;!@[#1H0X1x0!r+0A])-;!@[#6H0X3x0!r+0A:3](=;!@[#8H0X1x0!r+0A])-;!@[#8H1X2x0!r+0A:4]-;!@[#1H0X1x0!r+0A]" periodicity1="1" periodicity2="2" periodicity3="3" periodicity4="4" phase1="0 * degree ** 1" phase2="180 * degree ** 1" phase3="0 * degree ** 1" phase4="180 * degree ** 1" id="t186" k1="0.291045899231 * kilocalories_per_mole ** 1" k2="-1.490732021763e-05 * kilocalories_per_mole ** 1" k3="-0.2013184497385 * mole ** -1 * kilocalorie ** 1" k4="-1.235976991155e-05 * kilocalories_per_mole ** 1" idivf1="1.0" idivf2="1.0" idivf3="1.0" idivf4="1.0"></Proper>
</ProperTorsions>
<ImproperTorsions version="0.3" potential="k*(1+cos(periodicity*theta-phase))" default_idivf="auto">
<Improper smirks="[*:1]~[#6X3:2](~[*:3])~[*:4]" periodicity1="2" phase1="180.0 * degree ** 1" k1="5.230790565314 * mole ** -1 * kilocalorie ** 1" id="i1"></Improper>
Expand Down
19 changes: 8 additions & 11 deletions source/workshops/2024/smirnoff/colab-env.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
name: 2024-smirnoff-workshop
name: openff-docs-examples
channels:
- conda-forge
dependencies:
# Notebook + runtime
# Colab-specific versions
- ipywidgets=7.6.0
- nglview=3.0.3
# Examples
- openff-toolkit-examples>=0.14.5
- openff-interchange>=0.3.18
- openff-nagl
- openff-bespokefit>=0.2.3
- openff-toolkit-examples ~=0.15.2
- openff-interchange ~=0.3.25
- openff-nagl ~=0.3.7
- openff-bespokefit
- gromacs >=2021=nompi*
- lammps
- lammps >=2023.08.02
- rich
- jax
- dgl
- nglview=3.0.3
- xtb-python
- pdbfixer
- mdtraj
- propka
- pdb2pqr
- openmmtools
- chemper
- dockstring
- mdanalysis
87 changes: 54 additions & 33 deletions source/workshops/2024/smirnoff/colab-smirnoff.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "c36c3757-9937-4265-b151-27c69acf185d",
"metadata": {},
"outputs": [],
"source": [
"!pip install -U https://github.com/conda-incubator/condacolab/archive/cuda-version-12.tar.gz\n",
"import condacolab\n",
"condacolab.install_mambaforge()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a5c51ca7-b042-454c-8f06-d19225fe4acd",
"metadata": {},
"outputs": [],
"source": [
"!wget -qN https://raw.githubusercontent.com/openforcefield/openff-docs/main/source/workshops/2024/smirnoff/utils.py\n",
"!wget -qN https://raw.githubusercontent.com/openforcefield/openff-docs/main/source/workshops/2024/smirnoff/colab-env.yml\n",
"!wget -qN https://raw.githubusercontent.com/openforcefield/openff-docs/main/source/workshops/2024/smirnoff/7FCX_prepped.pdb\n",
"!wget -qN https://raw.githubusercontent.com/openforcefield/openff-docs/main/source/workshops/2024/smirnoff/smirks.png\n",
"!wget -qN https://raw.githubusercontent.com/openforcefield/openff-docs/main/source/workshops/2024/smirnoff/interchange_vectors.png\n",
"!wget -qN https://raw.githubusercontent.com/openforcefield/openff-docs/main/source/workshops/2024/smirnoff/bespoke_hexanoic_acid_alltorsions.offxml\n",
"!wget -qN https://raw.githubusercontent.com/openforcefield/openff-docs/main/source/workshops/2024/smirnoff/bespokefit-hexanoic-acid.offxml\n",
"!mamba env update -q --name=base --file=colab-env.yml"
]
},
{
"cell_type": "markdown",
"id": "81036958-df15-4b2e-9c41-093ebfccaaf9",
Expand Down Expand Up @@ -109,37 +138,23 @@
{
"cell_type": "code",
"execution_count": null,
"id": "c36c3757-9937-4265-b151-27c69acf185d",
"metadata": {},
"outputs": [],
"source": [
"!pip install -U https://github.com/conda-incubator/condacolab/archive/cuda-version-12.tar.gz\n",
"import condacolab\n",
"condacolab.install_mambaforge()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a5c51ca7-b042-454c-8f06-d19225fe4acd",
"metadata": {},
"id": "bc3f4e94-c626-46c9-a9fa-db2454ff892f",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [],
"source": [
"!wget -qN https://raw.githubusercontent.com/openforcefield/openff-docs/2024-smirnoff-workshop/source/workshops/2024/smirnoff/utils.py\n",
"!wget -qN https://raw.githubusercontent.com/openforcefield/openff-docs/2024-smirnoff-workshop/source/workshops/2024/smirnoff/colab-env.yml\n",
"!wget -qN https://raw.githubusercontent.com/openforcefield/openff-docs/2024-smirnoff-workshop/source/workshops/2024/smirnoff/7FCX_prepped.pdb\n",
"!wget -qN https://raw.githubusercontent.com/openforcefield/openff-docs/2024-smirnoff-workshop/source/workshops/2024/smirnoff/smirks.png\n",
"!wget -qN https://raw.githubusercontent.com/openforcefield/openff-docs/2024-smirnoff-workshop/source/workshops/2024/smirnoff/bespoke_hexanoic_acid_alltorsions.offxml\n",
"!wget -qN https://raw.githubusercontent.com/openforcefield/openff-docs/2024-smirnoff-workshop/source/workshops/2024/smirnoff/bespokefit-hexanoic-acid.offxml\n",
"!mamba env update -q --name=base --file=colab-env.yml\n",
"from google.colab import output\n",
"output.enable_custom_widget_manager()"
"from utils import draw_molecule, nglview_show_openmm"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "bc3f4e94-c626-46c9-a9fa-db2454ff892f",
"id": "e090acfa-1e7f-431f-8b35-3ab282e3b259",
"metadata": {
"editable": true,
"slideshow": {
Expand All @@ -149,7 +164,8 @@
},
"outputs": [],
"source": [
"from utils import draw_molecule, nglview_show_openmm"
"from google.colab import output\n",
"output.enable_custom_widget_manager()"
]
},
{
Expand Down Expand Up @@ -301,7 +317,7 @@
"id": "daa98897-edce-4830-97cb-533a335b460f",
"metadata": {},
"source": [
"<img src=\"smirks.png\" width=\"400\"/>"
"<img src=\"smirks.png\" width=\"600\"/>"
]
},
{
Expand Down Expand Up @@ -494,6 +510,14 @@
"## Interchange's matrix representation"
]
},
{
"cell_type": "markdown",
"id": "14778b26-1109-448e-b4e6-d8a87171ae92",
"metadata": {},
"source": [
"![Graphic depicting Interchange's matrix representation](interchange_vectors.png)"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -549,6 +573,7 @@
"outputs": [],
"source": [
"edited_params = hexanoic_acid_in_sage[\"Bonds\"].get_force_field_parameters()\n",
"# Change the first (0th) bond length (1) to 4 angstroms\n",
"edited_params[0, 1] = 4.0\n",
"\n",
"hexanoic_acid_in_sage[\"Bonds\"].set_force_field_parameters(edited_params)\n",
Expand All @@ -571,11 +596,9 @@
"id": "31a3526b-ac25-4ad3-9a4a-7218de2bc941",
"metadata": {},
"source": [
"Introduce NADP, parametrize with Sage, investigate assigned parameters, demonstrate same potential energy across different engines \n",
"\n",
"Heart-type fatty acid binding protein (hFABP) \n",
"I've prepared a simulation box with heart-type Fatty Acid Binding Protein (hFABP), a globular protein with a [PDB entry] including a bound hexanoic acid molecule.\n",
"\n",
"https://www.rcsb.org/structure/7FCX"
"[PDB entry]: https://www.rcsb.org/structure/7FCX"
]
},
{
Expand All @@ -587,7 +610,6 @@
"source": [
"from openff.toolkit import Topology\n",
"\n",
"\n",
"topology = Topology.from_pdb(\n",
" \"7FCX_prepped.pdb\", \n",
" unique_molecules=[hexanoic_acid]\n",
Expand Down Expand Up @@ -943,9 +965,8 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.7"
"version": "3.11.8"
},
"orphan": true,
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"state": {},
Expand Down
21 changes: 10 additions & 11 deletions source/workshops/2024/smirnoff/env.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
name: 2024-smirnoff-workshop
name: openff-docs-examples
channels:
- conda-forge
dependencies:
# Notebook + runtime
- pip
- python>=3.10
- jupyterlab>=4
- ipywidgets>=8
- jupyterlab_execute_time
- jupyterlab-lsp
- pyright
- jedi-language-server
- jupyterlab_code_formatter
- black
- isort
# Examples
- openff-toolkit-examples>=0.14.5
- openff-interchange>=0.3.18
- openff-nagl
- openff-bespokefit>=0.2.3
- openff-toolkit-examples ~=0.15.2
- openff-interchange ~=0.3.25
- openff-nagl ~=0.3.7
- openff-bespokefit
- openff-qcsubmit
- gromacs >=2021=nompi*
- lammps
- lammps >=2023.08.02
- rich
- jax
- dgl
- nglview>=3.0.6
- xtb-python
- pdbfixer
- mdtraj
- propka
- pdb2pqr
- openmmtools
- chemper
- dockstring
- mdanalysis
- plotly
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a8a8e32

Please sign in to comment.