-
Notifications
You must be signed in to change notification settings - Fork 578
Added GLYCAM #3303
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
Added GLYCAM #3303
Conversation
|
I'm not an AMBER user myself, so I can't really help with the reference values. All looks reasonable to me as far as it goes - but I do think it would be really valuable to also support using GLYCAM for models with sugar residues named according to wwPDB standards. That of course gets a bit more complicated, because you'd need to incorporate its naming rules in your code. That's how I'm doing it in ISOLDE: it requires the model to strictly adhere to wwPDB naming conventions for sugars, and assigns the templates for them and their anchoring amino acid here: That's been working for N- and O-linked glycans for a few years now. However it doesn't yet work for free sugars or oligosaccharides - that gets a bit more complicated because models from the wwPDB incorporate the reducing-terminal OH into the sugar residue where GLYCAM appends it as a separate 2-atom residue. Same idea goes for sulfated and phosphorylated sugars - I've left those in the too-hard basket for the time being. |
|
I haven't tested it, but here is what I think will happen if you give it a file using PDB names. The custom template matcher won't find a match, since the names will be different. It will then use the standard method of comparing topologies. If there's a single unique match, it will work, but if there are two templates for identical topologies but different chiralities, they'll both match. It will then compare the templates to see if they assign identical parameters. If they do, it will work. If they assign different parameters, it will throw an exception. |
|
I've opened a PR to fix the broken GLYCAM_06j-1.xml here: openmm/openmmforcefields#180 |
Here are the reference values I get from parametrizing with tleap: Code: import parmed
from copy import deepcopy
import openmm
from openmm import unit as u
# set beta
temperature = 300.0 * u.kelvin
kB = u.BOLTZMANN_CONSTANT_kB * u.AVOGADRO_CONSTANT_NA
kT = kB * temperature
beta = 1.0/kT
prmtop = "/home/zhangi/choderalab/openmmforcefields/amber/files/glycam/glycoprotein.prmtop"
inpcrd = "/home/zhangi/choderalab/openmmforcefields/amber/files/glycam/glycoprotein.inpcrd"
# Get AMBER system
parm_amber = parmed.load_file(prmtop, inpcrd)
system_amber = parm_amber.createSystem()
def compute_potential_components(system, positions, beta=beta):
# Note: this is copied from perses
# TODO: consider moving this outside of assert_energies_glyco_protein()
system = deepcopy(system)
for index in range(system.getNumForces()):
force = system.getForce(index)
force.setForceGroup(index)
integrator = openmm.VerletIntegrator(1.0*u.femtosecond)
platform = openmm.Platform.getPlatformByName('Reference')
context = openmm.Context(system, integrator, platform)
context.setPositions(positions)
energy_components = list()
for index in range(system.getNumForces()):
force = system.getForce(index)
forcename = force.__class__.__name__
groups = 1<<index
potential = beta * context.getState(getEnergy=True, groups=groups).getPotentialEnergy()
energy_components.append((forcename, potential))
del context, integrator
return energy_components
amber_energies = compute_potential_components(system_amber, parm_amber.positions)
print(amber_energies) |
|
Thanks! |
|
How come the energies you hard coded in the test are different than the ones in my last message? |
|
The positions in your inpcrd file are slightly different from the ones in the PDB file. |
|
All tests are passing. Is this ok to merge? |
|
Should we wait until openmm/openmmforcefields#180 is merged so we can include that version of GLYCAM_06j-1.xml? |
|
It looks to me like the only difference between them is that the |
|
If you search for |
|
Right. I meant, compared to the one in this PR. Can you make it produce the |
|
I've added a one line hack to my the parmed code to maintain atom ordering to make the diff easier to read. Please take a look at the ffxml in openmm/openmmforcefields#180 again -- there should be a number of differences (for OME, ROH, TBT, OLP, etc). |
|
Thanks! That gives a much simpler diff. Here are the changes compared to the one currently in this PR. OME: eliminate external bonds to H1 and CH3 I'm pretty sure those changes are correct, so I'll update this PR with the new version. Just to confirm though, HYP really isn't supposed to have any external bonds other than the standard N and C ones? It isn't an amino acid that can have a glycan attached to it? |
|
That gets a bit confusing - in GLYCAM, HYP is non-glycosylated hydroxyproline, OLP is the glycosylated version. Not sure why they include non-glycosylated HYP in that forcefield at all, to be honest - I have it commented out of my version.
…________________________________
From: Peter Eastman ***@***.***>
Sent: 29 October 2021 17:24
To: openmm/openmm ***@***.***>
Cc: Tristan Croll ***@***.***>; Mention ***@***.***>
Subject: Re: [openmm/openmm] Added GLYCAM (PR #3303)
Thanks! That gives a much simpler diff. Here are the changes compared to the one currently in this PR.
OME: eliminate external bonds to H1 and CH3
ROH: eliminate external bond to HO1
SO3: eliminate external bonds to O1, O2, and O3
TBT: eliminate external bond to C2
HYP and variants: eliminate external bonds to CG, OD1, and HD1
OLP and variants: external bond is to OD1 instead of CG
I'm pretty sure those changes are correct, so I'll update this PR with the new version. Just to confirm though, HYP really isn't supposed to have any external bonds other than the standard N and C ones? It isn't an amino acid that can have a glycan attached to it?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#3303 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AFM54YG4CFKBEKZ5MLGWWODUJLDFNANCNFSM5G3RKJQA>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
|
Thanks! |
|
Yes, agreed with Tristan -- I'm not sure why they included HYP and related variants in the GLYCAM force field. I've just reviewed everything else in the PR and it looks good to me! |
I think I have everything working correctly. @zhang-ivy @tristanic if you have time to look this over, that would be great. I have a test case that computes the energy of a simple glycopeptide, but I don't have anything to compare it to. With enough effort I can probably figure out how to compute a reference value with Amber, but if someone who is more of an Amber user than me can do it, that would also be very much appreciated!
I had to make a small change to the API for template matchers. It was already marked as experimental and subject to change, so I think that's acceptable, but be aware that this breaks the existing GLYCAM version in openmmforcefields. That version is already broken in other ways, though, such as the incorrect
<ExternalBond>tags for terminal residues.Fixes #3175.