Skip to content

Prevent PDBIO from writing large structures not supported in PDB format #1085

Closed

Description

@JoaoRodrigues

The PDB format specification imposes several limits on the number of atoms, residues, and chains that can be written to file. This is one of the reasons behind the move to the mmCIF format as the default structural data storage format.

Since we have the ability to read both PDB and mmCIF structures, but only to write PDB files, there should be a check to prevent writing very large structures that break the format specifications: > 99.999 atoms, >9999 residues, >1 character chains, etc.

Activity

  1. peterjc commented on Mar 8, 2017

    @peterjc
    Member

    Good idea.

  2. merkys commented on Mar 17, 2022

    @merkys
    Contributor

    This is still an issue in Biopython 1.79. I have an input PDB file with >100k atoms (some of them with non-unique numbers). After reading it in via Bio.PDB.PDBParser and writing with PDB.PDBIO I get a PDB file with 6-digit atom numbers which break the PDB format. It would be great at least see a warning and, even better, having atoms with IDs >=100k somehow fitted into 5-digit field (maybe loosing excess left hand side digits).

    Edit: Aforementioned problem might be circumvented by using:

    io = PDBIO()
    io.set_structure(struct)
    io.save('out.pdb', preserve_atom_numbering=True)
  3. JoaoRodrigues commented on Mar 17, 2022

    @JoaoRodrigues
    MemberAuthor

    Good point indeed, this was sort of forgotten... thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions