from Bio import PDB
pdbfile=open('2wqq.pdb')
p=PDB.PDBParser()
s=p.get_structure('X', pdbfile)
m=s[0]
RADIUS=10.0
hse=PDB.HSExposureCA(m, RADIUS)
residue_list=PDB.Selection.unfold_entities(m,'R')
for r in residue_list[:]:
print(r.get_resname(), r.xtra)
This returns a dictionary for each residue where the keys are 'EXP_HSE_A_U', 'EXP_HSE_A_D', and 'EXP_CB_PCB_ANGLE'. I would instead like a dictionary where the key is the residue id number of r and the values are the residue id numbers of residues within the 'up' half shell. Does anybody know how I could do this?
Update:
Got it almost sort of working, but the output doesn't seem to be correct. The following code is supposed to make a dictionary of residues that are nearby (within defined radius), the angle between res1 Ca-Cb and res1 Ca-res2 Ca is less than 90 degrees, and the angle between res 2 Ca-Cb and res2 Ca - res1 Ca is less than 90 degrees. I'm sorry if it's a mess. I don't know what I am doing. I think there's something wrong with the angle calculation...