Skip to content

Commit

Permalink
Merge pull request #161 from martimunicoy/devel
Browse files Browse the repository at this point in the history
peleffy 1.4.0 release
  • Loading branch information
martimunicoy committed Dec 15, 2021
2 parents e91a3a1 + bbdb38d commit e9e802d
Show file tree
Hide file tree
Showing 42 changed files with 8,154 additions and 83 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,6 @@ dmypy.json

# Pyre type checker
.pyre/

# MacOS
.DS_Store
2 changes: 1 addition & 1 deletion devtools/conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ requirements:
- networkx
- rdkit
- ambertools
- openff-toolkit==0.10.0
- openff-toolkit==0.10.1

about:
home: https://github.com/martimunicoy/peleffy
Expand Down
2 changes: 1 addition & 1 deletion devtools/envs/standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ dependencies:
- ipython
- ambertools
- rdkit
- openff-toolkit==0.10.0
- openff-toolkit==0.10.1
23 changes: 23 additions & 0 deletions docs/releasehistory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,29 @@ Releases follow the ``major.minor.micro`` scheme recommended by `PEP440 <https:/
* ``micro`` increments represent bugfix releases or improvements in documentation


1.4.0 - Alchemistry and AMBER support
---------------------------------------------------------

This is a minor release of peleffy that adds a new module to generate alchemical templates. It also adds support for AMBER's implementation in PELE.

New features
""""""""""""
- `PR #154 <https://github.com/martimunicoy/peleffy/pull/154>`_: Introduces Alchemizer module to generate hybrid topologies
- `PR #155 <https://github.com/martimunicoy/peleffy/pull/155>`_: Adds support for PELE's AMBER with a new Impact template
- `PR #162 <https://github.com/martimunicoy/peleffy/pull/162>`_: Upgrade to openff-toolkit 0.10.1

Bugfixes
""""""""
- `PR #158 <https://github.com/martimunicoy/peleffy/pull/158>`_: Fix minor bug when using the --chain flag and introduces checks for the input PDB in the peleffy.main module
- `PR #159 <https://github.com/martimunicoy/peleffy/pull/159>`_: Fix issues with long atom numbers and heteromolecules extraction

Tests added
"""""""""""
- `PR #154 <https://github.com/martimunicoy/peleffy/pull/154>`_: Adds a collection of tests for Alchemizer module
- `PR #155 <https://github.com/martimunicoy/peleffy/pull/155>`_: Extends the tests for utils module and introduces new tests for the new AMBER-compatible Impact template
- `PR #158 <https://github.com/martimunicoy/peleffy/pull/158>`_: Extends the tests for the new checks in the peleffy.main module


1.3.4 - OpenFF-2.0 Support
---------------------------------------------------------

Expand Down
12 changes: 12 additions & 0 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,15 @@ It always includes terminal rotamers, even if they belong to a terminal methyl g
.. code-block:: bash
$ python -m peleffy.main path/to/my_ligand.pdb --include_terminal_rotamers
AMBER-compatible template
-------------------------
It generates an Impact template that will be compatible with PELE's AMBER force field implementation. The default template is compatible with OPLS's implementation.

- Flag: ``--for_amber``
- Default: ``False``, compatible with OPLS
- Example: the code below will generate an Impact template compatible with PELE'S AMBER

.. code-block:: bash
$ python -m peleffy.main path/to/my_ligand.pdb --for_amber
187 changes: 187 additions & 0 deletions examples/OFF_parameterization/AMBER-compatible_templates.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "13879cec",
"metadata": {},
"source": [
"# Generation of an AMBER-compatible templates\n",
"This notebook shows how to use the API of `peleffy` to generate an Impact template that supports the AMBER force field implementation we have in PELE."
]
},
{
"cell_type": "markdown",
"id": "d22b7fdb",
"metadata": {},
"source": [
"### Load `peleffy`'s molecule representation with a PDB file of anthracene"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "b380cbf2",
"metadata": {},
"outputs": [],
"source": [
"from peleffy.topology import Molecule"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "9438c0b7",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
" - Initializing molecule from a SMILES tag\n",
" - Loading molecule from RDKit\n",
" - Setting molecule name to 'c1ccc2cc3ccccc3cc2c1'\n",
" - Representing molecule with the Open Force Field Toolkit\n",
" - Generating rotamer library\n",
" - Core set to the center of the molecule\n"
]
},
{
"data": {
"image/svg+xml": [
"<svg baseProfile=\"full\" height=\"500px\" version=\"1.1\" viewBox=\"0 0 500 500\" width=\"500px\" xml:space=\"preserve\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:rdkit=\"http://www.rdkit.org/xml\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
"<!-- END OF HEADER -->\n",
"<rect height=\"500\" style=\"opacity:1.0;fill:#FFFFFF;stroke:none\" width=\"500\" x=\"0\" y=\"0\"> </rect>\n",
"<path class=\"bond-0 atom-0 atom-1\" d=\"M 84.8285,281.787 L 84.8285,218.213\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-0 atom-0 atom-1\" d=\"M 97.5434,272.251 L 97.5434,227.749\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-13 atom-13 atom-0\" d=\"M 139.886,313.575 L 84.8285,281.787\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-16 atom-0 atom-14\" d=\"M 84.8285,281.787 L 38.4048,308.59\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-1 atom-1 atom-2\" d=\"M 84.8285,218.213 L 139.886,186.425\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-17 atom-1 atom-15\" d=\"M 84.8285,218.213 L 38.4048,191.41\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-2 atom-2 atom-3\" d=\"M 139.886,186.425 L 194.943,218.213\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-2 atom-2 atom-3\" d=\"M 141.787,202.205 L 180.327,224.456\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-18 atom-2 atom-16\" d=\"M 139.886,186.425 L 139.886,133.442\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-3 atom-3 atom-4\" d=\"M 194.943,218.213 L 250,186.425\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-14 atom-12 atom-3\" d=\"M 194.943,281.787 L 194.943,218.213\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-4 atom-4 atom-5\" d=\"M 250,186.425 L 305.057,218.213\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-4 atom-4 atom-5\" d=\"M 251.901,202.205 L 290.441,224.456\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-19 atom-4 atom-17\" d=\"M 250,186.425 L 250,133.442\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-5 atom-5 atom-6\" d=\"M 305.057,218.213 L 360.114,186.425\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-15 atom-10 atom-5\" d=\"M 305.057,281.787 L 305.057,218.213\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-6 atom-6 atom-7\" d=\"M 360.114,186.425 L 415.172,218.213\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-6 atom-6 atom-7\" d=\"M 362.015,202.205 L 400.555,224.456\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-20 atom-6 atom-18\" d=\"M 360.114,186.425 L 360.114,133.442\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-7 atom-7 atom-8\" d=\"M 415.172,218.213 L 415.172,281.787\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-21 atom-7 atom-19\" d=\"M 415.172,218.213 L 461.595,191.41\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-8 atom-8 atom-9\" d=\"M 415.172,281.787 L 360.114,313.575\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-8 atom-8 atom-9\" d=\"M 400.555,275.544 L 362.015,297.795\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-22 atom-8 atom-20\" d=\"M 415.172,281.787 L 461.595,308.59\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-9 atom-9 atom-10\" d=\"M 360.114,313.575 L 305.057,281.787\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-23 atom-9 atom-21\" d=\"M 360.114,313.575 L 360.114,366.558\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-10 atom-10 atom-11\" d=\"M 305.057,281.787 L 250,313.575\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-10 atom-10 atom-11\" d=\"M 290.441,275.544 L 251.901,297.795\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-11 atom-11 atom-12\" d=\"M 250,313.575 L 194.943,281.787\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-24 atom-11 atom-22\" d=\"M 250,313.575 L 250,366.558\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-12 atom-12 atom-13\" d=\"M 194.943,281.787 L 139.886,313.575\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-12 atom-12 atom-13\" d=\"M 180.327,275.544 L 141.787,297.795\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"bond-25 atom-13 atom-23\" d=\"M 139.886,313.575 L 139.886,366.558\" style=\"fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:4.0px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1\"/>\n",
"<path class=\"atom-14\" d=\"M 22.7273 304.572 L 25.1685 304.572 L 25.1685 312.227 L 34.3741 312.227 L 34.3741 304.572 L 36.8154 304.572 L 36.8154 322.577 L 34.3741 322.577 L 34.3741 314.261 L 25.1685 314.261 L 25.1685 322.577 L 22.7273 322.577 L 22.7273 304.572 \" fill=\"#000000\"/>\n",
"<path class=\"atom-15\" d=\"M 22.7273 177.423 L 25.1685 177.423 L 25.1685 185.078 L 34.3741 185.078 L 34.3741 177.423 L 36.8154 177.423 L 36.8154 195.428 L 34.3741 195.428 L 34.3741 187.112 L 25.1685 187.112 L 25.1685 195.428 L 22.7273 195.428 L 22.7273 177.423 \" fill=\"#000000\"/>\n",
"<path class=\"atom-16\" d=\"M 132.842 113.849 L 135.283 113.849 L 135.283 121.503 L 144.488 121.503 L 144.488 113.849 L 146.93 113.849 L 146.93 131.853 L 144.488 131.853 L 144.488 123.538 L 135.283 123.538 L 135.283 131.853 L 132.842 131.853 L 132.842 113.849 \" fill=\"#000000\"/>\n",
"<path class=\"atom-17\" d=\"M 242.956 113.849 L 245.397 113.849 L 245.397 121.503 L 254.603 121.503 L 254.603 113.849 L 257.044 113.849 L 257.044 131.853 L 254.603 131.853 L 254.603 123.538 L 245.397 123.538 L 245.397 131.853 L 242.956 131.853 L 242.956 113.849 \" fill=\"#000000\"/>\n",
"<path class=\"atom-18\" d=\"M 353.07 113.849 L 355.512 113.849 L 355.512 121.503 L 364.717 121.503 L 364.717 113.849 L 367.158 113.849 L 367.158 131.853 L 364.717 131.853 L 364.717 123.538 L 355.512 123.538 L 355.512 131.853 L 353.07 131.853 L 353.07 113.849 \" fill=\"#000000\"/>\n",
"<path class=\"atom-19\" d=\"M 463.185 177.423 L 465.626 177.423 L 465.626 185.078 L 474.831 185.078 L 474.831 177.423 L 477.273 177.423 L 477.273 195.428 L 474.831 195.428 L 474.831 187.112 L 465.626 187.112 L 465.626 195.428 L 463.185 195.428 L 463.185 177.423 \" fill=\"#000000\"/>\n",
"<path class=\"atom-20\" d=\"M 463.185 304.572 L 465.626 304.572 L 465.626 312.227 L 474.831 312.227 L 474.831 304.572 L 477.273 304.572 L 477.273 322.577 L 474.831 322.577 L 474.831 314.261 L 465.626 314.261 L 465.626 322.577 L 463.185 322.577 L 463.185 304.572 \" fill=\"#000000\"/>\n",
"<path class=\"atom-21\" d=\"M 353.07 368.147 L 355.512 368.147 L 355.512 375.801 L 364.717 375.801 L 364.717 368.147 L 367.158 368.147 L 367.158 386.151 L 364.717 386.151 L 364.717 377.836 L 355.512 377.836 L 355.512 386.151 L 353.07 386.151 L 353.07 368.147 \" fill=\"#000000\"/>\n",
"<path class=\"atom-22\" d=\"M 242.956 368.147 L 245.397 368.147 L 245.397 375.801 L 254.603 375.801 L 254.603 368.147 L 257.044 368.147 L 257.044 386.151 L 254.603 386.151 L 254.603 377.836 L 245.397 377.836 L 245.397 386.151 L 242.956 386.151 L 242.956 368.147 \" fill=\"#000000\"/>\n",
"<path class=\"atom-23\" d=\"M 132.842 368.147 L 135.283 368.147 L 135.283 375.801 L 144.488 375.801 L 144.488 368.147 L 146.93 368.147 L 146.93 386.151 L 144.488 386.151 L 144.488 377.836 L 135.283 377.836 L 135.283 386.151 L 132.842 386.151 L 132.842 368.147 \" fill=\"#000000\"/>\n",
"</svg>"
],
"text/plain": [
"<IPython.core.display.SVG object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"anthracene = Molecule(smiles='c1ccc2cc3ccccc3cc2c1', hydrogens_are_explicit=False)\n",
"display(anthracene)"
]
},
{
"cell_type": "markdown",
"id": "c154396b",
"metadata": {},
"source": [
"### Parameterize with `Open Force Field Toolkit` and generate the Impact template\n",
"Please, note that to save the Impact template in the required format for PELE's AMBER, we need to set `for_amber` to `True` when initializing the `Impact` class."
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "a817c5b9",
"metadata": {},
"outputs": [],
"source": [
"from peleffy.forcefield import OpenForceField\n",
"from peleffy.topology import Topology\n",
"from peleffy.template import Impact"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "71042711",
"metadata": {},
"outputs": [],
"source": [
"openff = OpenForceField('openff_unconstrained-2.0.0.offxml')\n",
"parameters = openff.parameterize(anthracene)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "d228e024",
"metadata": {},
"outputs": [],
"source": [
"topology = Topology(anthracene, parameters)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "7d3888da",
"metadata": {},
"outputs": [],
"source": [
"impact = Impact(topology, for_amber=True)\n",
"impact.to_file('antz')"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.10"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading

0 comments on commit e9e802d

Please sign in to comment.