{"data":{"slug":"github-aipoch-medical-research-skills-scientific-skills-evidence-insight-chembl-database-601564c7a403","title":"Query ChEMBL Database for Bioactive Molecules and Drug Mechanisms","summary":"Search the ChEMBL database to find bioactive molecules, drug targets, and mechanism information using filters like molecular weight or chemical structure. The skill provides access to drug-like candidates, target information, and bioactivity measurements.","url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-evidence-insight-chembl-database-601564c7a403","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-aipoch-medical-research-skills-scientific-skills-evidence-insight-chembl-database-601564c7a403","markdown_url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-evidence-insight-chembl-database-601564c7a403.md","download_url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-evidence-insight-chembl-database-601564c7a403\/download","category":{"slug":"data-research","name":"Data & Research"},"editor_note":"This skill requires Python 3.9+ and the `chembl_webresource_client` package installed via pip or uv. Before querying, ensure the package is installed using `uv pip install chembl_webresource_client`. The first deliverable is typically a list of molecule records, which can be sliced to limit results.","instructions":"---\nname: chembl-database\ndescription: Query the ChEMBL database for bioactive molecules, targets, bioactivities, and approved drugs; use this when you need to filter by physicochemical properties (e.g., MW, LogP), chemical structure (SMILES), or retrieve drug mechanism information.\nlicense: MIT\nauthor: AIPOCH\n---\n> **Source**: [https:\/\/github.com\/aipoch\/medical-research-skills](https:\/\/github.com\/aipoch\/medical-research-skills)\n\n## When to Use\n\n- Find candidate compounds by name or synonym (e.g., searching for \u201caspirin\u201d) and retrieve their ChEMBL records.\n- Filter molecules by physicochemical properties (e.g., molecular weight, LogP) to narrow down drug-like candidates.\n- Look up targets (proteins\/complexes) and connect them to ligands and known bioactivity measurements.\n- Retrieve bioactivity data (e.g., IC50, Ki, EC50) for specific compound\u2013target interactions to support SAR or benchmarking.\n- Identify approved drugs and fetch mechanism-of-action information for target validation or competitive landscape analysis.\n\n## Key Features\n\n- Molecule search by preferred name and other metadata fields.\n- Property-based filtering (e.g., MW, LogP) using ChEMBL API filter syntax.\n- Structure-aware querying via SMILES (where supported by the API\/client).\n- Target lookup and navigation between targets, molecules, and activities.\n- Bioactivity retrieval for common endpoints (IC50, Ki, EC50) and related assay context.\n- Access to drug-related records, including mechanism information for approved drugs.\n\n## Dependencies\n\n- Python 3.9+ (recommended)\n- `chembl_webresource_client` (latest available via pip\/uv)\n\nInstall:\n\n```bash\nuv pip install chembl_webresource_client\n```\n\nAdditional references (optional, if present in this repository):\n\n- `references\/api_reference.md` (filter syntax and resource list)\n- `scripts\/query_chembl.py` (CLI wrapper example)\n\n## Example Usage\n\n```python\nfrom chembl_webresource_client.new_client import new_client\n\ndef main():\n    molecule = new_client.molecule\n    target = new_client.target\n    activity = new_client.activity\n    mechanism = new_client.mechanism\n\n    # 1) Search for molecules by name (case-insensitive substring match)\n    mols = list(molecule.filter(pref_name__icontains=\"aspirin\")[:5])\n    if not mols:\n        raise SystemExit(\"No molecules found for query.\")\n\n    first = mols[0]\n    chembl_id = first.get(\"molecule_chembl_id\")\n    print(\"Top molecule hit:\", chembl_id, \"-\", first.get(\"pref_name\"))\n\n    # 2) Filter molecules by a simple property constraint (example: MW <= 500)\n    # Note: exact field names and operators depend on ChEMBL API schema.\n    druglike = list(molecule.filter(molecule_properties__mw_freebase__lte=500)[:5])\n    print(\"Example drug-like hits (MW<=500):\", [m.get(\"molecule_chembl_id\") for m in druglike])\n\n    # 3) Get target information (example: targets containing \"COX\")\n    targets = list(target.filter(pref_name__icontains=\"cyclooxygenase\")[:5])\n    print(\"Example targets:\", [(t.get(\"target_chembl_id\"), t.get(\"pref_name\")) for t in targets])\n\n    # 4) Query bioactivity for a molecule (IC50\/Ki\/EC50 etc. depend on available records)\n    # Here we fetch a few activity records linked to the molecule.\n    acts = list(activity.filter(molecule_chembl_id=chembl_id)[:5])\n    for a in acts:\n        print(\n            \"Activity:\",\n            a.get(\"activity_id\"),\n            \"type=\", a.get(\"standard_type\"),\n            \"value=\", a.get(\"standard_value\"),\n            \"units=\", a.get(\"standard_units\"),\n            \"target=\", a.get(\"target_chembl_id\"),\n        )\n\n    # 5) Retrieve mechanism-of-action records (often used for approved drugs)\n    mechs = list(mechanism.filter(molecule_chembl_id=chembl_id)[:5])\n    for m in mechs:\n        print(\n            \"Mechanism:\",\n            \"target=\", m.get(\"target_chembl_id\"),\n            \"action=\", m.get(\"action_type\"),\n            \"mechanism=\", m.get(\"mechanism_of_action\"),\n        )\n\nif __name__ == \"__main__\":\n    main()\n```\n\n## Implementation Details\n\n- **Client\/Resources**: Uses `chembl_webresource_client.new_client.new_client` to access resource endpoints such as `molecule`, `target`, `activity`, and `mechanism`.\n- **Filtering Model**: Queries are built via `.filter(...)` with field lookups and operators (e.g., `__icontains`, `__lte`). The exact available fields and supported operators are defined by the ChEMBL API schema; consult `references\/api_reference.md` for the authoritative list and examples.\n- **Pagination\/Slicing**: Results are iterable and can be sliced (e.g., `[:5]`) to limit network calls and output size.\n- **Bioactivity Fields**: Common normalized fields include `standard_type`, `standard_value`, and `standard_units`. Not all records contain all fields; code should handle missing keys.\n- **Mechanism Retrieval**: Mechanism-of-action data is accessed via the `mechanism` resource and is typically most complete for approved\/annotated drugs.\n- **Structure Queries (SMILES)**: Structure-based search support depends on the API endpoint and client capabilities; when enabled, it is typically performed by passing a SMILES string to the appropriate structure\/compound endpoint or filter as documented in `references\/api_reference.md`.","use_cases":["Find candidate compounds by name or synonym (e.g., searching for 'aspirin') and retrieve their ChEMBL records.","Filter molecules by physicochemical properties (e.g., molecular weight, LogP) to narrow down drug-like candidates.","Look up targets (proteins\/complexes) and connect them to ligands and known bioactivity measurements."],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/aipoch\/medical-research-skills\/blob\/686e09dfdb45d9fa1a08664f06bb93769b3c9d91\/scientific-skills\/Evidence%20Insight\/chembl-database\/SKILL.md","source_commit":"686e09dfdb45d9fa1a08664f06bb93769b3c9d91","license":"MIT","version":null,"listing_approved_at":"2026-11-24","created_at":"2026-11-23T13:26:42.000000Z","updated_at":"2026-11-24T12:17:28.000000Z","seo_title":"Query ChEMBL database for bioactive molecules and drug mechanisms","seo_description":"Search the ChEMBL database to find bioactive molecules, drug targets, and mechanism information using filters like molecular weight or chemical structure.","seo_keywords":["query ChEMBL database","find bioactive molecules","drug mechanism information","filter molecules by properties","search for drug targets"]}}