Bio.PDB.mmtf.mmtfio module

Write a MMTF file.

class Bio.PDB.mmtf.mmtfio.MMTFIO

Bases: Bio.PDB.PDBIO.StructureIO

Write a Structure object as a MMTF file.


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


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

Save the structure to a file.

  • filepath (string) – 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.