$npx -y skills add QSong-github/DrugClaw --skill chemblQuery the ChEMBL database for drug molecules, bioactivity data, and drug targets via the ChEMBL REST API. Use whenever the user asks about drug properties (molecular weight, logP, Lipinski violations), drug-target interactions, bioactivity assay results, or wants to look up any e
| 1 | # ChEMBL Query Skill |
| 2 | |
| 3 | Query ChEMBL bioactivity database for molecules, targets, and activity data. Auto-detects input type by prefix: |
| 4 | |
| 5 | | Input Pattern | Detected As | Action | |
| 6 | |---|---|---| |
| 7 | | `CHEMBL25` | ChEMBL ID (molecule) | direct fetch by ID | |
| 8 | | `aspirin` | drug name | substring search on `pref_name` | |
| 9 | | `CHEMBL203` | ChEMBL ID (target) | direct fetch by ID | |
| 10 | | `EGFR` | gene/protein name | substring search on `target_synonym` | |
| 11 | |
| 12 | ## API |
| 13 | |
| 14 | | Function | Input | Returns | |
| 15 | |---|---|---| |
| 16 | | `query_molecules(entities, limit)` | `str` or `list[str]` — ChEMBL IDs or drug names | `dict[str, list[dict]]` | |
| 17 | | `query_targets(entities, limit)` | `str` or `list[str]` — ChEMBL IDs or gene names | `dict[str, list[dict]]` | |
| 18 | | `query_bioactivities(chembl_ids, limit)` | `str` or `list[str]` — molecule ChEMBL IDs | `dict[str, list[dict]]` | |
| 19 | | `summarize_molecule(mol)` | single molecule dict | compact one-line string | |
| 20 | | `summarize_activity(act)` | single activity dict | compact one-line string | |
| 21 | | `summarize_target(tgt)` | single target dict | compact one-line string | |
| 22 | |
| 23 | ## Usage |
| 24 | |
| 25 | See `if __name__ == "__main__"` block in `chembl_query.py` for runnable examples covering: |
| 26 | |
| 27 | 1. **Single molecule by ID** — `query_molecules("CHEMBL25")` |
| 28 | 2. **Batch molecule search by name** — `query_molecules(["ibuprofen", "metformin"], limit=3)` |
| 29 | 3. **Bioactivities for multiple molecules** — `query_bioactivities(["CHEMBL25", "CHEMBL1642"], limit=3)` |
| 30 | 4. **Single target by gene name** — `query_targets("EGFR", limit=3)` |
| 31 | 5. **Batch target lookup by ID** — `query_targets(["CHEMBL203", "CHEMBL204"])` |
| 32 | |
| 33 | ## Key Fields |
| 34 | |
| 35 | **Molecule**: `molecule_chembl_id`, `pref_name`, `molecule_properties.full_mwt`, `molecule_properties.alogp`, `molecule_properties.num_ro5_violations` |
| 36 | |
| 37 | **Activity**: `molecule_chembl_id`, `target_chembl_id`, `target_pref_name`, `standard_type`, `standard_value`, `standard_units` |
| 38 | |
| 39 | **Target**: `target_chembl_id`, `pref_name`, `target_type`, `organism` |
| 40 | |
| 41 | ## Data Source |
| 42 | |
| 43 | - **API**: `https://www.ebi.ac.uk/chembl/api/data` (no key required) |
| 44 | - **Paper**: https://doi.org/10.1093/nar/gkad1004 |