[BioPython] Reassigning parent ids in Bio.PDB-structures?

Christian Meesters meesters at uni-mainz.de
Mon Oct 8 15:54:32 UTC 2007


> > breakpoints = [1254, 5444,
> >                 6690, 10888,
> >                 10889, 16332,
> >                 16333, 21776,
> >                 21776, 27220,
> >                 27221, 32665]
> 
> I'm assuming this is "breaks" later on.
Absolutely - that's the pain with copy & paste for demos ... sorry.

> As the reason, I think this is what is happening: Given an atom, then 
> atom.parent will be a residue object, and atom.parent.parent will be a 
> chain object.  Note all the atoms in a single amino acid residue will 
> share share the same .parent, and all the atoms in a single chain will 
> share the same .parent.parent
> 
> i.e. You have renamed Chain "A" to "A", and then later renamed this 
> chain to "B", and then again to "C".  You didn't ever split up the chain 
> into sub chains.
Mh, makes sense. 
> 
> To be honest, I would be tempted to write a quick and dirty script which 
> parsed the raw PDB file, and rewrote the chain field based on the atom 
> sequence number - without the overhead of the PDB parser.
Yes, would have been too easy ;-). Only wanted to add this functionality
to a larger application and make it easy to use. There is no strict need
to do so, but it would have been nice.
However, thanks for the input.

Christian



More information about the Biopython mailing list