$npx -y skills add QSong-github/DrugClaw --skill drkgQuery the DRKG (Drug Repurposing Knowledge Graph). Use whenever the user asks about drug–gene, drug–disease, gene–disease, or other biomedical entity relationships in a knowledge-graph context, drug repurposing candidates, COVID-19 drug repurposing, or wants to explore neighbours
| 1 | # DRKG Query Skill |
| 2 | |
| 3 | Search the Drug Repurposing Knowledge Graph (97 238 entities, 5 874 261 |
| 4 | triplets, 107 relation types) by any entity. Auto-detects entity type by |
| 5 | input pattern and returns all KG neighbours. |
| 6 | |
| 7 | ## Entity Format |
| 8 | |
| 9 | Entities in DRKG are typed strings: `Type::ID`. |
| 10 | |
| 11 | | Entity Type | Example | Count | |
| 12 | |---|---|---| |
| 13 | | Compound | `Compound::DB00945` | 24 313 | |
| 14 | | Gene | `Gene::1956` | 39 220 | |
| 15 | | Disease | `Disease::DOID:162` | 5 103 | |
| 16 | | Anatomy | `Anatomy::UBERON:0001474` | 400 | |
| 17 | | Biological Process | `Biological Process::GO:0006915` | 11 381 | |
| 18 | | Cellular Component | `Cellular Component::GO:0005634` | 1 391 | |
| 19 | | Molecular Function | `Molecular Function::GO:0005515` | 2 884 | |
| 20 | | Pathway | `Pathway::PC7_8078` | 1 822 | |
| 21 | | Pharmacologic Class | `Pharmacologic Class::N0000175605` | 345 | |
| 22 | | Side Effect | `Side Effect::C0000737` | 5 701 | |
| 23 | | Symptom | `Symptom::D009325` | 415 | |
| 24 | | Atc | `Atc::N02BE01` | 4 048 | |
| 25 | | Tax | `Tax::9606` | 215 | |
| 26 | |
| 27 | Relations are typed strings: `Source::RelType::HeadType:TailType`, e.g. |
| 28 | `DRUGBANK::target::Compound:Gene`, `Hetionet::CtD::Compound:Disease`. |
| 29 | |
| 30 | ## Input Auto-Detection |
| 31 | |
| 32 | | Input Pattern | Detected As | Match Logic | |
| 33 | |---|---|---| |
| 34 | | `Compound::DB00945` | full DRKG entity | exact match | |
| 35 | | `DB\d{5,}` | DrugBank ID | prepend `Compound::` | |
| 36 | | `DOID:\d+` / `MESH:D\d+` | Disease ID | prepend `Disease::` | |
| 37 | | `GO:\d+` | GO term | try BP / MF / CC | |
| 38 | | pure digits (`1956`) | Entrez Gene ID | prepend `Gene::` | |
| 39 | | anything else | free text | case-insensitive substring across all entities | |
| 40 | |
| 41 | ## API |
| 42 | |
| 43 | | Function | Input | Returns | |
| 44 | |---|---|---| |
| 45 | | `search(query, limit=200)` | single entity string | dict with `resolved`, `as_head`, `as_tail` | |
| 46 | | `search_batch(queries, limit=200)` | list of entity strings | dict[query → result] | |
| 47 | | `get_sources(entity)` | resolved DRKG entity | source attribution string | |
| 48 | | `get_relation_info(relation)` | relation string | glossary dict | |
| 49 | | `entity_types()` | — | list of 13 entity type names | |
| 50 | | `summarize(result)` | search result dict | compact LLM-readable text | |
| 51 | | `to_json(result)` | search result dict | JSON-serialisable dict | |
| 52 | |
| 53 | ## Usage |
| 54 | |
| 55 | See `if __name__ == "__main__"` block in `25_DRKG.py` for runnable examples: |
| 56 | single-entity search (full ID, bare ID, free text), batch search, relation |
| 57 | glossary lookup, and JSON output. |
| 58 | |
| 59 | ## Data Sources |
| 60 | |
| 61 | DRKG integrates six databases plus COVID-19 literature: |
| 62 | |
| 63 | | Source | Triplets | Coverage | |
| 64 | |---|---|---| |
| 65 | | DrugBank | 1 424 790 | drug–drug, drug–gene, drug–disease, ATC | |
| 66 | | Hetionet | 2 250 197 | gene–gene, anatomy, pathways, side effects | |
| 67 | | GNBR | 335 369 | gene–gene, compound–gene, disease–gene | |
| 68 | | STRING | 1 496 708 | protein–protein interactions | |
| 69 | | IntAct | 256 151 | protein–protein interactions | |
| 70 | | DGIdb | 26 290 | drug–gene interactions | |
| 71 | | Bibliography | 84 756 | COVID-19 related | |
| 72 | |
| 73 | ## Data Files |
| 74 | |
| 75 | Located at `DATA_DIR` in `25_DRKG.py`: |
| 76 | |
| 77 | | File | Description | |
| 78 | |---|---| |
| 79 | | `drkg.tsv` | 5 874 261 triplets (head, relation, tail) | |
| 80 | | `relation_glossary.tsv` | relation type glossary with source info | |
| 81 | | `entity2src.tsv` | entity → original data-source mapping | |
| 82 | |
| 83 | ## Citation |
| 84 | |
| 85 | ``` |
| 86 | Ioannidis et al. "DRKG - Drug Repurposing Knowledge Graph for Covid-19", 2020. |
| 87 | https://github.com/gnn4dr/DRKG |
| 88 | ``` |