Bio2BEL ChEBI¶
A package for converting ChEBI to BEL.
Installation¶
bio2bel_chebi
can be installed easily from PyPI with
the following code in your favorite terminal:
$ python3 -m pip install bio2bel_chebi
or from the latest code on GitHub with:
$ python3 -m pip install git+https://github.com/bio2bel/chebi.git@master
Setup¶
ChEBI can be downloaded and populated from either the Python REPL or the automatically installed command line utility.
Python REPL¶
>>> import bio2bel_chebi
>>> chebi_manager = bio2bel_chebi.Manager()
>>> chebi_manager.populate()
Command Line Utility¶
bio2bel_chebi populate
Manager¶
Manager for Bio2BEL ChEBI.
-
class
bio2bel_chebi.manager.
Manager
(*args, **kwargs)[source]¶ Chemical multi-hierarchy.
-
namespace_model
¶ alias of
bio2bel_chebi.models.Chemical
-
summarize
() → Mapping[str, int][source]¶ Return a summary dictionary over the content of the database.
-
get_or_create_chemical
(chebi_id: str, **kwargs) → bio2bel_chebi.models.Chemical[source]¶ Get a chemical from the database by ChEBI.
-
get_chemical_by_chebi_id
(chebi_id: str) → Optional[bio2bel_chebi.models.Chemical][source]¶ Get a chemical from the database.
-
get_chemical_by_chebi_name
(name: str) → Optional[bio2bel_chebi.models.Chemical][source]¶ Get a chemical from the database.
-
build_chebi_id_name_mapping
() → Mapping[str, str][source]¶ Build a mapping from ChEBI identifier to ChEBI name.
-
build_chebi_name_id_mapping
() → Mapping[str, str][source]¶ Build a mapping from ChEBI name to ChEBI identifier.
-
populate
(inchis_url: Optional[str] = None, compounds_url: Optional[str] = None, relations_url: Optional[str] = None, names_url: Optional[str] = None, accessions_url: Optional[str] = None) → None[source]¶ Populate all tables.
-
iter_chemicals
(graph: pybel.struct.graph.BELGraph, use_tqdm: bool = False) → Iterable[Tuple[pybel.dsl.node_classes.BaseEntity, bio2bel_chebi.models.Chemical]][source]¶ Iterate over pairs of BEL nodes and ChEBI chemicals.
-
Constants¶
Constants for Bio2BEL ChEBI.