Re: [AMBER] [parmed.py] chemistry.exceptions.AmberParmError loading topology file

From: Eiros Zamora, Juan <j.eiros-zamora14.imperial.ac.uk>
Date: Thu, 10 Sep 2015 10:41:52 +0000

Hi Jason,

Thanks for your help. You’re right, the topology file was obtained some months ago using the parmed.py of AmberTools 14 to strip the waters out of the topology file that was used for MD production. I’ll try and look for the original one and make the proper changes with the newer version of parmed.py

Cheers,

Juan

El 10/9/2015, a las 2:50, Jason Swails <jason.swails.gmail.com<mailto:jason.swails.gmail.com>> escribió:

On Wed, Sep 9, 2015 at 1:34 PM, Eiros Zamora, Juan <
j.eiros-zamora14.imperial.ac.uk<mailto:j.eiros-zamora14.imperial.ac.uk>> wrote:

Dear Amber users,

I’m running into the following error when trying to load a topology file
to parmed.py.

Traceback (most recent call last):
 File "/usr/local/amber15/bin/parmed.py", line 126, in <module>
   amber_prmtop.add_parm(parm)
 File
"/usr/local/amber15/lib/python2.7/site-packages/ParmedTools/parmlist.py",
line 34, in add_parm
   parm = load_file(parm)
 File
"/usr/local/amber15/lib/python2.7/site-packages/chemistry/formats/registry.py",
line 121, in load_file
   return cls.parse(filename, **kws)
 File
"/usr/local/amber15/lib/python2.7/site-packages/chemistry/amber/amberformat.py",
line 347, in parse
   return LoadParm(filename)
 File
"/usr/local/amber15/lib/python2.7/site-packages/chemistry/amber/readparm.py",
line 69, in LoadParm
   parm = parm.view(AmberParm)
 File
"/usr/local/amber15/lib/python2.7/site-packages/chemistry/amber/amberformat.py",
line 411, in view
   return cls.load_from_rawdata(self)
 File
"/usr/local/amber15/lib/python2.7/site-packages/chemistry/amber/_amberparm.py",
line 240, in load_from_rawdata
   inst.initialize_topology()
 File
"/usr/local/amber15/lib/python2.7/site-packages/chemistry/amber/_amberparm.py",
line 196, in initialize_topology
   self.load_structure()
 File
"/usr/local/amber15/lib/python2.7/site-packages/chemistry/amber/_amberparm.py",
line 384, in load_structure
   self._check_section_lengths()
 File
"/usr/local/amber15/lib/python2.7/site-packages/chemistry/amber/_amberparm.py",
line 1215, in _check_section_lengths
   check_length('ATOMIC_NUMBER', natom, False)
 File
"/usr/local/amber15/lib/python2.7/site-packages/chemistry/amber/_amberparm.py",
line 1204, in check_length
   (key, len(self.parm_data[key]), length))
chemistry.exceptions.AmberParmError: FLAG ATOMIC_NUMBER has 303288
elements; expected 7425


​A couple other people have reported this exact error before, but I've
never been able to figure out *why* they would be getting it. It is clear
what's happening, though -- the ATOMIC_NUMBER section is not having the
values corresponding to the water atoms removed from its list (all other
sections get properly trimmed, but not this one).

I dug through some of the history of the ParmEd development, and was able
to reproduce this behavior with AmberTools version 13, and based on a quick
perusal of the code in AmberTools 14, it appears to happen there as well.

However, the problem has *definitely* been fixed as of AmberTools 15, so
what I suspect happened here is that you used parmed.py from AmberTools 14
to strip out the water residues from your prmtop file and generate a new
one. AmberTools 15 introduced a sanity check to make sure that all of the
prmtop arrays had the expected length, and ATOMIC_NUMBER failed that test.

If you still have the original prmtop file, use parmed.py to strip the
water to generate a prmtop file (rather than using parmed.py from
AmberTools 14).

If you have a little Python savvy, you can use the following script to
patch up your prmtop file:

#!/usr/bin/env python

​from chemistry.amber.readparm import AmberFormat

parm = AmberFormat('your.prmtop') # Substitute your prmtop name
parm.parm_data['ATOMIC_NUMBER'] = parm.parm_data['ATOMIC_NUMBER'][:7425]
parm.writeParm('your.prmtop')

That should fix your prmtop (assuming that all you deleted was water, since
tleap always puts water at the end). In the future, always using
AmberTools 15's ParmEd to strip solvent will avoid this problem.

HTH,
Jason

--
Jason M. Swails
BioMaPS,
Rutgers University
Postdoctoral Researcher
_______________________________________________
AMBER mailing list
AMBER.ambermd.org<mailto:AMBER.ambermd.org>
http://lists.ambermd.org/mailman/listinfo/amber

_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Thu Sep 10 2015 - 04:00:05 PDT
Custom Search