Bio.PDB.ic_rebuild module

Convert XYZ Structure to internal coordinates and back, test result.

Bio.PDB.ic_rebuild.structure_rebuild_test(entity, verbose: bool = False, quick: bool = False) Dict

Test rebuild PDB structure from internal coordinates.

Parameters
  • entity (Entity) – Biopython Structure, Model or Chain. Structure to test

  • verbose (bool) – default False. print extra messages

  • quick (bool) – default False. only check atomArrays are identical in internal_to_atom_coords computation

Returns

dict comparison dict from compare_residues()

Bio.PDB.ic_rebuild.report_IC(entity: Union[Bio.PDB.Structure.Structure, Bio.PDB.Model.Model, Bio.PDB.Chain.Chain, Bio.PDB.Residue.Residue], reportDict: Optional[Dict[str, Any]] = None, verbose: bool = False) Dict[str, Any]

Generate dict with counts of ic data elements for each entity level.

reportDict entries are:
  • idcode : PDB ID

  • hdr : PDB header lines

  • mdl : models

  • chn : chains

  • res : residue objects

  • res_e : residues with dihedra and/or hedra

  • dih : dihedra

  • hed : hedra

Parameters

entity (Entity) – Biopython PDB Entity object: S, M, C or R

Raises
  • PDBException – if entity level not S, M, C, or R

  • Exception – if entity does not have .level attribute

Returns

dict with counts of IC data elements

Bio.PDB.ic_rebuild.IC_duplicate(entity) Bio.PDB.Structure.Structure

Duplicate structure entity with IC data, no atom coordinates.

Employs write_PIC(), read_PIC() with StringIO buffer. Calls Chain.atom_to_internal_coordinates() if needed.

Parameters

entity (Entity) – Biopython PDB Entity (will fail for Atom)

Returns

Biopython PDBStructure, no Atom objects

Bio.PDB.ic_rebuild.compare_residues(e0: Union[Bio.PDB.Structure.Structure, Bio.PDB.Model.Model, Bio.PDB.Chain.Chain], e1: Union[Bio.PDB.Structure.Structure, Bio.PDB.Model.Model, Bio.PDB.Chain.Chain], verbose: bool = False, quick: bool = False, rtol: Optional[float] = None, atol: Optional[float] = None) Dict[str, Any]

Compare full IDs and atom coordinates for 2 Biopython PDB entities.

Skip DNA and HETATMs.

Parameters
  • e0,e1 (Entity) – Biopython PDB Entity objects (S, M or C). Structures, Models or Chains to be compared

  • verbose (bool) – Whether to print mismatch info, default False

  • quick (bool) – default False. Only check atomArrays are identical, aCoordMatchCount=0 if different

  • atol (float rtol,) – default 1e-03, 1e-05 or round to 3 places. Numpy allclose parameters; default is to round atom coordinates to 3 places and test equal. For ‘quick’ will use defaults above for comparing ataomArrays

Returns dict

Result counts for Residues, Full ID match Residues, Atoms, Full ID match atoms, and Coordinate match atoms; report string; error status (bool)

Bio.PDB.ic_rebuild.write_PDB(entity: Bio.PDB.Structure.Structure, file: str, pdbid: Optional[str] = None, chainid: Optional[str] = None) None

Write PDB file with HEADER and TITLE if available.