cobramod.parsing.kegg ===================== .. py:module:: cobramod.parsing.kegg .. autoapi-nested-parse:: Data parsing for KEGG This module handles the retrieval of data from KEGG into a local directory. The possible type of data that can be downloaded: - Metabolite: Identifiers that start with the letter C, e.g C00001 - Reactions: Identifiers that start with the letter R, e.g R00001. The gene information for reactions is also included if the specie is specified - Module Pathways: Identifiers that start with the letter M, e.g M00001 Attributes ---------- .. autoapisummary:: cobramod.parsing.kegg.debug_log cobramod.parsing.kegg.KO_LINK Exceptions ---------- .. autoapisummary:: cobramod.parsing.kegg.WrongParserError Functions --------- .. autoapisummary:: cobramod.parsing.kegg.parse_metabolite_attributes cobramod.parsing.kegg.parse_reaction_attributes cobramod.parsing.kegg.data_from_string cobramod.parsing.kegg.build_references cobramod.parsing.kegg.ko_generator cobramod.parsing.kegg.parse_ko_to_genes cobramod.parsing.kegg.retrieve_kegg_genes cobramod.parsing.kegg.parse_genes cobramod.parsing.kegg.get_graph cobramod.parsing.kegg.parse_pathway_attributes Module Contents --------------- .. py:data:: debug_log .. py:exception:: WrongParserError Bases: :py:obj:`Exception` Simple Error that should be raised if a method cannot handle the parsing. .. py:data:: KO_LINK :value: 'http://rest.kegg.jp/link/ko/' .. py:function:: parse_metabolite_attributes(data, entry) .. py:function:: parse_reaction_attributes(data, entry, genome, gene_directory) .. py:function:: data_from_string(raw) Formats most of the keys for KEGG data and returns a dictionary. .. py:function:: build_references(data_dict) Return a dictionary, where the keys are the names of cross-references and keys their identifiers. If nothing is found, it will return None .. py:function:: ko_generator(identifier) Returns a list with the corresponding KO-entries for given identifier. Otherwise it will raise a HTTPError .. py:function:: parse_ko_to_genes(string, reaction, genome) Returns with a list with the corresponding genes for given genome. String is the raw text that include the gene information. If Abbreviation or no genome is present then, an empty list is returned. .. py:function:: retrieve_kegg_genes(directory, identifier) Stores the genes for given reaction in given directory. Function will call a HTTPError if nothing is found. .. py:function:: parse_genes(directory, identifier, genome) From given KEGG dictionary returns a dictionary with the key "genes" which include a dictionary with the identifier and name of the gene; and the key "rule" for the COBRApy representation of the gene-reaction rule .. py:function:: get_graph(kegg_dict) Returns dictionary with sequences for a graph, where the key the prior reaction is and the value, its successor; and a set with all participant reaction (vertex) .. py:function:: parse_pathway_attributes(data, entry)