user1144004
user1144004

Reputation: 302

HSExposure() module is not callable

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]]

When I execute this code, I'm getting this error:

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

What's wrong with it?

Upvotes: 1

Views: 438

Answers (2)

Mal Rey
Mal Rey

Reputation: 31

For anyone like me still looking for the answer:
Most tutorials seem to have this wrong. What worked for me was

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

Please note that HSEalpha is undefined for the first and last residues of a chain.

Upvotes: 3

NPE
NPE

Reputation: 500853

HSExposure is a module, not a class, so you can't instantiate it. There's a bunch of classes in that module, so I assume you want one of them.

Upvotes: 2

Related Questions