Bio.PDB.mmcifio module

Write an mmCIF file.

See for syntax.

class Bio.PDB.mmcifio.MMCIFIO

Bases: Bio.PDB.PDBIO.StructureIO

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


>>> 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)
>>> import os
>>> os.remove("bio-pdb-mmcifio-out.cif")  # tidy up


set_dict(self, dic)

Set the mmCIF dictionary to be written out.

save(self, filepath, select=<Select all>, preserve_atom_numbering=False)

Save the structure to a file.

  • 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.