Bio.PDB.mmcifio module

Write an mmCIF file.

See https://www.iucr.org/resources/cif/spec/version1.1/cifsyntax for syntax.

class Bio.PDB.mmcifio.MMCIFIO

Bases: Bio.PDB.PDBIO.StructureIO

Write a Structure object or a mmCIF dictionary as a mmCIF file.

Examples

>>> from Bio.PDB import MMCIFParser
>>> from Bio.PDB.mmcifio import MMCIFIO
>>> parser = MMCIFParser()
>>> structure = parser.get_structure("1a8o", "PDB/1A8O.cif")
>>> io=MMCIFIO()
>>> io.set_structure(structure)
>>> io.save("bio-pdb-mmcifio-out.cif")
>>> import os
>>> os.remove("bio-pdb-mmcifio-out.cif")  # tidy up
__init__()

Initialise.

set_dict(dic)

Set the mmCIF dictionary to be written out.

save(filepath, select=_select, preserve_atom_numbering=False)

Save the structure to a file.

Parameters
  • filepath (string or filehandle) – output file

  • select (object) – selects which entities will be written.

Typically select is a subclass of L{Select}, it should have the following methods:

  • accept_model(model)

  • accept_chain(chain)

  • accept_residue(residue)

  • accept_atom(atom)

These methods should return 1 if the entity is to be written out, 0 otherwise.

__annotations__ = {}