本文整理汇总了Python中MolKit.molecule.AtomSet.remove方法的典型用法代码示例。如果您正苦于以下问题:Python AtomSet.remove方法的具体用法?Python AtomSet.remove怎么用?Python AtomSet.remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MolKit.molecule.AtomSet
的用法示例。
在下文中一共展示了AtomSet.remove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: LigandMixin
# 需要导入模块: from MolKit.molecule import AtomSet [as 别名]
# 或者: from MolKit.molecule.AtomSet import remove [as 别名]
#.........这里部分代码省略.........
self.buildBondsByDistance()
hs = self.allAtoms.get(lambda x: x.element=='H')
self.nphs = AtomSet()
if not hs:
msg = ' -no polar hydrogens found!\n'
if hs:
nphs = hs.get(lambda x: x.bonds[0].atom1.element=='C' or \
x.bonds[0].atom2.element=='C')
if nphs:
self.nphs = nphs
msg = ' -found ' + str(len(self.nphs)) + ' nonpolar hydrogens\n'
else:
msg = ' -no nonpolar hydrogens\n'
return msg
def mergeNPHS(self):
lenNPHS = len(self.nphs)
if not lenNPHS:
return
nphs = self.nphs
atLen = len(self.allAtoms)
self.allAtoms = self.allAtoms - nphs
#first add charge to nph's heavy atom
chList = nphs[0]._charges.keys()
if not len(chList):
print 'no charges present'
return 'XXX'
#check that all nphs have a certain kind of charge
for at in nphs:
chs = at._charges.keys()
for c in chList:
if c not in chs:
chList.remove(c)
if len(chList):
for chargeSet in chList:
for h in nphs:
b = h.bonds[0]
c = b.atom1
if c==h:
c = b.atom2
c._charges[chargeSet] = c._charges[chargeSet] + h._charges[chargeSet]
#next delete nphs
for h in nphs:
b = h.bonds[0]
c = b.atom1
if c==h:
c = b.atom2
c.bonds.remove(b)
h.bonds = BondSet()
h.parent.remove(h)
#nb:
#these don't show up in deleteMol.getFreeMemoryInformation
del h
self.nphs = AtomSet()
return ' and merged them\n', nphs
def checkBonds(self):
"""
checkBonds
"""
msg = ""
#print self.name, ':'
nphs = AtomSet()
if len(self.nphs) and self.autoMergeNPHS: