TTD — Therapeutic Target Database

SkillDatabases & data

Query the Therapeutic Target Database (TTD) for drug-target-disease interaction data. Use this skill when the user asks about therapeutic targets, drugs, diseases, or their relationships, including target-drug mappings, clinical status of drugs, disease indications, UniProt/gene associations, and pathway annotations. Triggers on queries like "what drugs target EGFR", "which diseases is Imatinib used for", "find targets for lung cancer", or any lookup involving TTD IDs, gene symbols, drug names, or disease names.

Instructions available. Your AI can read the instructions. Execution depends on the setup they require.

Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.

Then ask your AI: use the TTD skill

What this skill tells your AI

The instructions your AI receives, as published by qsong-github/drugclaw in skills/dti/ttd/SKILL.md and read by ahel’s review.

Source: https://ttd.idrblab.cn/ Paper: https://academic.oup.com/nar/article/52/D1/D1465/7275004 Data dir: resources_metadata/dti/TTD

Data files (4 required)

FileContent
P1-01-TTD_target_download.txtTarget info: name, UniProt, gene, type, function, disease indication, pathway
P2-01-TTD_target_drug.txtTarget ↔ Drug links with clinical status (Approved / Phase I–III / Experimental)
P1-06-Target_disease.txtTarget ↔ Disease associations
P1-07-Drug_disease.txtDrug ↔ Disease associations

File formats:

  • P1-01, P2-01 — block format: blank-line separated records, each line <ID>\t<KEY>\t<VALUE>
  • P1-06, P1-07 — TSV with header row

Query API

query(entities, entity_type="auto", data_dir=DATA_DIR)

Returns a list of dicts, one per queried entity.

ParameterTypeDescription
entitiesstr or list[str]One or more entity names / IDs
entity_type"auto" / "target" / "drug" / "disease"Restrict search; "auto" tries target → drug → disease
data_dirstrPath to TTD data directory

query_json(entities, ...) → str

Same as query() but returns a JSON string. Use for LLM consumption.


Input formats accepted

InputExamples
Gene / protein name"EGFR", "TP53", "BCR-ABL"
Drug name"Imatinib", "Gefitinib", "Osimertinib"
Disease name"Lung cancer", "Diabetes mellitus" (partial match supported)
TTD Target ID"TTDTARGET00001"
TTD Drug ID"D0Y4GH"

Matching is case-insensitive; disease names support partial matching.


Output structure

Target result

{
  "query": "EGFR",
  "entity_type": "target",
  "ttd_id": "TTDTARGET00001",
  "name": "Epidermal growth factor receptor",
  "uniprot": "P00533",
  "gene": "EGFR",
  "target_type": "Successful target",
  "function": "Receptor tyrosine kinase...",
  "disease": "Non-small-cell lung cancer [ICD-11: 2C25]",
  "pathway": "EGFR signaling pathway",
  "drugs": [
    {"drug_id": "D0Y4GH", "drug_name": "Gefitinib", "clinical_status": "Approved"},
    {"drug_id": "D08VGC", "drug_name": "Erlotinib", "clinical_status": "Approved"}
  ]
}

Drug result

{
  "query": "Imatinib",
  "entity_type": "drug",
  "drug_id": "D0IQX1",
  "drug_name": "Imatinib",
  "targets": [
    {"ttd_target_id": "TTDTARGET00002", "target_name": "BCR-ABL",
     "clinical_status": "Approved", "drug_id": "D0IQX1"}
  ],
  "diseases": ["Chronic myelogenous leukemia", "Gastrointestinal stromal tumor"]
}

Disease result

{
  "query": "Lung cancer",
  "entity_type": "disease",
  "disease_name": "non-small-cell lung cancer",
  "targets": [
    {"ttd_target_id": "TTDTARGET00001", "target_name": "EGFR"}
  ],
  "drugs": ["Gefitinib", "Osimertinib", "Erlotinib"]
}

Not found

{"query": "XYZ123", "entity_type": "not_found", "message": "No match found in TTD."}

Usage examples

from 17_TTD import query, query_json

# Single entity
results = query("EGFR")

# Multiple entities (mixed types — auto-detected)
results = query(["EGFR", "Imatinib", "Lung cancer"])

# Restrict to drug search only
results = query(["Gefitinib", "Osimertinib"], entity_type="drug")

# JSON string output (for LLM)
print(query_json("TP53"))

CLI (demo runs with EGFR / Imatinib / Lung cancer if no args):

python 17_TTD.py EGFR Imatinib "Lung cancer"
python 17_TTD.py TTDTARGET00001

Notes

  • entity_type="auto" stops at the first match type per entity (target → drug → disease). Use explicit type to resolve ambiguity.
  • drugs in target results lists all TTD-linked drugs; filter clinical_status == "Approved" for marketed drugs.
  • Disease partial matching — "lung cancer" will match "non-small-cell lung cancer". The first candidate is returned; use entity_type="disease" with a more specific name if needed.
  • Multi-value fields (e.g. multiple pathways for one target) are returned as lists.

Signals

GitHub stars
116
Forks
3
Last commit
Aug 2026
Advanced
Item type
skill
Key
ttd
Source
github.com/qsong-github/drugclaw