[BioPython] BioPDB: get_resname() example?

Douglas Kojetin djkojeti at unity.ncsu.edu
Tue Sep 6 11:16:41 EDT 2005


Hi All-

I've read in a PDB structure (see below), and would like to get the  
residue name for specific sequence positions (e.g. residue number  
5).  Can someone suggest to me how to do this?  I cannot figure it  
out using the Structural Biopython FAQ.

# ---> start

from Bio.PDB import *

pdb='file.pdb'
p=PDBParser();
s=p.get_structure('THE_STRUCTURE', pdb)

# i figured i can get the residue list using this
res_list = Selection.unfold_entities(s, 'R')

# but i'm not sure what to do next, or if there is a better way to  
get the information
# what i would like to do is a get_resname(5), to get the residue  
type of residue 5 (e.g. ASP)

# ---> end


Thanks,
Doug


More information about the BioPython mailing list