本文整理汇总了Python中molecule.Molecule.atomname[i]方法的典型用法代码示例。如果您正苦于以下问题:Python Molecule.atomname[i]方法的具体用法?Python Molecule.atomname[i]怎么用?Python Molecule.atomname[i]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类molecule.Molecule
的用法示例。
在下文中一共展示了Molecule.atomname[i]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Molecule
# 需要导入模块: from molecule import Molecule [as 别名]
# 或者: from molecule.Molecule import atomname[i] [as 别名]
anumMap_gro.append(anumInResidue[anameInResidue_gro.index(aname)])
anumInResidue = []
anameInResidue_pdb = []
anameInResidue_gro = []
amb_pdb = Molecule(amb_outpdbfnm, build_topology=False)
anumInResidue = []
anameInResidue_pdb = []
anameInResidue_amb = []
# For an atom number in the original .pdb file, this is the corresponding atom number in the .gro file
anumMap_amb = []
for i in range(pdb.na):
# A peculiar thing sometimes happens with a hydrogen being named "3HG1" where in fact it shold be "HG13"
if pdb.atomname[i][0] in ['1','2','3'] and pdb.atomname[i][1] == 'H':
pdb.atomname[i] = pdb.atomname[i][1:] + pdb.atomname[i][0]
anumInResidue.append(i)
anameInResidue_pdb.append(pdb.atomname[i])
anameInResidue_amb.append(amb_pdb.atomname[i])
if (i == (pdb.na - 1)) or ((pdb.chain[i+1], pdb.resid[i+1]) != (pdb.chain[i], pdb.resid[i])):
if set(anameInResidue_pdb) != set(anameInResidue_amb):
print set(anameInResidue_pdb).symmetric_difference(set(anameInResidue_amb))
print "AMBER PDB: Atom names do not match for residue %i (%s)" % (pdb.resid[i], pdb.resname[i])
raise RuntimeError
for anum, aname in zip(anumInResidue, anameInResidue_pdb):
anumMap_amb.append(anumInResidue[anameInResidue_amb.index(aname)])
anumInResidue = []
anameInResidue_pdb = []
anameInResidue_amb = []
anumMap_amb_gro = [None for i in range(pdb.na)]