[BioPython] hsexposure.py
Peter
biopython at maubp.freeserve.co.uk
Thu Feb 12 12:05:09 UTC 2009
On Fri, Feb 6, 2009 at 5:42 PM, Bhima A van der Molen <bav853 at bham.ac.uk> wrote:
> Hi,
>
> I am a newbe to the list.. I just started my PhD and I am trying to get
> some calculations for surface accessibility for some proteins stored in
> PDB format.
>
> There is a niffty little script included with the BioPython download in
> the scripts folder called hsexposure.py which is supposed to calculate
> the half sphere exposure of each residue in the PDB file. However, when
> I run it with the option to calculate HSE (all variations) I get 0
> stored in the b-factor column of my PDB file instead of the count..
It looks like the hsexposure script may be a tiny it out of date, I'll
have a quick look at this.
> so I tried extracting the code I want specifically.. i.e. the part to
> calculate the HSEBU values and tried to get it to print on the screen..
> I get the same result.. 0.0 as my HSE value.. see code below:
>
> hse=PDB.HSExposureCB(m, RADIUS)
> k = 'EXP_HSE_A_U'
Your code was looking for the EXP_HSE_A_U result, but never calculated
it. If you used HSExposureCB, then the extra data keys are
EXP_HSE_B_U and EXP_HSE_B_D. If you want EXP_HSE_A_U then use the
HSExposureCA class instead.
e.g.
##code begins##
from Bio import PDB
pdbfile=open('1AD5.pdb')
p=PDB.PDBParser()
s=p.get_structure('X', pdbfile)
m=s[0]
RADIUS=12.0
print "Using CB"
hse=PDB.HSExposureCB(m, RADIUS)
residue_list=PDB.Selection.unfold_entities(m,'R')
for r in residue_list[:10]:
print r.get_resname(), r.xtra
print "..."
print "Using CA"
hse=PDB.HSExposureCA(m, RADIUS)
residue_list=PDB.Selection.unfold_entities(m,'R')
for r in residue_list[:10]:
print r.get_resname(), r.xtra
print "..."
##code ends##
Peter
More information about the Biopython
mailing list