mkt.databases.chembl
ChEMBL molecule-search client for resolving drug names to ChEMBL IDs and metadata.
Provides ChEMBLMoleculeSearch and related clients plus return_chembl_id()
to map drug names/synonyms to ChEMBL identifiers and molecule records.
Functions
|
Return the ChEMBL ID for a given drug name. |
Classes
|
ChEMBL API client. |
|
ChEMBL molecule API client. |
|
ChEMBL molecule exact match API client. |
|
ChEMBL molecule preferred match API client. |
|
ChEMBL molecule search API client. |
- class mkt.databases.chembl.ChEMBL(id: str, url_suffix: str, url_base: str = 'https://www.ebi.ac.uk/chembl/api/data', url_query: str | None = None, params: dict = <factory>, verbose: bool = False, _json: dict | None = None)[source]
Bases:
RESTAPIClientChEMBL API client.
- __init__(id: str, url_suffix: str, url_base: str = 'https://www.ebi.ac.uk/chembl/api/data', url_query: str | None = None, params: dict = <factory>, verbose: bool = False, _json: dict | None = None) None
- id: str
ID for querying specific entities.
- params: dict
Parameters for the API query.
- url_base: str = 'https://www.ebi.ac.uk/chembl/api/data'
Base URL for the ChEMBL API.
- url_query: str | None = None
URL query for specific queries.
- url_suffix: str
URL suffix to update for specific queries.
- verbose: bool = False
Flag to enable verbose logging.
- class mkt.databases.chembl.ChEMBLMolecule(id: str, url_suffix: str = '/molecule', url_base: str = 'https://www.ebi.ac.uk/chembl/api/data', url_query: str | None = None, params: dict = <factory>, verbose: bool = False, _json: dict | None = None)[source]
Bases:
ChEMBLChEMBL molecule API client.
- __init__(id: str, url_suffix: str = '/molecule', url_base: str = 'https://www.ebi.ac.uk/chembl/api/data', url_query: str | None = None, params: dict = <factory>, verbose: bool = False, _json: dict | None = None) None
- adjudicate_preferred_name(str_in: str | None = None) str[source]
Return the adjudicated preferred name for the queried molecule.
- Parameters:
str_in (str | None) – The input string to adjudicate the preferred name. If None, will not compare to input string.
- Returns:
The adjudicated preferred name or the original ID if no preferred name is found or matches the input string.
- Return type:
str
- params: dict
Parameters for the molecule API query.
- url_suffix: str = '/molecule'
URL suffix for querying exact molecule match in ChEMBL.
- class mkt.databases.chembl.ChEMBLMoleculeExact(id: str, url_suffix: str = '/molecule', url_base: str = 'https://www.ebi.ac.uk/chembl/api/data', url_query: str | None = None, params: dict = <factory>, verbose: bool = False, _json: dict | None = None)[source]
Bases:
ChEMBLChEMBL molecule exact match API client.
- __init__(id: str, url_suffix: str = '/molecule', url_base: str = 'https://www.ebi.ac.uk/chembl/api/data', url_query: str | None = None, params: dict = <factory>, verbose: bool = False, _json: dict | None = None) None
- params: dict
Parameters for the molecule exact match API query.
- url_suffix: str = '/molecule'
URL suffix for querying exact molecule match in ChEMBL.
- class mkt.databases.chembl.ChEMBLMoleculePreferred(id: str, url_suffix: str = '/molecule', url_base: str = 'https://www.ebi.ac.uk/chembl/api/data', url_query: str | None = None, params: dict = <factory>, verbose: bool = False, _json: dict | None = None)[source]
Bases:
ChEMBLChEMBL molecule preferred match API client.
- __init__(id: str, url_suffix: str = '/molecule', url_base: str = 'https://www.ebi.ac.uk/chembl/api/data', url_query: str | None = None, params: dict = <factory>, verbose: bool = False, _json: dict | None = None) None
- params: dict
Parameters for the molecule preferred match API query.
- url_suffix: str = '/molecule'
URL suffix for querying exact molecule match in ChEMBL.
- class mkt.databases.chembl.ChEMBLMoleculeSearch(id: str, url_suffix: str = '/molecule/search', url_base: str = 'https://www.ebi.ac.uk/chembl/api/data', url_query: str | None = None, params: dict = <factory>, verbose: bool = False, _json: dict | None = None)[source]
Bases:
ChEMBLChEMBL molecule search API client.
- __init__(id: str, url_suffix: str = '/molecule/search', url_base: str = 'https://www.ebi.ac.uk/chembl/api/data', url_query: str | None = None, params: dict = <factory>, verbose: bool = False, _json: dict | None = None) None
- url_suffix: str = '/molecule/search'
URL suffix for querying molecule search in ChEMBL.
- mkt.databases.chembl.return_chembl_id(drug: str)[source]
Return the ChEMBL ID for a given drug name.
- Parameters:
drug (str) – The name of the drug to search for in ChEMBL.
- Returns:
- A tuple containing the ChEMBL ID and the source of the ID (exact, preferred, or search);
if no ID is found, returns (None, None).
- Return type:
tuple