Commit e76fe9c2 authored by peastman's avatar peastman
Browse files

Merge pull request #125 from peastman/master

Improved error checking in ForceField
parents 9df60d18 61ea4d43
...@@ -590,8 +590,8 @@ def _findMatchErrors(forcefield, res): ...@@ -590,8 +590,8 @@ def _findMatchErrors(forcefield, res):
# Return an appropriate error message. # Return an appropriate error message.
if numBestMatchAtoms == numResidueAtoms: if numBestMatchAtoms == numResidueAtoms:
chainLength = len(list(res.chain.residues())) chainResidues = list(res.chain.residues())
if chainLength > 1 and (res.index == 0 or res.index == chainLength-1): if len(chainResidues) > 1 and (res == chainResidues[0] or res == chainResidues[-1]):
return 'The set of atoms matches %s, but the bonds are different. Perhaps the chain is missing a terminal group?' % bestMatchName return 'The set of atoms matches %s, but the bonds are different. Perhaps the chain is missing a terminal group?' % bestMatchName
return 'The set of atoms matches %s, but the bonds are different.' % bestMatchName return 'The set of atoms matches %s, but the bonds are different.' % bestMatchName
if bestMatchName is not None: if bestMatchName is not None:
......
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