7.1.2.8. pta.metabolite_interpreter

Parsing and identification of metabolites.

7.1.2.8.1. Module Contents

class pta.metabolite_interpreter.CompartmentConvention[source]

Bases: enum.Enum

The convention used to define the compartment of a metabolite.

UNDERSCORE[source]

The metabolite ID ends with “_<compartment_ID>” (e.g. g6p_c).

ASSUME_CYTOSOL[source]

The compartment is not specified, all metabolites are assumed to belong to the cytosol.

class pta.metabolite_interpreter.Namespace[source]

Bases: enum.Enum

The namespace in which metabolite identifiers are defined.

UNSPECIFIED[source]

The namespace is not specified. In most cases PTA can find the metabolite in eQuilibrator even if the namespace is not specified. However, this is not guaranteed and it is recommended to always specify a namespace.

BIGG[source]

Assume that metabolite identifiers belong to the BiGG namespace.

NONE[source]

The identifiers do not represent actual metabolites.

class pta.metabolite_interpreter.MetaboliteInterpreter(compartment_convention: CompartmentConvention = CompartmentConvention.UNDERSCORE, namespace: Namespace = Namespace.BIGG)[source]

An interpreter used to transform metabolite IDs to compound identifiers that can be understood by eQuilibrator and compartment identifiers. Note: this class could/should partially replaced by cobrapy’s functionalities if/when this feature is implemented: https://github.com/opencobra/cobrapy/issues/967

Parameters
  • compartment_convention (CompartmentConvention, optional) – Naming convention used to specify metabolite and compartment identifiers, by default CompartmentConvention.UNDERSCORE.

  • namespace (Namespace, optional) – Namespace in which the metabolite identifiers are defined, by default Namespace.BIGG.

read(self, metabolite_id: str) pta.metabolite.Metabolite[source]

Parses a metabolite from a string, reading its identifier and compartment.

Parameters

metabolite_name (str) – The identifier of a metabolite.

Returns

Object describing the parsed metabolite. Note that only the identifier and compartment are set, the remaining fields (such as the charge) have to be specified manually.

Return type

Metabolite

Raises

Exception – If the naming convention or namespace of the metabolite are not supported.

property compartment_convention(self) CompartmentConvention[source]

Gets the convention used to specify compartments.

property namespace(self) Namespace[source]

Gets the namespace of the metabolite names.