5.1.1.1.6. cobramod.core.retrieval

Data retrieval

This module creates the function cobramod.core.retrieval.get_data(), which gets the data from a local directory or from different databases. The available databases for data retrieval can be found in the variable cobramod.core.retrieval.available_databases

5.1.1.1.6.1. Module Contents

5.1.1.1.6.1.1. Classes

Databases

Simple object that shows the information about the database

5.1.1.1.6.1.2. Functions

get_data(directory: pathlib.Path, identifier: str, database: str, debug_level: int = 20, **kwargs) → dict

Retrieves and transforms the data into a dictionary for the given

translate(directory: pathlib.Path, target: str, database: str) → str

Return the identifier of crossref for the given target. It can be a

5.1.1.1.6.1.3. Attributes

parsers

available_databases

cobramod.core.retrieval.parsers
class cobramod.core.retrieval.Databases

Bases: object

Simple object that shows the information about the database

cobramod.core.retrieval.available_databases
cobramod.core.retrieval.get_data(directory: pathlib.Path, identifier: str, database: str, debug_level: int = 20, **kwargs) dict

Retrieves and transforms the data into a dictionary for the given identifier from a specific database.

Parameters
  • directory (Path) – Directory to store and retrieve local data.

  • identifier (str) – Original identifier.

  • database (str) – Name of database. Check cobramod.available_databases for a list of names.

  • debug_level (int, optional) – Level of debugging. Read package logging for more info. Defaults to 20.

Keyword Arguments
  • model_id – Exclusive for BIGG. Original identifier of the model to be searched. Some examples: “e_coli_core”, “universal”.

  • genome (str, optional) – Exclusive for KEGG. Abbreviation for the species involved. Genes will be obtained for this species.

Returns

Relevant data for the given identifier.

Return type

dict

cobramod.core.retrieval.translate(directory: pathlib.Path, target: str, database: str) str

Return the identifier of crossref for the given target. It can be a metabolite or a Reaction.

Parameters
  • directory (Path) – Path of stored data.

  • target (str) – Identifier to search for.

  • database (str) – Pattern for the name of the cross-reference, e.g CAS, BIGG.

Returns

str: Corresponding identifier for cross-reference.

Raises

PatternNotFound – If the target cannot be properly identified.