HSExposure()模块不可调用

时间:2012-02-05 11:57:01

标签: python biopython

from Bio.PDB import *
parser=PDBParser()
structure=parser.get_structure('cal1','3CLN.pdb')
model=structure[0]
chain=model["A"]
hse=HSExposure()
expca=hse.calc_hs_exposure(model,option='CA3')
print expca[chain[40]]

当我执行此代码时,我收到此错误:

File "D:\python\Core\pdb_2.py", line 6, in <module>
    hse=HSExposure()
TypeError: 'module' object is not callable

它出了什么问题?

2 个答案:

答案 0 :(得分:2)

HSExposure是一个模块,而不是一个类,所以你无法实例化它。有一个bunch of classes in that module,所以我假设你想要其中一个。

答案 1 :(得分:2)

对于像我这样的人仍在寻找答案:
大多数教程似乎都有这个错误。对我有用的是

exp_ca = HSExposureCA(model)  
res_id = residue.get_id()  
print(exp_ca[(chain.get_id(), res_id)])  

请注意,对于链的第一个和最后一个残基,HSEalpha未定义。