The modelcif.associated Python module

Classes to associate extra files with the system.

Typically, one or more Repository objects are created and added to modelcif.System.repositories.

class modelcif.associated.Repository(url_root, files)[source]

An online location where associated files can be found. These objects are typically added to modelcif.System.repositories.

Parameters:
  • url_root (str) – URL root that prefixes each file’s path. For example, if url_root is https://example.com then a File with path test.txt can be found at https://example.com/test.txt. If the files are not available online, None can be used here.

  • files (list) – A list of File objects.

get_url(f)[source]

Get the full URL for the given File

class modelcif.associated.File(path, details=None, data=None)[source]

A single associated file. These objects can be added to a Repository or a ZipFile.

Parameters:
  • path (str) – File name.

  • details (str) – Any additional information about the file.

  • data (Data) – If available, the data (e.g. sequence, structure, alignment) that are stored in the file.

class modelcif.associated.CIFFile(path, details=None, categories=[], copy_categories=[], entry_id='model', entry_details=None, local_path=None, binary=False, data=None)[source]

An associated file in mmCIF or BinaryCIF format. See File for more details.

Parameters:
  • path (str) – File name that will be used to construct URLs in the main mmCIF file (see Repository or ZipFile).

  • details (str) – Any additional information about the file.

  • data (Data) – If available, the data (e.g. sequence, structure, alignment) that are stored in the file.

  • categories (list) – If given, any mmCIF category names in this list are written out to local_path by modelcif.dumper.write() instead of to the primary file handle.

  • copy_categories (list) – If given, any mmCIF category names in this list are written out to both local_path by modelcif.dumper.write() and the primary file handle.

  • entry_id (str) – Unique identifier for the associated file, if written (by specifying categories or copy_categories).

  • entry_details (str) – A comment to be added to the associated file, if written (by specifying categories or copy_categories).

  • local_path (str) – File name that will be used for categories or copy_categories. If not given, it defaults to the same as path. (The file is always written directly to the local disk, even if this object is placed inside a ZipFile.)

  • binary (bool) – If False (the default), any output file is written in mmCIF format; if True, the file is written in BinaryCIF.

property file_format

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

class modelcif.associated.LocalPairwiseQAScoresFile(path, details=None, categories=[], copy_categories=[], entry_id='model', entry_details=None, local_path=None, binary=False, data=None)[source]

An associated file in CIF format containing local pairwise QA scores. See CIFFile for more details.

class modelcif.associated.ZipFile(path, details=None, files=[], data=None)[source]

An associated archive file in zip format, containing other files. See File for more details.

Parameters:

files (list) – A list of the File objects contained within this archive. Note that an archive cannot contain another archive.