[BioPython] BioPDB: get_resname() example?
Thomas Hamelryck
thamelry at binf.ku.dk
Tue Sep 6 11:23:44 EDT 2005
On Tuesday 06 September 2005 17:16, Douglas Kojetin wrote:
> 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)
Suppose you have one model (i.e. with model id=0), and a chain that is called
'A', then you do something like:
r=s[0]['A'][5]
print r.get_resname()
Cheers,
-Thomas
More information about the BioPython
mailing list