Commit 17e2b783 authored by John Chodera (MSKCC)'s avatar John Chodera (MSKCC)
Browse files

Bugfixes in Residue bond accessors and ForceField.createSystem()

parent 28be5895
...@@ -581,7 +581,7 @@ class ForceField(object): ...@@ -581,7 +581,7 @@ class ForceField(object):
if matches is None: if matches is None:
# No existing templates match. Try any registered residue template generators. # No existing templates match. Try any registered residue template generators.
for generator in self._templateGenerators: for generator in self._templateGenerators:
if generator(forcefield, res): if generator(self, res):
# This generator has registered a new residue template that should match. # This generator has registered a new residue template that should match.
[template, matches] = self._getResidueTemplateMatches(res, bondedToAtom) [template, matches] = self._getResidueTemplateMatches(res, bondedToAtom)
if matches is None: if matches is None:
......
...@@ -373,17 +373,17 @@ class Residue(object): ...@@ -373,17 +373,17 @@ class Residue(object):
def bonds(self): def bonds(self):
"""Iterate over all Bonds involving any atom in this residue.""" """Iterate over all Bonds involving any atom in this residue."""
bonds = [ bond for bond in residue.chain.topology.bonds() if ((bond[0] in self._atoms) or (bond[1] in self._atoms)) ] bonds = [ bond for bond in self.chain.topology.bonds() if ((bond[0] in self._atoms) or (bond[1] in self._atoms)) ]
return iter(bonds) return iter(bonds)
def internal_bonds(self): def internal_bonds(self):
"""Iterate over all internal Bonds.""" """Iterate over all internal Bonds."""
bonds = [ bond for bond in residue.chain.topology.bonds() if ((bond[0] in self._atoms) and (bond[1] in self._atoms)) ] bonds = [ bond for bond in self.chain.topology.bonds() if ((bond[0] in self._atoms) and (bond[1] in self._atoms)) ]
return iter(bonds) return iter(bonds)
def external_bonds(self): def external_bonds(self):
"""Iterate over all Bonds to external atoms.""" """Iterate over all Bonds to external atoms."""
bonds = [ bond for bond in residue.chain.topology.bonds() if ((bond[0] in self._atoms) != (bond[1] in self._atoms)) ] bonds = [ bond for bond in self.chain.topology.bonds() if ((bond[0] in self._atoms) != (bond[1] in self._atoms)) ]
return iter(bonds) return iter(bonds)
def __len__(self): def __len__(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment