Manager

Bio2BEL HGNC Manager.

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

Human gene nomenclature and orthologies to mouse and rat.

add_central_dogma(graph: pybel.struct.graph.BELGraph, node: pybel.dsl.node_classes.BaseEntity) → Optional[pybel.dsl.node_classes.CentralDogma][source]

Add the central dogma of biology.

add_namespace_to_graph(graph: pybel.struct.graph.BELGraph)[source]

Add this manager’s namespace to the graph.

build_entrez_id_to_hgnc_id_mapping() → Mapping[str, str][source]

Build a mapping from Entrez gene identifier to HGNC identifier.

build_entrez_id_to_hgnc_symbol_mapping() → Mapping[str, str][source]

Build a mapping from Entrez gene identifier to HGNC gene symbols.

build_hgnc_id_symbol_mapping() → Mapping[str, str][source]

Build a mapping from HGNC identifiers to HGNC gene symbols.

build_hgnc_symbol_entrez_id_mapping() → Mapping[str, str][source]

Build a mapping from HGNC symbol to ENTREZ identifier.

build_hgnc_symbol_id_mapping() → Mapping[str, str][source]

Build a mapping from HGNC gene symbols to HGNC identifiers.

build_uniprot_id_hgnc_id_mapping() → Mapping[str, str][source]

Build a mapping from UniProt identifiers to HGNC identifiers.

build_uniprot_id_hgnc_symbol_mapping() → Mapping[str, str][source]

Build a mapping from UniProt identifiers to HGNC gene symbols.

count_families() → int[source]

Count the number of human gene families in the database.

count_human_genes() → int[source]

Count the number of human genes in the database.

count_mouse_genes() → int[source]

Count the number of mouse genes in the database.

count_proteins() → int[source]

Count the number of UniProt proteins in the database.

count_rat_genes() → int[source]

Count the number of rat genes in the database.

enrich_families_with_genes(graph: pybel.struct.graph.BELGraph)[source]

Enrich gene families in the BEL graph with their member genes.

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

Enrich genes with their corresponding UniProt.

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

Enrich genes in the BEL graph with their families.

enrich_hgnc_with_entrez_equivalences(graph: pybel.struct.graph.BELGraph)[source]

Add equivalent Entrez nodes for all HGNC genes.

get_all_hgnc_symbols() → Set[str][source]

Return the set of HGNC gene symbols in the database.

get_all_hgnc_symbols_family() → Set[str][source]

Get all Gene symbols that appear in gene families.

get_enzyme_by_ec_number(ec_number: str) → Optional[pyhgnc.manager.models.HGNC][source]

Get a enzyme by its associated EC number.

Parameters

ec_number – EC number

get_family_by_id(family_identifier: str) → Optional[pyhgnc.manager.models.GeneFamily][source]

Get a gene family by its hgnc.genefamily identifier, if it exists.

get_family_by_name(family_name: str) → Optional[pyhgnc.manager.models.GeneFamily][source]

Get a gene family by its name, if it exists.

get_gene_by_ensembl_id(ensembl_id: str) → Optional[pyhgnc.manager.models.HGNC][source]

Get a human gene by its ENSEMBL gene identifier.

Parameters

ensembl_id – The ENSEMBL gene identifier

get_gene_by_entrez_id(entrez_id: str) → Optional[pyhgnc.manager.models.HGNC][source]

Get a human gene by its Entrez gene identifier.

Parameters

entrez_id – The Entrez gene identifier

get_gene_by_hgnc_id(hgnc_id: str) → Optional[pyhgnc.manager.models.HGNC][source]

Get a human gene by HGNC identifier.

Parameters

hgnc_id – The HGNC gene identifier

get_gene_by_hgnc_symbol(hgnc_symbol: str) → Optional[pyhgnc.manager.models.HGNC][source]

Get a human gene by HGNC symbol.

Parameters

hgnc_symbol – The HGNC gene symbol

get_gene_by_mgi_id(mgi_id: str) → Optional[pyhgnc.manager.models.HGNC][source]

Get a human gene by an orthologous MGI identifier.

Parameters

mgi_id – MGI identifier

get_gene_by_rgd_id(rgd_id: str) → Optional[pyhgnc.manager.models.HGNC][source]

Get a human gene by an orthologous RGD identifier.

Parameters

rgd_id – RGD identifier

get_gene_by_uniprot_id(uniprot_id: str) → Optional[pyhgnc.manager.models.HGNC][source]

Get a human gene by its UniProt gene identifier.

Parameters

uniprot_id – The UniProt gene identifier

get_hgnc_from_alias_symbol(alias_symbol: str) → Optional[pyhgnc.manager.models.HGNC][source]

Get HGNC from alias symbol.

Parameters

alias_symbol – alias symbol

get_node(node: pybel.dsl.node_classes.BaseEntity) → Optional[pyhgnc.manager.models.HGNC][source]

Get a node from the database, whether it has a HGNC, RGD, MGI, or EG identifier.

Parameters

node – The node to look for

Raises

KeyError

get_pathway_size_distribution() → collections.Counter[source]

Get the pathway size distribution.

property hgnc_symbol_entrez_id_mapping

Get a mapping from Entrez gene identifiers to HGNC gene symbols.

is_populated() → bool[source]

Check if the database is already populated.

iter_genes(graph: pybel.struct.graph.BELGraph, use_tqdm: bool = False) → Iterable[Tuple[pybel.dsl.node_classes.BaseEntity, pyhgnc.manager.models.HGNC]][source]

Iterate over pairs of BEL nodes and HGNC genes.

list_families() → List[pyhgnc.manager.models.GeneFamily][source]

List families in the database.

list_human_genes() → List[pyhgnc.manager.models.HGNC][source]

List human genes in the database.

namespace_model

alias of pyhgnc.manager.models.HGNC

normalize_genes(graph: pybel.struct.graph.BELGraph, use_tqdm: bool = False) → None[source]

Add identifiers to all HGNC genes.

populate(silent=False, hgnc_file_path=None, use_hcop=False, hcop_file_path=None, low_memory=False)[source]

Populate the database.

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

Summarize the database.

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

Export gene family definitions as a BEL graph.