【问题标题】:How to get the atoms in the residue using Biopython如何使用 Biopython 获取残基中的原子
【发布时间】:2014-01-08 06:41:23
【问题描述】:

我正在使用 Biopython。我想找出残基中的原子。

from Bio import PDB

pdb = "1dly.pdb"
name = pdb[:3]

p = PDB.PDBParser()
s = p.get_structure(name, pdb)

y = s.get_residues()
for x in y:
    print x, x.resname

我得到了残基名称,但我需要得到残基中的原子。我该怎么做?

【问题讨论】:

    标签: python biopython


    【解决方案1】:

    迭代 Residue object 将产生以下原子:

    for res in s.get_residues():
        for atom in res:
            print atom
    

    如果您希望从任意EntityEntity 对象列表中获取原子,您可能想尝试unfold_entities

    for atom in PDB.Selection.unfold_entities([res_1, res_2], target_level='A'):
        print atom
    

    此外,Structure 对象有一个方法 get_atoms() 将产生结构中的所有原子。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-11-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-13
      相关资源
      最近更新 更多