[Biopython] Module Polypeptide

Peter biopython at maubp.freeserve.co.uk
Mon Jun 8 23:02:12 UTC 2009


On Mon, Jun 8, 2009 at 11:41 PM, stanam bharat<bharat.s007 at gmail.com> wrote:
>
> Hi Peter,
>
> This code is to write out the chain sequence along with its chain id and pdb
> id.
>
> {{{
> #ipython
>
> from Bio.PDB.PDBParser import PDBParser
> p=PDBParser(PERMISSIVE=1)
> structure_id="3FCS"
> filename="pdb3fcs.ent"
> s=p.get_structure(structure_id, filename)
>
> from Bio.PDB.Polypeptide import PPBuilder
> ppb=PPBuilder()
> i = 0
> for pp in ppb.build_peptides(s) :
...

Yes, as I had surmised, you have explicitly asked Biopython to assess
the atomic data to see how fragmented the stated chains are (by using
the PDBuilder class).

If you trust the chains as given in the file, just access them from
within the structure. Something like this...

from Bio.PDB.PDBParser import PDBParser
p=PDBParser(PERMISSIVE=1)
structure_id="3FCS"
filename="pdb3fcs.ent"
s=p.get_structure(structure_id, filename)
for model in s :
    #NMR files have lots of models,
    #x-ray crystallography gives just one
    for chain in model :
        print chain
        for residue in chain :
           print residue

(untested - this is from memory).

Peter



More information about the Biopython mailing list