7.1.1.3.1.2. 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 downloaded:
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 included if found.
7.1.1.3.1.2.1. Attributes¶
7.1.1.3.1.2.2. Functions¶
Returns a dictionary with the corresponding cross-references and their |
|
|
|
|
Returns the direction of the chemical reaction |
|
|
|
|
|
Return a directed graph from given XML Element. A key represent the |
|
|
|
Retrieve the gene information for given reaction in a specific database |
|
Returns a dictionary with the corresponding genes and gene-reaction rules. |
7.1.1.3.1.2.3. Module Contents¶
- cobramod.parsing.biocyc.debug_log¶
- cobramod.parsing.biocyc.build_cross_references_xml(root)¶
Returns a dictionary with the corresponding cross-references and their identifiers.
- cobramod.parsing.biocyc.reaction_str_from_xml(root)¶
- Parameters:
- Return type:
- cobramod.parsing.biocyc.get_direction_from_xml(root)¶
Returns the direction of the chemical reaction
- Parameters:
- Return type:
- cobramod.parsing.biocyc.parse_reaction_attributes(root, entry, gene_directory)¶
- Parameters:
entry (str)
gene_directory (pathlib.Path)
- Return type:
- cobramod.parsing.biocyc.get_graph(root)¶
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.
- cobramod.parsing.biocyc.retrieve_gene_information(directory, identifier, database)¶
Retrieve the gene information for given reaction in a specific database :param directory: Directory to store and retrieve local data. :type directory: Path :param identifier: original identifier :type identifier: str :param database: Name of the database. Some options: “META”, “ARA”.
Full list in: “https://biocyc.org/biocyc-pgdb-list.shtml”
- Raises:
HTTPError – If given reaction does not have gene information available
- Parameters:
directory (pathlib.Path)
identifier (str)
database (str)
- cobramod.parsing.biocyc.parse_genes(identifier, directory)¶
Returns a dictionary with the corresponding genes and gene-reaction rules. This function will try to read a file for given identifier. If nothing is found, the dictionary will have empty entries.
- Parameters:
identifier (str)
directory (pathlib.Path)
- Return type: