为什么会呢Bio.PDB.MMCIF2Dict()不见了?

2024-09-25 02:26:18 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试图根据The Biopython Structural Bioinformatics FAQ的提示,从PDB文件中获取多少“header”信息。我被引导使用mmCIF版本。但包装/鸡蛋似乎有些奇怪:

>>> from Bio.PDB import *
>>> cifFile = '.../path2/3VQ8.cif'
>>> mmcif_dict = MMCIF2Dict(cifFile)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'MMCIF2Dict' is not defined

如果我完全符合课程要求,则会出现不同的错误:

^{pr2}$

请注意,大多数生物数据库如我所料:

>>> parser=PDBParser(PERMISSIVE=1)
>>> inf = '.../path2/3NF8.pdb'
>>> structure=parser.get_structure('3Nf8',inf)
>>> structure.header.keys()
['structure_method', 'head', 'journal_reference', 'compound',
 'name', 'author', 'deposition_date', 'release_date', 'source',
 'resolution', 'structure_reference']

我有一个最新版本:

>>> Bio.__version__
'1.61'

哪个MMCIF2Dict.py文件在Bio egg中,但MMCIF2Dict不在模块中:

>>> dir(Bio.PDB)
['AbstractPropertyMap', 'Atom', 'CaPPBuilder', 'Chain', 'DSSP', 'Dice',
 'Entity', 'ExposureCN', 'FragmentMapper', 'HSExposure', 'HSExposureCA',
 'HSExposureCB', 'Model', 'NeighborSearch', 'PDBExceptions', 'PDBIO',
 'PDBList', 'PDBParser', 'PPBuilder', 'Polypeptide', 'Residue',
 'ResidueDepth', 'Select', 'Selection', 'Structure',
 'StructureAlignment', 'StructureBuilder', 'Superimposer', 'Vector',
 '__builtins__', '__doc__', '__file__', '__name__', '__package__',
 '__path__', 'calc_angle', 'calc_dihedral', 'extract', 'get_surface',
 'is_aa', 'm2rotaxis', 'make_dssp_dict', 'mmCIF', 'parse_pdb_header',
 'refmat', 'rotaxis', 'rotaxis2m', 'rotmat', 'standard_aa_names',
 'to_one_letter_code', 'vector_to_axis']

有人有线索吗?在


Tags: 文件name版本parserisstructuredictpdb
1条回答
网友
1楼 · 发布于 2024-09-25 02:26:18

你可以在^{}'s ^{}中找到答案。在

简而言之,from Bio.PDB import *导入__init__.py名称空间中的所有内容。如果你读__init__.py,你可以看到it imports ^{},但是不是MMCIF2Dict(至少不是直接读):^{} imports ^{},并在那里使用它。在

所以,如果你这么做了,它应该可以毫无怨言地工作。但是,from Bio.PDB import *不会将MMCIF2Dict放入当前命名空间中。在

相关问题 更多 >