[BioPython] residue sequence number length (no more than 4 digits)

Wolfgang Meyer wolfgang.meyer at gmail.com
Tue Jan 1 17:33:41 UTC 2008


Hi,

According to PDB format (old), residue sequence number length should be no
longer than 4 digits.

...
23 - 26    Integer     resSeq    Residue sequence number.
...

However, Bio.PDB.Residue.__init__(...) does not check the length of this
parameter, neither does Bio.PDB.PDBIO. Though Bio.PDB.PDBIO tries to
restrict the length of residue sequence number to 4 in the format string:

_ATOM_FORMAT_STRING="%s%5i %-4s%c%3s %c%4i%c
%8.3f%8.3f%8.3f%6.2f%6.2f      %4s%2s%2s\n"

This does not prevent a residue sequence number longer than 4 digits to be
written into a PDB file by PDBIO. Such a PDB file would be considered false
by many PDB file parsers.

Of course users should be responsible to feed residue sequence number of
valid length to a residue. However, wouldn't it be better to handle some
careless input of wrong residue sequence number in BioPython?

Thanks!
-- 
Wolfgang Meyer



More information about the Biopython mailing list