5.1.2.1.3. cobramod.parsing.biocyc

Data parsing for Biocyc

This module handles the retrieval of data from BioCyc into a local directory. The possible type of data that can be download:

  • Metabolites: Normally have an abbreviation or short name.

  • Reactions: Can have the words “RXN” in the identifier. Enzymes can sometimes

be used instead. The gene information for the reactions is include if found. - Pathways

Contact maintainers if other types should be added.

Important class of the module: - BiocycParser: Child of the abstract class cobramod.parsing.base.BaseParser.

5.1.2.1.3.1. Module Contents

5.1.2.1.3.1.1. Classes

BiocycParser

Helper class that provides a standard way to create an ABC using

5.1.2.1.3.1.2. Functions

get_graph(root: Any) → dict

Return a directed graph from given XML Element. A key represent the

retrieve_data(directory: pathlib.Path, identifier: str, database: str) → xml.etree.ElementTree.Element

Searchs in given parent directory if data is located in their respective

5.1.2.1.3.1.3. Attributes

databases

response

cobramod.parsing.biocyc.databases
cobramod.parsing.biocyc.response
cobramod.parsing.biocyc.get_graph(root: Any) dict

Return a directed graph from given XML Element. A key represent the parent reaction and the value is the child. A parent can have multiple children as tuples. End-reactions have a NoneType as child.

Parameters

root (Element) – An XML element, which represent a XML file with the information of a pathway.

Returns

Directed graph from root.

Return type

Dict

Raises

WrongParserError – If given root does not represent a pathway.

class cobramod.parsing.biocyc.BiocycParser

Bases: cobramod.parsing.base.BaseParser

Helper class that provides a standard way to create an ABC using inheritance.

cobramod.parsing.biocyc.retrieve_data(directory: pathlib.Path, identifier: str, database: str) xml.etree.ElementTree.Element

Searchs in given parent directory if data is located in their respective database directory. If not, data will be retrieved from the corresponding database. Returns root of given identifier.

Parameters
  • directory (Path) – Path to directory where data is located.

  • identifier (str) – identifier for given database.

  • database (str) – Name of the database. Some options: “META”, “ARA”. Full list in: “https://biocyc.org/biocyc-pgdb-list.shtml

Raises
Returns

root of XML file

Return type

ET.Element