[AMBER] setangle in parmed API

From: <hannes.loeffler.stfc.ac.uk>
Date: Wed, 26 Mar 2014 15:01:11 +0000

Hi,

I keep wondering why in the attached code the setbond class creates a new bond type (with proper linkage) as expected but the same doesn't seem to work for setangle. The output parm mod.parm7 appears to have effectively the same angle entries.

Many thanks,
Hannes.


from chemistry.amber.readparm import AmberParm
import ParmedTools.ParmedActions as pact


parm = AmberParm('test.parm7')
atom_name = parm.parm_data['ATOM_NAME']

for atom in parm.atom_list:
  idx = atom.starting_index

  if atom_name[idx].startswith('DU'):
    for bond in atom.bonds:
      idx1 = bond.atom1.starting_index + 1
      idx2 = bond.atom2.starting_index + 1

      act = pact.setbond(parm, '.%i .%i %f %f' % (idx1, idx2, 99.9, 0.999) )
      act.execute()

  if atom_name[idx].startswith('DU'):
    for ang in atom.angles:
      idx1 = ang.atom1.starting_index + 1
      idx2 = ang.atom2.starting_index + 1
      idx3 = ang.atom3.starting_index + 1

      act = pact.setangle(parm, '.%i .%i .%i %f %f' % (idx1, idx2, idx3,
                                                        99.9, 99.9) )
      act.execute()

parm.overwrite = True
parm.writeParm('mod.parm7')
-- Scanned by iCritical.


_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber

Received on Wed Mar 26 2014 - 08:30:03 PDT
Custom Search