Loading...
Loading...
Query the ChEMBL database for bioactive compounds, drug targets, and bioactivity data. Use this skill when searching for small molecules, finding inhibitors for protein targets, or analyzing drug mechanisms of action.
npx skill4agent add aminoanalytica/amina-skills chembl-databaseuv pip install chembl_webresource_clientfrom chembl_webresource_client.new_client import new_client
# Fetch compound by identifier
mol = new_client.molecule.get('CHEMBL192')
# Retrieve target data
tgt = new_client.target.get('CHEMBL203')
# Query activity measurements
acts = new_client.activity.filter(
target_chembl_id='CHEMBL203',
standard_type='IC50',
standard_value__lte=50
)| Resource | Description |
|---|---|
| Compound structures and properties |
| Biological targets |
| Bioassay measurements |
| Experimental protocols |
| Approved drug data |
| Drug mechanisms of action |
| Therapeutic indications |
| Structure similarity search |
| Substructure search |
| Literature references |
| Cell line data |
| Protein classifications |
| SVG molecular images |
| Operator | Function | Example |
|---|---|---|
| Exact match | |
| Case-insensitive substring | |
| Less/greater than or equal | |
| Less/greater than | |
| Value within range | |
| Value in list | |
| Null check | |
| Prefix match | |
| Regular expression | |
from chembl_webresource_client.new_client import new_client
activity = new_client.activity
# Get potent BRAF inhibitors (IC50 < 100 nM)
braf_hits = activity.filter(
target_chembl_id='CHEMBL5145',
standard_type='IC50',
standard_value__lte=100,
standard_units='nM'
)
for hit in braf_hits:
print(f"{hit['molecule_chembl_id']}: {hit['standard_value']} nM")from chembl_webresource_client.new_client import new_client
target = new_client.target
activity = new_client.activity
# Find CDK targets
cdk_targets = target.filter(
pref_name__icontains='cyclin-dependent kinase',
target_type='SINGLE PROTEIN'
)
target_ids = [t['target_chembl_id'] for t in cdk_targets]
# Get activities for these targets
cdk_activities = activity.filter(
target_chembl_id__in=target_ids[:5],
standard_type='IC50',
standard_value__lte=100,
standard_units='nM'
)from chembl_webresource_client.new_client import new_client
sim = new_client.similarity
# Find molecules 80% similar to ibuprofen
ibuprofen_smiles = 'CC(C)Cc1ccc(cc1)C(C)C(=O)O'
matches = sim.filter(smiles=ibuprofen_smiles, similarity=80)
for m in matches:
print(f"{m['molecule_chembl_id']}: {m['similarity']}%")from chembl_webresource_client.new_client import new_client
sub = new_client.substructure
# Find compounds with benzimidazole core
benzimidazole = 'c1ccc2[nH]cnc2c1'
compounds = sub.filter(smiles=benzimidazole)from chembl_webresource_client.new_client import new_client
mol = new_client.molecule
# Lipinski-compliant fragments
fragments = mol.filter(
molecule_properties__mw_freebase__lte=300,
molecule_properties__alogp__lte=3,
molecule_properties__hbd__lte=3,
molecule_properties__hba__lte=3
)from chembl_webresource_client.new_client import new_client
mech = new_client.mechanism
drug_ind = new_client.drug_indication
# Get mechanism of metformin
metformin_id = 'CHEMBL1431'
mechanisms = mech.filter(molecule_chembl_id=metformin_id)
for m in mechanisms:
print(f"Target: {m['target_chembl_id']}")
print(f"Action: {m['action_type']}")
# Get approved indications
indications = drug_ind.filter(molecule_chembl_id=metformin_id)from chembl_webresource_client.new_client import new_client
img = new_client.image
# Get SVG of caffeine
caffeine_svg = img.get('CHEMBL113')
with open('caffeine.svg', 'w') as f:
f.write(caffeine_svg)| Field | Description |
|---|---|
| ChEMBL identifier |
| Preferred name |
| SMILES string |
| InChI key |
| Molecular weight |
| Calculated LogP |
| H-bond acceptors/donors |
| Polar surface area |
| Rotatable bonds |
| Lipinski violations |
| QED drug-likeness |
| Field | Description |
|---|---|
| Compound ID |
| Target ID |
| Measurement type (IC50, Ki, EC50) |
| Numeric value |
| Units (nM, uM) |
| Normalized -log10 value |
| Quality flag |
| Duplicate indicator |
| Field | Description |
|---|---|
| ChEMBL target ID |
| Preferred name |
| SINGLE PROTEIN, PROTEIN COMPLEX, etc. |
| Species |
| Field | Description |
|---|---|
| Drug ID |
| Target ID |
| Description |
| INHIBITOR, AGONIST, ANTAGONIST, etc. |
import pandas as pd
from chembl_webresource_client.new_client import new_client
activity = new_client.activity
results = activity.filter(
target_chembl_id='CHEMBL279',
standard_type='Ki',
pchembl_value__isnull=False
)
df = pd.DataFrame(list(results))
df.to_csv('dopamine_d2_ligands.csv', index=False)from chembl_webresource_client.settings import Settings
cfg = Settings.Instance()
cfg.CACHING = True # Enable response caching
cfg.CACHE_EXPIRE = 43200 # Cache TTL (12 hours)
cfg.TIMEOUT = 60 # Request timeout
cfg.TOTAL_RETRIES = 5 # Retry attemptsdata_validity_commentpotential_duplicatepchembl_valuestandard_units[:n]data_validity_comment__infrom chembl_webresource_client.new_client import new_client
mol = new_client.molecule
try:
result = mol.get('INVALID_ID')
except Exception as e:
if '404' in str(e):
print("Compound not found")
elif '503' in str(e):
print("Service unavailable - retry later")
else:
raise