[Biopython] Save custom structure...

Yasser Almeida Hernández pedro.al at fenhi.uh.cu
Wed Jan 6 16:24:43 UTC 2010


I just set Asp10 in 1xyz as a hypothetical residue in a hypothetical  
structure.
One last thing:  to select the CB atom in that Arg519 with the  
MySelector class and return it with the residue, how it would be...?

Thanks

> Have you got a real example? There is no Asp10 in PDB file 1xyz.
> But, if for the sake of argument you wanted Arg519 (in either chain)
> in 1xyz you could do it like this - based on the following example I
> pointed to earlier:
>
> http://lists.open-bio.org/pipermail/biopython/2009-May/005174.html
>
> from Bio.PDB import Select, PDBIO
> from Bio.PDB.PDBParser import PDBParser
>
> class MySelector(Select):
>     def accept_residue(self, residue):
>         #Only want Arg519 (in any chain)
>         return residue.resname=="ARG" and residue.id[1]==519
>
> s=PDBParser().get_structure("1XYZ", "1XYZ.pdb")
> io=PDBIO()
> io.set_structure(s)
> io.save("1XYZ-interesting.pdb", select=MySelector())
> print "Done"
>
>
> Peter

-- 
Lic. Yasser Almeida Hernández
Center of Molecular Inmunology (CIM)
Nanobiology Group
P.O.Box 16040, Havana, Cuba
Phone: (537) 271-7933, ext. 221

----------------------------------------------------------------
Correo FENHI







More information about the Biopython mailing list