本文整理汇总了Python中MolKit.Read.allAtoms方法的典型用法代码示例。如果您正苦于以下问题:Python Read.allAtoms方法的具体用法?Python Read.allAtoms怎么用?Python Read.allAtoms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MolKit.Read
的用法示例。
在下文中一共展示了Read.allAtoms方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
# 需要导入模块: from MolKit import Read [as 别名]
# 或者: from MolKit.Read import allAtoms [as 别名]
atoms_to_adopt = lM.allAtoms[:]
#atoms_to_adopt = lM.allAtoms.get(lambda x: not x in lig_atoms)
if verbose: print "there are %d atoms_to_adopt" %(len(atoms_to_adopt))
#(3) remove the bonds to the three excluded atoms
###attachment_atom.bonds.remove(bond_to_break)
###print "removed %s-%s bond from %s"%(bond_to_break.atom1.name, bond_to_break.atom2.name, attachment_atom.full_name())
###bond_to_break.neighborAtom(attachment_atom).bonds.remove(bond_to_break)
if verbose: print 'before removing rat1,rat2 and rat3, residue %s has %d atoms.' %( resP.name, len(resP.atoms))
#remove rat1, rat2 and rat3
resP.atoms.remove(rat1)
if verbose: print 'removed rat1 %s'%rat1.full_name()
resP.atoms.remove(rat2)
if verbose: print 'removed rat2 %s'%rat2.full_name()
resP.atoms.remove(rat3)
if verbose: print 'removed rat3 %s'%rat3.full_name()
rM.allAtoms = rM.chains.residues.atoms
if verbose: print 'after removing rat1,rat2 and rat3 but before adding ligand atoms, residue %s has %d atoms.' %( resP.name, len(resP.atoms))
if verbose: print 'and the receptor has %d atoms'%len(rM.allAtoms)
#keep handle to existing atoms for possible clashes
res_atoms_to_check = resP.atoms[:]
#(4) add the ligand atoms to the residue
#for h in atoms_to_adopt:
for h in lM.allAtoms:
resP.adopt(h)
if verbose: print "%s added to %s"%(h.full_name(), resP.full_name())
if verbose: print 'after adding %d ligand atoms, residue %s has %d atoms.' %( len(lM.allAtoms), resP.name, len(resP.atoms))
rM.allAtoms = rM.chains.residues.atoms
if verbose: print 'and the receptor has %d atoms'%len(rM.allAtoms)
#(5) add the bonds between at3 'CB' in the ligand and the attachment atom in the receptor
rM.addBond(at3, atom_to_attach)
if verbose: