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

Perceive external bonds (necessary for glycam ffxml conversion) #1184

Merged
merged 7 commits into from Sep 14, 2021

Conversation

zhang-ivy
Copy link
Contributor

@zhang-ivy zhang-ivy commented Jul 13, 2021

@peastman and I have been working on converting the AMBER glycam forcefield (GLYCAM_06j-1) into a ffxml for the OpenMM ecosystem -- we have the conversion pipeline working now (after making a number of changes to Parmed, OpenMM, and soon Openmmforcefields), but there is one more ParmEd fix that I had to use for the conversion pipeline that has not been pushed.

After generating the ffxml and upon trying to create a system for a glycosylated protein, I was getting errors like :

ValueError: No template found for residue 197 (UYB). The set of atoms matches UYB, but the bonds are different.

This was because the ExternalBonds in the ff templates were not correct. In the converted ffxml, for the UYB residue, I was seeing:

     <ExternalBond atomName="C1"/>
     <ExternalBond atomName="O4"/>

But there should be a third line for atomName="O6".

Since Parmed was not writing out all of the atoms with external bonds correctly, I added a fix to parmed/openmm/parameters.py. This fix involves adding a function called _get_atoms_with_external_bonds() that gets atoms with external bonds.

Not sure if this fix should be merged into master as I'm not sure whether it will disrupt the current functionality of parmed/openmm/parameters.py, but this is necessary for glycam ffxml conversion, so we should brainstorm how to include it in the repo.

Tagging @jchodera @peastman @swails for feedback

@peastman
Copy link
Contributor

This change looks like it's very specific to GLYCAM. We should make sure it doesn't break other force fields. For example, if you run CHARMM36 through it, does this cause it to start inserting external bonds that shouldn't be there?

Possibly this could be controlled by a global option, so you need to specifically enable it when running ParmEd.

@zhang-ivy
Copy link
Contributor Author

zhang-ivy commented Jul 13, 2021

The tests were failing for this because the function I wrote only allows for external bond perception for elements C, H, N, and O -- any other atom types will throw an error. I've checked the glycam ffxml to see if any residues contain S or P and only residue SO3 contains S (no residues contain P). I've included 'SO3' as a special case in the function.

To make sure my fix doesn't affect other conversion of other forcefields, I've also implemeted Peter's suggestion of using a global flag to control whether the external bond perception code is executed.

@zhang-ivy
Copy link
Contributor Author

@peastman @swails Could one of you approve this PR for running test workflows (so that we can check that these changes don't disrupt the behavior for other forcefields)?

@peastman
Copy link
Contributor

I'm not a maintainer. @swails will have to do it.

@swails swails merged commit 6c13292 into ParmEd:master Sep 14, 2021
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.

None yet

3 participants