$npx -y skills add QSong-github/DrugClaw --skill repurposing_hubQuery the Broad Institute Drug Repurposing Hub (~6,800 compounds). Look up drugs by name, gene target, MOA, disease area, Broad ID, or InChIKey. Returns clinical phase, mechanism of action, targets, disease area, indication, and chemical identifiers.
| 1 | # Drug Repurposing Hub Query Skill |
| 2 | |
| 3 | Search the Broad Institute Drug Repurposing Hub by any entity. |
| 4 | Auto-detects input type by pattern: |
| 5 | |
| 6 | | Input Pattern | Detected As | Match Logic | |
| 7 | |---|---|---| |
| 8 | | `BRD-A12345678` | Broad compound ID | prefix on `broad_id` | |
| 9 | | `ABCDEFGHIJKLMN-OPQRSTUVWX-Y` | InChIKey | exact on `InChIKey` | |
| 10 | | `EGFR`, `BRAF`, `TOP1` | Gene / target | exact token in `target` (pipe-separated) | |
| 11 | | anything else | free text | substring on `pert_iname`, `moa`, `indication`, `disease_area` | |
| 12 | |
| 13 | ## API |
| 14 | |
| 15 | | Function | Input | Returns | |
| 16 | |---|---|---| |
| 17 | | `load_drugs(path)` | drug TSV path | list[dict] | |
| 18 | | `load_samples(path)` | sample TSV path | list[dict] | |
| 19 | | `load_merged()` | — | list[dict] (drugs + chemical IDs from samples) | |
| 20 | | `search(entity)` | single entity string | list[dict] | |
| 21 | | `search_batch(entities)` | list of entity strings | dict[str, list[dict]] | |
| 22 | | `summarize(hits, entity)` | hits + label | compact LLM-readable text | |
| 23 | | `to_json(hits)` | list[dict] | list[dict] (JSON-serialisable) | |
| 24 | |
| 25 | ## Usage |
| 26 | |
| 27 | See `if __name__ == "__main__"` block in `29_Drug_Repurposing_Hub.py` for |
| 28 | runnable examples covering: drug name, gene target, MOA keyword, disease |
| 29 | area, batch search, and JSON output. |
| 30 | |
| 31 | ```python |
| 32 | from importlib.machinery import SourceFileLoader |
| 33 | hub = SourceFileLoader("hub", "29_Drug_Repurposing_Hub.py").load_module() |
| 34 | |
| 35 | # Single drug lookup |
| 36 | hits = hub.search("imatinib") |
| 37 | print(hub.summarize(hits, "imatinib")) |
| 38 | |
| 39 | # Target-based search |
| 40 | hits = hub.search("EGFR") |
| 41 | |
| 42 | # Batch |
| 43 | results = hub.search_batch(["metformin", "aspirin", "BRAF"]) |
| 44 | ``` |
| 45 | |
| 46 | ## Data |
| 47 | |
| 48 | - **Source**: Broad Institute Drug Repurposing Hub (https://repo-hub.broadinstitute.org/repurposing) |
| 49 | - **Drug file**: `repo-drug-annotation-20200324.txt` — tab-delimited, `!`-prefixed comment lines |
| 50 | - Columns: `pert_iname`, `clinical_phase`, `moa`, `target`, `disease_area`, `indication` |
| 51 | - **Sample file**: `repo-sample-annotation-20240610.txt` — tab-delimited, `!`-prefixed comment lines |
| 52 | - Columns include: `broad_id`, `pert_iname`, `InChIKey`, `pubchem_cid`, `smiles`, `vendor`, `purity`, etc. |
| 53 | - **Merge**: on `pert_iname`; first sample with non-empty `InChIKey` is kept per drug |
| 54 | - **Path**: `DATA_DIR` variable in `29_Drug_Repurposing_Hub.py` |
| 55 | - **Citation**: Corsello SM et al. *Nature Medicine* 23, 405–408 (2017). doi:10.1038/nm.4306 |