mmCIF File

This module defines functions for parsing mmCIF files.

parseMMCIFStream(stream, **kwargs)[source]

Returns an AtomGroup and/or a class:.StarDict containing header data parsed from a stream of CIF lines.

  • stream – Anything that implements the method readlines (e.g. file, buffer, stdin)
  • title (str) – title of the AtomGroup instance, default is the PDB filename or PDB identifier
  • chain (str) – chain identifiers for parsing specific chains, e.g. chain='A', chain='B', chain='DE', by default all chains are parsed
  • subset (str) – a predefined keyword to parse subset of atoms, valid keywords are 'calpha' ('ca'), 'backbone' ('bb'), or None (read all atoms), e.g. subset='bb'
  • model (int, list) – model index or None (read all models), e.g. model=10
  • altloc (str) – if a location indicator is passed, such as 'A' or 'B', only indicated alternate locations will be parsed as the single coordinate set of the AtomGroup, if altloc is set True all alternate locations will be parsed and each will be appended as a distinct coordinate set, default is "A"
parseMMCIF(pdb, **kwargs)[source]

Returns an AtomGroup and/or a StarDict containing header data parsed from an mmCIF file. If not found, the mmCIF file will be downloaded from the PDB. It will be downloaded in uncompressed format regardless of the compressed keyword.

This function extends parseMMCIFStream().

  • pdb (str) – a PDB identifier or a filename If needed, mmCIF files are downloaded using fetchPDB() function.
  • chain (str, tuple, list, ndarray) – comma separated string or list-like of chain IDs