Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate method for the OPLS OBC parameters #78

Closed
martimunicoy opened this issue Oct 30, 2020 · 4 comments · Fixed by #88, #94 or #100
Closed

Integrate method for the OPLS OBC parameters #78

martimunicoy opened this issue Oct 30, 2020 · 4 comments · Fixed by #88, #94 or #100
Assignees
Labels
enhancement New feature or request

Comments

@martimunicoy
Copy link
Owner

martimunicoy commented Oct 30, 2020

Description

PELE has a script to obtain the OBC parameters given a small molecule. This script is quite old though and presents many compatibility problems. Maybe we can incorporate this script into the offpele package to automatize the parameterization workflow. We could also look at its compatibility issues to try to improve it.

Solution

This would be a new Solvent class, that given a Molecule representation, parameterized with OPLS2005 would use atom types to assign the OBC parameters. Then, it should write the template file in the corresponding format file expected by PELE.

@martimunicoy martimunicoy added the enhancement New feature or request label Oct 30, 2020
@martimunicoy martimunicoy added this to To do in 1.0.0 via automation Oct 30, 2020
@martimunicoy
Copy link
Owner Author

Support

A new branch called OBC_for_OPLS has been created. It contains a new method called _add_GBSA_solvent_parameters() to be filled with the parameterization pipeline from the solventOBCParamsGenerator.py script.

@martimunicoy martimunicoy removed this from To do in 1.0.0 Nov 5, 2020
@martimunicoy
Copy link
Owner Author

The original script required atom degrees to perform the parameterization. Consequently, we need method to extract atom degrees from our molecule representation. This can be done with RDKit in a very straightforward way:

rdkit_molecule = molecule.rdkit_molecule

atom_degrees = list()

for atom in rdkit_molecule.GetAtoms():
    atom_degrees.append(atom.GetDegree())

@martimunicoy martimunicoy linked a pull request Nov 6, 2020 that will close this issue
5 tasks
@martimunicoy
Copy link
Owner Author

martimunicoy commented Nov 6, 2020

Besides, in case the parent atom of any atom is needed (for instance, thinking on identifying the atom a hydrogen atom is bonded to), the Atom's attribute parent stores the reference of the its parent atom. This attribute is set when initializing the Molecule representation in peleffy.
Atom objects are accessible after parameterizing the Molecule:

molecule = Molecule(smiles='CCC')
molecule.parameterize('openff_unconstrained-1.2.1.offxml')

for atom in molecule.atoms:
    if atom.parent is None:
        continue
    print(atom.parent.index)

Note that there is always an Atom without a parent Atom (its parent is set to None). This is the absolute parent atom according to the built molecular graph. However, a terminal atom such as hydrogen should never be the absolute parent atom and, therefore, it will never have a None parent atom.

@laumalo
Copy link
Collaborator

laumalo commented Nov 13, 2020

Implementation

The method _add_GBSA_solvent_parameters() has been filled with the parameterization pipeline from the solventOBCParamsGenerator.py script.

Different features from the solventOBCParamsGenerator.py script have been introduced:

  • When only one of the two parameters is found, the default parameters are returned. In the solventOBCParamsGenerator.py script, the parameter found was return and the non-found parameter was not defined.
  • The parameters lists are saved in a JSON file.

Tests

The function test_add_GBSA_solvent_parameters has been implemented and tests the new method for adding the GBSA solvent parameters for the following ligands: methane.pdb, melatone.pdb and ethylene.pdb.

@laumalo laumalo linked a pull request Nov 13, 2020 that will close this issue
5 tasks
@martimunicoy martimunicoy linked a pull request Nov 20, 2020 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants