Manager

Defines the Bio2BEL DrugBank manager.

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

Manager for Bio2BEL DrugBank.

namespace_model

alias of bio2bel_drugbank.models.Drug

get_type_by_name(name: str) → Optional[bio2bel_drugbank.models.Type][source]

Get a Type by name.

get_or_create_type(name: str) → bio2bel_drugbank.models.Type[source]

Get or create a Type by name.

list_groups() → List[bio2bel_drugbank.models.Group][source]

List all chemical groups.

get_group_by_name(name: str) → Optional[bio2bel_drugbank.models.Group][source]

Get a Group by name.

get_or_create_group(name: str) → bio2bel_drugbank.models.Group[source]

Get or create a Group by name.

get_species_by_name(name: str) → Optional[bio2bel_drugbank.models.Species][source]

Get a Species by name.

get_or_create_species(name: str) → bio2bel_drugbank.models.Species[source]

Get or create a Species by name.

get_category_by_name(name: str) → Optional[bio2bel_drugbank.models.Category][source]

Get a Category by name.

get_or_create_category(name: str, **kwargs) → bio2bel_drugbank.models.Category[source]

Get or create a Category by name.

get_or_create_patent(country: str, patent_id: str, **kwargs) → bio2bel_drugbank.models.Patent[source]

Get or creates a Patent.

is_populated() → bool[source]

Check if the database is populated by counting the drugs.

populate(url: Optional[str] = None) → None[source]

Populate DrugBank.

Parameters:url – Path to the DrugBank XML
count_drugs() → int[source]

Count the number of drugs in the database.

list_drugs() → List[bio2bel_drugbank.models.Drug][source]

List all drugs in the database.

count_types() → int[source]

Count the number of types in the database.

count_aliases() → int[source]

Count the number of aliases in the database.

count_atc_codes() → int[source]

Count the number of ATC codes in the database.

count_groups() → int[source]

Count the number of groups in the database.

count_categories() → int[source]

Count the number of categories in the database.

count_drugs_categories() → int[source]

Count the number of drug-category relations in the database.

count_drugs_groups() → int[source]

Count the number of drug-group relations in the database.

count_patents() → int[source]

Count the number of patents in the database.

list_patents() → List[bio2bel_drugbank.models.Patent][source]

List the patents in the database.

count_xrefs() → int[source]

Count the number of cross-references in the database.

list_drug_protein_interactions() → List[bio2bel_drugbank.models.DrugProteinInteraction][source]

List drug-protein interactions.

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

Summarize the database.

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

Enrich the protein targets in the graph with Drug-Protein interactions from DrugBank.

lookup_drug(node: pybel.dsl.node_classes.BaseEntity) → Optional[bio2bel_drugbank.models.Drug][source]

Try and look up a drug.

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

Enrich drugs in the graph with their InChI equivalent nodes.

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

Enrich drugs in the graph with their equivalent nodes.

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

Enrich drugs in the graph with their targets.

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

Export DrugBank as BEL.

get_hgnc_id_to_drugs() → Dict[str, List[str]][source]

Get a dictionary of HGNC identifiers (not prepended with HGNC:) to list of drug names.

get_drug_to_hgnc_ids(cache=True, recalculate=False) → Dict[str, List[str]][source]

Get a dictionary of drug names to lists HGNC identifiers (not prepended with HGNC:).

get_drug_to_hgnc_symbols(cache=True, recalculate=False) → Dict[str, List[str]][source]

Get a dictionary of drug names to HGNC gene symbols.

get_interactions_by_hgnc_id(hgnc_id: str) → List[bio2bel_drugbank.models.DrugProteinInteraction][source]

Get the drug targets for a given HGNC identifier.