openmm icon indicating copy to clipboard operation
openmm copied to clipboard

openmm does not recognize calcium ion

Open ShahbazQalandar opened this issue 3 years ago • 3 comments
trafficstars

Hi,

I am trying to simulate calcium bound calmodulin using the script

pdb0 = PDBFile('test.pdb') forcefield = app.ForceField('amber99sbildn.xml', 'tip3p.xml') modeller = Modeller(pdb0.topology, pdb0.positions) modeller.addHydrogens(forcefield) modeller.addSolvent(forcefield1,padding=1.0nanometers,ionicStrength=0.1molar)

I got the following error

Traceback (most recent call last): File "test.py", line 11, in modeller.addHydrogens(forcefield1) File "/home/scis/anaconda3/lib/python3.7/site-packages/openmm/app/modeller.py", line 967, in addHydrogens system = forcefield.createSystem(newTopology, rigidWater=False, nonbondedMethod=CutoffNonPeriodic) File "/home/scis/anaconda3/lib/python3.7/site-packages/openmm/app/forcefield.py", line 1212, in createSystem templateForResidue = self._matchAllResiduesToTemplates(data, topology, residueTemplates, ignoreExternalBonds) File "/home/scis/anaconda3/lib/python3.7/site-packages/openmm/app/forcefield.py", line 1427, in _matchAllResiduesToTemplates raise ValueError('No template found for residue %d (%s). %s' % (res.index+1, res.name, _findMatchErrors(self, res))) ValueError: No template found for residue 145 (CA). This might mean your input topology is missing some atoms or bonds, or possibly that you are using the wrong force field.

I am also attaching the PDB file which was generated by AMBER.

The similar error I am getting using YANK as mentioned https://github.com/choderalab/yank/issues/1251 test.zip

ShahbazQalandar avatar Jun 27 '22 08:06 ShahbazQalandar

@ShahbazQalandar The base tip3p.xml doesn't have any ions included, but the version amber14/tip3p.xml does. The simple fix is to use app.ForceField('amber99sbildn.xml', 'amber14/tip3p.xml'). Despite the name that wouldn't include anything else from amber14, just TIP3P water and ions.

I'm sorry if this is a bit counterintuitive, there is an open issue to change the way ions are handled in #3663 but this should fix the problem.

aizvorski avatar Jun 29 '22 17:06 aizvorski

Thanks. It is working now.

ShahbazQalandar avatar Jun 29 '22 17:06 ShahbazQalandar

Those files aren't really meant to be combined with each other. Amber has changed how they handled ions over the years. In 99SBILDN, the ions are included with the main force field. However, it only supports a smaller set of ions: Cl, Cs, K, Li, Mg, Na, and Rb. Later force fields added more ions, and also started having different ion parameters for different water models. Using Amber14 ion parameters with Amber99 probably isn't a good idea. I suggest instead using Amber14 for everything: app.ForceField('amber14-all.xml', 'amber14/tip3pfb.xml'). Notice I also changed the water model. You can use TIP3P if you really want to, but TIP3P-FB is a much more realistic one.

peastman avatar Jun 29 '22 18:06 peastman