choderalab / AURKA_UMN

0 stars 0 forks source link

Generate mg.xml from pdb, frcmod, lib #37

Closed juliebehr closed 8 years ago

juliebehr commented 8 years ago

I think there must have been updates to tleap since the time the Sept lab posted their parameters and use directions which render them unusable. When I try to follow their steps in tleap, I end up with

tleap -s -f oldff/leaprc.ff99SB

> loadoff mag.lib
Loading library: ./mag.lib
> loadamberparams frcmod.mg
Loading parameters: ./frcmod.mg
Reading force field modification type file (frcmod)
Reading title:
\# parameters for multisite Mg++ from Saxena and Sept JCTC (2013)
> mol = loadpdb magnesium.pdb
Loading PDB file: ./magnesium.pdb
Illegal CONECT record in pdb file
  total atoms in file: 7
> saveamberparm mol mg.top mg.crd
Checking Unit.
WARNING: The unperturbed charge of the unit: 2.000000 is not zero.

 -- ignoring the warning.

Building topology.
Building atom parameters.
For atom: .R<MMG 1>.A<D2 2> Could not find vdW (or other) parameters for type: Db
For atom: .R<MMG 1>.A<D3 3> Could not find vdW (or other) parameters for type: Dc
For atom: .R<MMG 1>.A<D4 4> Could not find vdW (or other) parameters for type: Dd
For atom: .R<MMG 1>.A<D5 5> Could not find vdW (or other) parameters for type: De
For atom: .R<MMG 1>.A<D6 6> Could not find vdW (or other) parameters for type: De
For atom: .R<MMG 1>.A<D1 7> Could not find vdW (or other) parameters for type: Da
Parameter file was not saved.
jchodera commented 8 years ago

Has Rafal already converted these?

juliebehr commented 8 years ago

I don't think so? He pointed me to how to implement the new ions, but I think / assumed he already had xmls to work with

rafwiewiora commented 8 years ago

Let me see what I can work out here!

rafwiewiora commented 8 years ago

Hmmm, that worked ok for me actually.

That PDB you're using - is it from their website or something different? I'm surprised it's throwing CONECT error.

rafwiewiora commented 8 years ago

Re converting to xml: you just need the conversion script: https://github.com/choderalab/openmm/tree/forcefield_conversion_bonanza/devtools/forcefield-scripts/amber (just take amber2openmm.py if you're doing only this small conversion)

Make a leaprc mg:

loadamberparams frcmod.mg
loadoff mg.lib

and call: python amber2openmm.py --input mg --input-format leaprc

and you've got an mg.xml: https://gist.github.com/rafwiewiora/5baa72e0810d0cb118ab952736ab9a1c - this is as it comes out, unfortunately you need to manually change the element of the XZ atom type to Mg - it has F here because if the element is not specified Parmed looks by mass. There isn't really a way to fix this - this is an unusual case with a lower mass than what Mg would have.

We should add all these metals into 7.1 once the main conversion PR goes in - I'll work on adding tests for these models to amber2openmm.py .

juliebehr commented 8 years ago

Wonderful, thank you @rafwiewiora ! And no worries about the manual edit, that's what I've had to do for plenty of steps in this project!

rafwiewiora commented 8 years ago

No problem at all!

rafwiewiora commented 8 years ago

Oh, just realized! The element="H" for the dummy atoms is also wrong - for those you need to make them element None so they're treated as dummy atoms in OpenMM (i.e. just delete the element attribute from the XML - I can't remember if leaving it as element="" also works, it should, but not having the attribute definitely works).

This should be fully working: https://gist.github.com/rafwiewiora/d265377cd3bd5660cba9ae191676790a

Also just some things I remembered after we chatted yesterday - some problems to watch out for:

juliebehr commented 8 years ago

Oh yes I noticed the H! So I can just delete them, perfect. And excellent points, I think I know how to deal with the first and I noticed the second yesterday and was very confused by it, so this makes much more sense.

rafwiewiora commented 8 years ago

Cool! If anything else comes up, shoot me a comment here!

juliebehr commented 8 years ago

Addressed in https://github.com/choderalab/AURKA_UMN/pull/38 (keeping open until all RUNS are prepared, just in case).