[BioPython] error in writting pdb file

Peter biopython at maubp.freeserve.co.uk
Mon Dec 29 23:24:46 UTC 2008


On Mon, Dec 29, 2008 at 9:37 PM, Bala subramanian
<bala.biophysics at gmail.com> wrote:
> Dear Friends,
>
> When i try to write a pdb file with PDBIO, i get the following error. What
> could be the possible reason for the same.
>
>>>> out=PDBIO()
>>>> out.set_structure(s)
>>>> out.save("new.pdb")
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File
> "/home/bala/Desktop/biopython-1.49/build/lib.linux-i686-2.5/Bio/PDB/PDBIO.py",
> line 150, in save
>  File
> "/home/bala/Desktop/biopython-1.49/build/lib.linux-i686-2.5/Bio/PDB/PDBIO.py",
> line 84, in _get_atom_line
> TypeError: %c requires int or char
>
> Thanks in advance,
> Bala

Something in one of your atom objects isn't as expected.  The
_get_atom_line code is trying to construct a string for an atom line
for the PDB file, but one of the strong formatting arguments isn't
setup right (the TypeError about %c).

Without seeing how you constructed the structure (variable s in your
code) its hard to guess what is wrong.  Maybe one of the required
properties is set to None?

Peter



More information about the Biopython mailing list