[Biopython] writing a PDB----PLEASEEEE HELP

João Rodrigues anaryin at gmail.com
Mon Oct 25 16:09:12 UTC 2010


Dear Martin,

To write a new PDB file you first must ensure that there are no naming
clashes. This means that you can't have two chains named A, nor two residues
numbered 12 in the same chain for example.

For your particular problem, I'd suggest the following:

Renaming the first (reference) structure chains to start from A. Then rename
the following structures chains accordingly.

Try for example using a combination of a for loop with the Python chr
function (A character is ord 65). Very crudely:

i_chain = 65
for structure in list_of_structures:
  for chain in structure:
    chain.id = chr(i_chain)
    i_chain += 1

This should fix your chain problems. Afterwards, all you need is to combine
all your chains in ONE structure object. I believe it to be easier.

Just add your structure B information to your structure A information. Check
the documentation<http://www.biopython.org/DIST/docs/cookbook/biopdb_faq.pdf>on
how to manipulate SMCRA objects.

This will yield you a final structure object with both structure A and
structure B which you can then output and save.

Hope it helps! Best!

João [...] Rodrigues
http://doeidoei.wordpress.org



On Mon, Oct 25, 2010 at 5:59 PM, Peter Cock <p.j.a.cock at googlemail.com>wrote:

> On Mon, Oct 25, 2010 at 4:36 PM, martin djokovic
> <martin.djokovic at gmail.com> wrote:
> > So if we just focus on superimposing A and B for now-
> > Are you saying its impossible to do it while A and B are seperate PDB's?
> > They should be in the same PDB?
> > Ok like the example in the warwick university site for 1JOY?? Oh I see-I
> > thought that I could do the same thing but do it for 2 seperate
> > PDB's--please confirm this.
> > I was really getting confused as I tried to follow that as much as
> possible
> > but do it using 2 files
>
> The example on my Warwick page uses a single PDB file containing
> multiple models, but you can superimpose two separate PDB files with
> Biopython.
>
> You (apparently) are stuck at a different task - combining two PDB
> files into one. You need to be careful about not creating a bad PDB
> file where residues or chains are multiply defined (e.g. if both your
> structures are called Chain A in Model 1).
>
> Peter
> _______________________________________________
> Biopython mailing list  -  Biopython at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biopython
>




More information about the Biopython mailing list