The ihm.location Python module

Classes for tracking external data used by mmCIF models.

class ihm.location.Location(details=None)[source]

Identifies the location where a resource can be found.

Do not use this class itself, but one of its subclasses. Typically the resource may be found in a file (either on the local disk or at a DOI) - for this use one of the subclasses of FileLocation. Alternatively the resource may be found in an experiment-specific database such as PDB or EMDB - for this use DatabaseLocation or one of its subclasses. A Location may be passed to

Parameters:

details (str) – Additional details about the dataset, if known.

class ihm.location.DatabaseLocation(db_code, version=None, details=None)[source]

A dataset stored in an official database (PDB, EMDB, PRIDE, etc.). Generally a subclass should be used specific to the database - for example, PDBLocation, EMDBLocation, or PRIDELocation, although this base class can be used directly for “other” databases not currently supported by the IHM dictionary.

Parameters:
  • db_code (str) – The accession code inside the database.

  • version (str) – The version of the dataset in the database.

  • details (str) – Additional details about the dataset, if known.

class ihm.location.EMDBLocation(db_code, version=None, details=None)[source]

Something stored in the EMDB database. See DatabaseLocation for a description of the parameters and Location for discussion of the usage of these objects.

class ihm.location.PDBLocation(db_code, version=None, details=None)[source]

Something stored in the PDB database. See DatabaseLocation for a description of the parameters and Location for discussion of the usage of these objects.

class ihm.location.PDBDevLocation(db_code, version=None, details=None)[source]

Something stored in the PDB-Dev database. See DatabaseLocation for a description of the parameters and Location for discussion of the usage of these objects.

class ihm.location.ModelArchiveLocation(db_code, version=None, details=None)[source]

Something stored in Model Archive. See DatabaseLocation for a description of the parameters and Location for discussion of the usage of these objects.

class ihm.location.BMRBLocation(db_code, version=None, details=None)[source]

Something stored in the BMRB database. See DatabaseLocation for a description of the parameters and Location for discussion of the usage of these objects.

class ihm.location.MassIVELocation(db_code, version=None, details=None)[source]

Something stored in the MassIVE database. See DatabaseLocation for a description of the parameters and Location for discussion of the usage of these objects.

class ihm.location.EMPIARLocation(db_code, version=None, details=None)[source]

Something stored in the EMPIAR database. See DatabaseLocation for a description of the parameters and Location for discussion of the usage of these objects.

class ihm.location.SASBDBLocation(db_code, version=None, details=None)[source]

Something stored in the SASBDB database. See DatabaseLocation for a description of the parameters and Location for discussion of the usage of these objects.

class ihm.location.PRIDELocation(db_code, version=None, details=None)[source]

Something stored in the PRIDE database. See DatabaseLocation for a description of the parameters and Location for discussion of the usage of these objects.

class ihm.location.JPOSTLocation(db_code, version=None, details=None)[source]

Something stored in the JPOST database. See DatabaseLocation for a description of the parameters and Location for discussion of the usage of these objects.

class ihm.location.BioGRIDLocation(db_code, version=None, details=None)[source]

Something stored in the BioGRID database. See DatabaseLocation for a description of the parameters and Location for discussion of the usage of these objects.

class ihm.location.ProXLLocation(db_code, version=None, details=None)[source]

Something stored in the ProXL database. See DatabaseLocation for a description of the parameters and Location for discussion of the usage of these objects.

class ihm.location.IProXLocation(db_code, version=None, details=None)[source]

Something stored in the iProX database. See DatabaseLocation for a description of the parameters and Location for discussion of the usage of these objects.

class ihm.location.AlphaFoldDBLocation(db_code, version=None, details=None)[source]

Something stored in the AlphaFoldDB database. See DatabaseLocation for a description of the parameters and Location for discussion of the usage of these objects.

class ihm.location.FileLocation(path, repo=None, details=None)[source]

Base class for an individual file or directory stored externally.

Parameters:
  • path (str) – the location of the file or directory (this can be None if repo is set, to refer to the entire repository)

  • repo (Repository) – object that describes the repository containing the file, or None if it is stored on the local disk

  • details (str) – optional description of the file

class ihm.location.InputFileLocation(path, repo=None, details=None)[source]

An externally stored file used as input. See FileLocation for a description of the parameters and Location for discussion of the usage of these objects.

For example, any Dataset that isn’t stored in a domain-specific database would use this class.

class ihm.location.OutputFileLocation(path, repo=None, details=None)[source]

An externally stored file used for output. See FileLocation for a description of the parameters and Location for discussion of the usage of these objects.

For example, this can be used to point to an externally-stored model ensemble or a localization density.

class ihm.location.WorkflowFileLocation(path, repo=None, details=None)[source]

An externally stored file that controls the workflow (e.g. a script). See FileLocation for a description of the parameters and Location for discussion of the usage of these objects.

Typically these objects are used to provide more information on how a StartingModel was generated, how an individual ihm.protocol.Step or ihm.analysis.Step was performed, or to describe the overall modeling (by addition to ihm.System.locations). This can be useful to capture fine details of the modeling that aren’t covered by the mmCIF dictionary, and to allow models to be precisely reproduced.

class ihm.location.VisualizationFileLocation(path, repo=None, details=None)[source]

An externally stored file that is used for visualization. See FileLocation for a description of the parameters and Location for discussion of the usage of these objects.

class ihm.location.Repository(doi, root=None, url=None, top_directory=None, details=None)[source]

A repository containing modeling files, i.e. a collection of related files at a remote, public location. This can include code repositories such as GitHub, file archival services such as Zenodo, or any other service that provides a DOI, such as the supplementary information for a publication.

This can also be used if the script plus related files are part of a repository, which has been archived somewhere with a DOI. This will be used to construct permanent references to files used in this modeling, even if they haven’t been uploaded to a database such as PDB or EMDB. See ihm.System.update_locations_in_repositories().

See also FileLocation.

Parameters:
  • doi (str) – the Digital Object Identifier for the repository

  • root (str) – the path on the local disk to the top-level directory of the repository, or None if files in this repository aren’t checked out.

  • url (str) – If given, a location that this repository can be downloaded from.

  • top_directory (str) – If given, prefix all paths for files in this repository with this value. This is useful when the archived version of the repository is found in a subdirectory at the URL or DOI (for example, GitHub repositories archived at Zenodo get placed in a subdirectory named for the repository and git hash).

  • details (str) – Additional text describing this repository