The modelcif.reader Python module

Utility classes to read in information in mmCIF or BinaryCIF format

modelcif.reader.read(fh, model_class=<class 'modelcif.model.Model'>, format='mmCIF', handlers=[], warn_unknown_category=False, warn_unknown_keyword=False, reject_old_file=False, variant=<class 'modelcif.reader.ModelCIFVariant'>)[source]

Read data from the file handle fh.

See ihm.reader.read() for more information. The function here behaves similarly but reads in files compliant with the ModelCIF extension directory rather than IHM.

Note that if a custom model_class is provided, any models present in the file will be returned as that type, regardless of their type stated in the mmCIF file (e.g. homology model, ab initio model). (However, the model_type attribute will be set appropriately.)

If the input file references any associated files, they will be listed in modelcif.System.repositories. The files will not be downloaded or read in, however.

Returns:

A list of modelcif.System objects.

class modelcif.reader.ModelCIFVariant[source]

Used to select typical PDBx/ModelCIF file input. See read() and ihm.reader.Variant.