Manager¶
Bio2BEL CTD Manager.
-
class
bio2bel_ctd.manager.
Manager
(*args, **kwargs)[source]¶ Bio2BEL manager for the CTD.
-
populate
(urls=None, force_download=False, only_tables=None, exclude_tables=None) → None[source]¶ Updates the CTD database
- downloads all files from CTD
- drops all tables in database
- creates all tables in database
- import all data from CTD files
Parameters:
-
list_chemical_gene_interactions
() → List[pyctd.manager.models.ChemGeneIxn][source]¶ List all chemical-gene interactions.
-
count_chemical_gene_interactions
() → int[source]¶ Count the chemical-gene interactions in the database.
-
get_chemical_by_mesh
(mesh_id: str) → Optional[pyctd.manager.models.Chemical][source]¶ Get a chemical by its MeSH identifier, if it exists.
Parameters: mesh_id – A MeSH identifier of a chemical
-
get_chemical_by_cas
(cas_rn: str) → Optional[pyctd.manager.models.Chemical][source]¶ Get a chemical by its CAS Registry Number, if it exists.
Parameters: cas_rn (str) – A CAS Registry Number Return type: Optional[Chemical]
-
get_gene_by_entrez_id
(entrez_id: str) → Optional[pyctd.manager.models.Gene][source]¶ Get a gene by its Entrez Gene identifier, if it exists.
Parameters: entrez_id – An Entrez Gene identifier of a gene Return type: Optional[Gene]
-
get_interaction_by_id
(ixn_id: int) → Optional[pyctd.manager.models.ChemGeneIxn][source]¶ Get an interaction by its database identifier
Parameters: ixn_id – An interaction database identifier
-
enrich_graph_chemical
(graph: pybel.struct.graph.BELGraph, mesh_id: str) → None[source]¶ Enrich the BEL graph with chemical-gene interactions for the given chemical.
Parameters: - graph – A BEL graph
- mesh_id – A MeSH identifier of a chemical
-
enrich_graph_gene
(graph: pybel.struct.graph.BELGraph, entrez_id: str) → None[source]¶ Enrich the BEL graph with chemical-gene interactions for the given gene.
Parameters: - graph – A BEL graph
- entrez_id – An Entrez Gene identifier of a gene
-
enrich_graph_genes
(graph: pybel.struct.graph.BELGraph) → None[source]¶ Enrich the BEL graph with chemical-gene interactions for all Entrez genes.
Parameters: graph – A BEL graph
-
enrich_chemicals
(graph: pybel.struct.graph.BELGraph) → None[source]¶ Find chemicals that can be mapped and enriched with the CTD.
Parameters: graph (pybel.BELGraph) – A BEL graph
-