← 返回 Skills 市场
hollyya

KEGG Query

作者 HollyYa · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
101
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install kegg-query
功能描述
Query KEGG database for drug information, pathway analysis, and disease-drug-target discovery. Use this skill when: (1) Looking up drug information including...
使用说明 (SKILL.md)

KEGG Query

Query the KEGG (Kyoto Encyclopedia of Genes and Genomes) database for comprehensive biomedical information.

When to Use

  • Drug Lookup: Retrieve drug efficacy, targets, metabolism, drug-drug interactions
  • Pathway Analysis: Get pathway genes, compounds, modules, and related pathways
  • Disease Discovery: Find disease-associated drugs, genes, and therapeutic targets

Workflow

Use Case 1: Drug Information Lookup

Fetch comprehensive drug information from KEGG DRUG database.

from scripts.kegg_api import kegg_find, kegg_get, parse_drug_entry

# Step 1: Search for drug by name
results = kegg_find("drug", "aspirin")
# Returns: [("dr:D00109", "Aspirin (JP18/USP); Acetylsalicylic acid; ...")]

# Step 2: Get full entry
drug_id = "dr:D00109"  # or just "D00109"
entry = kegg_get(drug_id)
drug_info = parse_drug_entry(entry)

Output includes: Names, formula, efficacy, diseases, targets, pathways, metabolism, DDI.

See examples/drug_lookup.py for complete implementation.

Use Case 2: Pathway Analysis

Analyze KEGG pathways to retrieve genes, compounds, and modules.

from scripts.kegg_api import kegg_get, parse_pathway_entry

# Get pathway by ID (e.g., hsa00010 for Glycolysis)
entry = kegg_get("hsa00010")
pathway = parse_pathway_entry(entry)

# Access parsed data
print(f"Genes: {len(pathway['genes'])}")      # 50+ genes
print(f"Compounds: {len(pathway['compounds'])}")  # 30+ compounds

Output includes: Description, genes with KO/EC annotations, compounds, modules, related pathways.

See examples/pathway_analysis.py for complete implementation.

Use Case 3: Disease-Drug-Target Discovery

Discover therapeutic targets and drugs for diseases.

from scripts.kegg_api import kegg_find, kegg_get, parse_disease_entry

# Step 1: Search for disease
results = kegg_find("disease", "diabetes")
# Returns multiple matches including Type 2 diabetes (H00409)

# Step 2: Get disease details
entry = kegg_get("ds:H00409")
disease = parse_disease_entry(entry)

# Access drugs and targets
print(f"Drugs: {len(disease['drugs'])}")    # 60+ drugs
print(f"Genes: {len(disease['genes'])}")    # 20+ genes

Output includes: Description, category, associated genes, pathways, approved drugs.

See examples/disease_discovery.py for complete implementation.

Expected Outputs

Drug Entry (JSON)

{
  "id": "D00109",
  "names": ["Aspirin", "Acetylsalicylic acid"],
  "formula": "C9H8O4",
  "efficacy": ["Analgesic", "Anti-inflammatory", "Antipyretic", "COX inhibitor"],
  "targets": [
    {"gene": "PTGS1", "uniprot": "P23219", "ko": "K00509"},
    {"gene": "PTGS2", "uniprot": "P35354", "ko": "K11987"}
  ],
  "pathways": ["hsa00590", "hsa04611"],
  "diseases": ["Myocardial infarction", "Unstable angina"]
}

Pathway Entry (JSON)

{
  "id": "hsa00010",
  "name": "Glycolysis / Gluconeogenesis",
  "organism": "Homo sapiens",
  "description": "Glycolysis is the process...",
  "genes": [
    {"id": "10327", "symbol": "AKR1A1", "ko": "K00002", "ec": "1.1.1.2"},
    {"id": "3939", "symbol": "LDHA", "ko": "K00016", "ec": "1.1.1.27"}
  ],
  "compounds": [
    {"id": "C00031", "name": "D-Glucose"},
    {"id": "C00022", "name": "Pyruvate"}
  ],
  "modules": ["hsa_M00001", "hsa_M00002", "hsa_M00003"]
}

Disease Entry (JSON)

{
  "id": "H00409",
  "name": "Type 2 diabetes mellitus",
  "category": "Endocrine and metabolic disease",
  "description": "T2DM is characterized by chronic hyperglycemia...",
  "genes": [
    {"symbol": "CAPN10", "ko": "K08579"},
    {"symbol": "TCF7L2", "ko": "K04491"}
  ],
  "drugs": [
    {"id": "D00944", "name": "Metformin hydrochloride"},
    {"id": "D06404", "name": "Liraglutide"}
  ],
  "pathways": ["hsa04930", "hsa04911"]
}

KEGG API Reference

Operation URL Pattern Description
info /info/{database} Database statistics
list /list/{database} List all entries
find /find/{database}/{query} Search by keyword
get /get/{entry_id} Retrieve entry
link /link/{target}/{source} Cross-references
conv /conv/{target}/{source} ID conversion

Key Databases: pathway, compound, drug, disease, genes, enzyme, ko

Entry ID Formats:

  • Drug: D00009 or dr:D00009
  • Compound: C00031 or cpd:C00031
  • Pathway: hsa00010 (organism-specific) or map00010 (reference)
  • Disease: H00409 or ds:H00409
  • Gene: hsa:5742 (organism:gene_id)

Error Handling

Error Solution
Entry not found Verify ID format (e.g., D00109, not aspirin)
Multiple matches Use kegg_find first to get exact ID
Timeout Reduce query complexity, retry with delay
Rate limited KEGG allows ~10 requests/second; add delays

Integration with OpenBioMed

from open_biomed.data import Molecule, Protein
from open_biomed.tools.tool_registry import TOOLS

# Convert KEGG compound to Molecule
compound_entry = kegg_get("cpd:C00031")  # Glucose
mol_file = kegg_get("C00031", option="mol")  # Get MOL format
# molecule = Molecule.from_mol_file(mol_file)

# Get protein from KEGG gene
gene_entry = kegg_get("hsa:5742")  # PTGS1
# Use UniProt ID to fetch protein
protein_tool = TOOLS["protein_uniprot_request"]
proteins, _ = protein_tool.run(accession="P23219")

References

安全使用建议
This skill appears coherent and does what it claims: example Python code calls the public KEGG REST API and parses results. There are no requested secrets or risky install steps. Consider: (1) queries are sent to rest.kegg.jp — avoid sending sensitive or personally identifiable data to any external service, (2) respect KEGG rate limits for bulk queries (examples mention batching/delays), and (3) review example code (uses the 'requests' library) before running in a production environment. If you require offline or private datasets, this skill will not provide that.
功能分析
Type: OpenClaw Skill Name: kegg-query Version: 1.0.0 The kegg-query skill bundle provides a legitimate interface for querying the Kyoto Encyclopedia of Genes and Genomes (KEGG) database. The included Python scripts (e.g., drug_lookup.py, pathway_analysis.py) use the official KEGG REST API (rest.kegg.jp) to retrieve and parse biomedical data. No evidence of data exfiltration, malicious execution, or harmful prompt injection was found; the code and instructions are strictly aligned with the stated purpose of bioinformatics research.
能力评估
Purpose & Capability
Name/description (KEGG Query) match the provided code and SKILL.md: all examples implement searches, GETs, and parsing of KEGG entries via the official REST API (https://rest.kegg.jp). There are no unrelated credentials, binaries, or config paths required.
Instruction Scope
SKILL.md and the example scripts only instruct network calls to the KEGG REST endpoints and local parsing/formatting. They do not read local secrets, scan unrelated files, or send data to endpoints other than rest.kegg.jp. The only external integration mentioned (OpenBioMed) is optional/example usage and does not introduce extra required permissions.
Install Mechanism
Instruction-only skill with example Python scripts; there is no install specification and no downloads of third-party code. The examples use the standard 'requests' library, which is expected for HTTP access.
Credentials
No required environment variables, credentials, or config paths are declared or used. The skill does perform outbound HTTP requests to KEGG, which is proportional and necessary for its function.
Persistence & Privilege
Skill is not marked always:true and does not request persistent system presence or modify other skills. Default autonomous invocation is allowed (platform default) but this skill's capabilities are limited to KEGG queries.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install kegg-query
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /kegg-query 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of kegg-query: - Query KEGG for drug information, pathway analysis, and disease-drug-target discovery. - Supports drug lookup (efficacy, targets, metabolism, interactions), pathway gene/compound analysis, and disease associations. - Returns structured, rich JSON outputs for drugs, pathways, and diseases. - Includes robust workflow examples and API usage details. - Provides integration guidelines with OpenBioMed tools. - Includes KEGG API reference and troubleshooting for common errors.
元数据
Slug kegg-query
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

KEGG Query 是什么?

Query KEGG database for drug information, pathway analysis, and disease-drug-target discovery. Use this skill when: (1) Looking up drug information including... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 101 次。

如何安装 KEGG Query?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install kegg-query」即可一键安装,无需额外配置。

KEGG Query 是免费的吗?

是的,KEGG Query 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

KEGG Query 支持哪些平台?

KEGG Query 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 KEGG Query?

由 HollyYa(@hollyya)开发并维护,当前版本 v1.0.0。

💬 留言讨论