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

[DO NOT MERGE] Pre-generate residue templates #492

Closed
wants to merge 41 commits into from

Conversation

zhang-ivy
Copy link
Contributor

@zhang-ivy zhang-ivy commented Nov 14, 2018

When instantiating KinaseInhibitorTestSystem, this version of Perses currently loads a ffxml containing Imatinib (MOL0), Dasatinib (MOL1), Nilotinib (MOL2), and Bosutinib (MOL3). This is located at data/clinical-kinase-inhibitors.xml or https://github.com/choderalab/perses/blob/residue_templates/perses/data/clinical-kinase-inhibitors.xml

However, even though the ffxml seems to contain the right residue templates, the templates cannot be found/matched:

Traceback (most recent call last):
  File "test_ivy.py", line 9, in <module>
    testsystem = KinaseInhibitorsTestSystem()
  File "/lila/home/zhangi/perses/perses/tests/testsystems.py", line 1829, in __init__
    super(KinaseInhibitorsTestSystem, self).__init__(**kwargs)
  File "/lila/home/zhangi/perses/perses/tests/testsystems.py", line 1736, in __init__
    modeller.addSolvent(forcefield, model='tip3p', padding=9.0*unit.angstrom)
  File "/home/zhangi/miniconda3/envs/cenv/lib/python3.6/site-packages/simtk/openmm/app/modeller.py", line 376, in addSolvent
    system = forcefield.createSystem(self.topology)
  File "/home/zhangi/miniconda3/envs/cenv/lib/python3.6/site-packages/simtk/openmm/app/forcefield.py", line 1139, in createSystem
    raise ValueError('No template found for residue %d (%s).  %s' % (res.index+1, res.name, _findMatchErrors(self, res)))
ValueError: No template found for residue 1 (MOL0).  This might mean your input topology is missing some atoms or bonds, or possibly that you are using the wrong force field.

I'm not sure if this is because the ffxml was generated incorrectly or if there is an issue with template matching.

To modify the code so that it pre-generates templates again (instead of loading the ffxml):

  1. In SmallMoleculeLibraryTestSystem of testsystems.py, uncomment lines 1717-1724
    https://github.com/choderalab/perses/blob/residue_templates/perses/tests/testsystems.py#L1717-L1724
  2. In SmallMoleculeLibraryTestSystem of testsystems.py, modify lines 1713-1714 such that app.Forcefield only takes in gaff_xml_filename and tip3p.xml

Note: Use the latest commit from this openmoltools PR: choderalab/openmoltools#282
Note: The data/clinical-kinase-inhibitors.csv in this version of Perses contains only a subset of all the clinical kinase inhibitors found in master.

zhang-ivy and others added 30 commits September 26, 2018 16:17
update master (was 80 commits behind before)
@@ -1714,7 +1714,7 @@ def __init__(self, constraints=app.HBonds, premapped_json_dict=None, **kwargs):
forcefield = app.ForceField(gaff_xml_filename, 'tip3p.xml', clinical_kinase_inhibitors_filename)
d_smiles_to_oemol = {smiles : smiles_to_oemol(smiles, "MOL%d" % i)for i, smiles in enumerate(molecules)}

## Generate and ffxml, then add to forcefield
# ## Generate and ffxml, then add to forcefield
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to uncomment this code and pre-generate the parameters, or did you not want to pre-generate the parameters?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That code is commented so whoever is looking at it can reproduce the error I was getting when loading the ffxml I already generated (https://github.com/choderalab/perses/blob/residue_templates/perses/data/clinical-kinase-inhibitors.xml). However, I wasn't sure if the problem was related to loading the template or generating the template. Therefore, to better understand the problem (and debug), I kept the code I used to generate the templates in there. Feel free to uncomment it if you think the problem occurs while generating the templates.

@jchodera jchodera changed the title Pre-generate residue templates [DO NOT MERGE] Pre-generate residue templates Apr 3, 2019
@jchodera
Copy link
Member

jchodera commented Apr 3, 2019

Marking this as "DO NOT MERGE" so we can pull changes into a new PR.

@jchodera jchodera closed this Feb 3, 2020
@hannahbrucemacdonald hannahbrucemacdonald deleted the residue_templates branch February 19, 2020 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants