Sunday 15 May 2011

python - Biopython PDB: get resseq -



python - Biopython PDB: get resseq -

i've parsed pdb file list of residues:

res_list=pdb.selection.unfold_entities(find_chain(par), 'r')

(find_chain function selects chain need), , i'm doing loop on residues, calculating specific factor every one. need "resseq" (because, if understood, number of residue reported in pdb file). if

for residue in res_list: print residue

i get

<residue ser het= resseq=1 icode= > <residue gln het= resseq=2 icode= > <residue ala het= resseq=3 icode= >...

but can't find function access number after "resseq". know can manipulate string, wonder if there biopython function somehow!! give thanks you!

the residue object have attribute segid, tuple hetflag, resseq , icode passed on creation. guess can access resseq with:

resseq = residue.segid[1]

but "right" way using get_full_id method entity object, residue inherits:

resseq = residue.get_full_id()[3][1] # or if need chain, model or structure, load of them variable residue_id = residue.get_full_id() resseq = residue_id[3][1]

python biopython

No comments:

Post a Comment