Manager

Manager for Bio2BEL KEGG.

class bio2bel_kegg.manager.Manager(*args, **kwargs)[source]

Protein-pathway memberships.

Doesn’t let this class get instantiated if the pathway_model.

namespace_model

alias of bio2bel_kegg.models.Pathway

pathway_model

alias of bio2bel_kegg.models.Pathway

protein_model

alias of bio2bel_kegg.models.Protein

pathway_model_identifier_column

KEGG id of the pathway

get_or_create_pathway(kegg_id: str, name: Optional[str] = None) → bio2bel_kegg.models.Pathway[source]

Get an pathway from the database or creates it.

Parameters
  • kegg_id – A KEGG pathway identifier

  • name – name of the pathway

get_protein_by_kegg_id(kegg_id: str) → Optional[bio2bel_kegg.models.Protein][source]

Get a protein by its kegg id.

Parameters

kegg_id – A KEGG identifier

get_protein_by_hgnc_id(hgnc_id: str) → Optional[bio2bel_kegg.models.Protein][source]

Get a protein by its hgnc_id.

Parameters

hgnc_id – hgnc_id

get_protein_by_hgnc_symbol(hgnc_symbol: str) → Optional[bio2bel_kegg.models.Protein][source]

Get a protein by its hgnc symbol.

Parameters

hgnc_id – hgnc identifier

populate(pathways_url=None, protein_pathway_url=None, metadata_existing=False)[source]

Populate all tables.

count_pathways() → int[source]

Count the pathways in the database.

list_pathways() → List[bio2bel_kegg.models.Pathway][source]

List the pathways in the database.

count_proteins() → int[source]

Count the pathways in the database.

summarize() → Mapping[str, int][source]

Summarize the database.

to_bel() → pybel.struct.graph.BELGraph[source]

Serialize KEGG to BEL.

get_pathway_graph(kegg_id: str) → Optional[pybel.struct.graph.BELGraph][source]

Return a new graph corresponding to the pathway.

Parameters

kegg_id – A KEGG pathway identifier (prefixed by “path:”)

enrich_kegg_pathway(graph: pybel.struct.graph.BELGraph) → None[source]

Enrich all proteins belonging to KEGG pathway nodes in the graph.

enrich_kegg_protein(graph: pybel.struct.graph.BELGraph) → None[source]

Enrich all KEGG pathways associated with proteins in the graph.