raiseValueError('No template found for residue %d (%s). This might mean your input topology is missing some atoms or bonds, or possibly that you are using the wrong force field.'%(res.index+1,res.name))
raiseValueError('No template found for residue %d (%s). %s'%(res.index+1,res.name,_findMatchErrors(self,res)))
foratom,matchinzip(res.atoms(),matches):
foratom,matchinzip(res.atoms(),matches):
data.atomType[atom]=template.atoms[match].type
data.atomType[atom]=template.atoms[match].type
forsiteintemplate.virtualSites:
forsiteintemplate.virtualSites:
...
@@ -461,19 +461,24 @@ class ForceField(object):
...
@@ -461,19 +461,24 @@ class ForceField(object):
returnsys
returnsys
def_createResidueSignature(elements):
def_countResidueAtoms(elements):
"""Create a signature for a residue based on the elements of the atoms it contains."""
"""Count the number of atoms of each element in a residue."""
counts={}
counts={}
forelementinelements:
forelementinelements:
ifelementisNone:
ifelementincounts:
pass# This residue contains "atoms" (probably virtual sites) that should match any element
elifelementincounts:
counts[element]+=1
counts[element]+=1
else:
else:
counts[element]=1
counts[element]=1
returncounts
def_createResidueSignature(elements):
"""Create a signature for a residue based on the elements of the atoms it contains."""
return'The set of atoms is similar to %s, but it is missing %d extra particles. You can add them with Modeller.addExtraParticles().'%(bestMatchName,numBestMatchAtoms-numResidueAtoms)
return'The set of atoms is similar to %s, but it is missing %d atoms.'%(bestMatchName,numBestMatchAtoms-numResidueAtoms)
return'This might mean your input topology is missing some atoms or bonds, or possibly that you are using the wrong force field.'
# The following classes are generators that know how to create Force subclasses and add them to a System that is being
# The following classes are generators that know how to create Force subclasses and add them to a System that is being
# created. Each generator class must define two methods: 1) a static method that takes an etree Element and a ForceField,
# created. Each generator class must define two methods: 1) a static method that takes an etree Element and a ForceField,
# and returns the corresponding generator object; 2) a createForce() method that constructs the Force object and adds it
# and returns the corresponding generator object; 2) a createForce() method that constructs the Force object and adds it