[Biopython] Writing into a PDB file using PDBIO module

Peter biopython at maubp.freeserve.co.uk
Tue Jul 21 09:13:13 UTC 2009


Please keep the mailing list CC'd.

On Mon, Jul 20, 2009 at 11:59 PM, life happy<iitlife2008 at gmail.com> wrote:
> Yes! I have read this.

I'm glad you found that page (something I'd like to integrate into the
main Biopython Tutorial at some point):
http://www.warwick.ac.uk/go/peter_cock/python/protein_superposition/

> Which step applies the transformation?Isn't that
> set_atoms function? I am able to print RMS value. I did not follow the
> superimpose.apply(alt_model.get_atoms()) .

As the name should suggest, superimpose.apply(...) actually applies the
transformation. This is what you are missing. The set_atoms(...) just tells
the code which atoms are going to be superimposed.

> According to description in BioPDB faq pdf and
> http://www.biopython.org/DIST/docs/api/Bio.PDB.Superimposer%27.Superimposer-class.html
> set_atom does the transformation, right? If I am wrong, please correct me!

That docstring is rather confusing, we should fix that.

> Also,In which step are we sending the transformed co-ordinates into
> the PDB file?

These lines write out the PDB file for the whole structure:

io=Bio.PDB.PDBIO()
io.set_structure(structure)
io.save(pdb_out_filename)

> Also, the output PDB file has whole protein, I only want the short peptides
> aligned(only the atom lists that I gave as input must be aligned, not the
> whole protein of peptides).

If you only want some of the protein written, then you should only give
some of the structure to the PDB output code.

Peter



More information about the Biopython mailing list