[Biopython] Writing into a PDB file using PDBIO module

life happy iitlife2008 at gmail.com
Tue Jul 21 16:35:58 EDT 2009


I have tried using   io.save("pdb_out_filename", se.accept_model(alt_model))

       I get error as , 'int' object has no attribute 'accept_model'

If I use  io.save("pdb_out_filename", se = accept_model(alt_model))

      I get Error: name 'accept_model' is not defined

In both the cases I created 'se' an object of Bio.PDB.Select()
Do you have an example for printing out some part of PDB?




On Tue, Jul 21, 2009 at 2:13 AM, Peter <biopython at maubp.freeserve.co.uk>wrote:

> 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