界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
数据与研究 · SKILL.md

kegg-pathway

kegg-pathway

【数据与研究】Query the KEGG REST API for metabolic pathways, genes, compounds, drugs, and diseases. Use when the user needs pathway mapping, gene-to-pathway links, compound info, or cross-reference ID conversion. NOT for protein sequences (use UniProt), 3D structures (use PDB), or variant/SNP data (use NCBI).

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: kegg-pathway description: "Query the KEGG REST API for metabolic pathways, genes, compounds, drugs, and diseases. Use when the user needs pathway mapping, gene-to-pathway links, compound info, or cross-reference ID conversion. NOT for protein sequences (use UniProt), 3D structures (use PDB), or variant/SNP data (use NCBI)." metadata: { "openclaw": { "emoji": "🗺️", "requires": { "bins": ["curl"] } } }

KEGG Pathway Database REST API

Access the Kyoto Encyclopedia of Genes and Genomes (KEGG) for pathway maps, gene annotations, compound data, drug info, and disease records. No authentication required.

API Endpoints

Base: https://rest.kegg.jp

GET /list/{database} -- List all entries in a database

# List all human pathways
curl -s "https://rest.kegg.jp/list/pathway/hsa"

# List all KEGG organisms
curl -s "https://rest.kegg.jp/list/organism"

GET /find/{database}/{query} -- Search by keyword

# Search pathways for "apoptosis"
curl -s "https://rest.kegg.jp/find/pathway/apoptosis"

# Search genes for BRCA1 across all organisms
curl -s "https://rest.kegg.jp/find/genes/brca1"

# Search compounds by name
curl -s "https://rest.kegg.jp/find/compound/glucose"

# Search diseases by keyword
curl -s "https://rest.kegg.jp/find/disease/diabetes"

GET /get/{entry} -- Retrieve full entry details

# Get a pathway entry (human apoptosis pathway)
curl -s "https://rest.kegg.jp/get/hsa04210"

# Get a human gene entry
curl -s "https://rest.kegg.jp/get/hsa:7157"

# Get a compound entry (glucose)
curl -s "https://rest.kegg.jp/get/C00031"

# Get a KEGG Orthology entry
curl -s "https://rest.kegg.jp/get/K00001"

# Get pathway map as image
curl -s "https://rest.kegg.jp/get/hsa04210/image" -o apoptosis.png

GET /link/{target}/{source} -- Cross-reference between databases

# Find all genes in a pathway
curl -s "https://rest.kegg.jp/link/hsa/hsa04210"

# Find pathways associated with a gene
curl -s "https://rest.kegg.jp/link/pathway/hsa:7157"

# Find compounds in a pathway
curl -s "https://rest.kegg.jp/link/compound/hsa00010"

# Find diseases linked to a gene
curl -s "https://rest.kegg.jp/link/disease/hsa:672"

# Link KEGG Orthology to pathways
curl -s "https://rest.kegg.jp/link/pathway/ko:K00001"

GET /conv/{target}/{source} -- Convert between ID systems

# Convert KEGG gene IDs to NCBI Gene IDs
curl -s "https://rest.kegg.jp/conv/ncbi-geneid/hsa:7157"

# Convert NCBI Gene IDs to KEGG
curl -s "https://rest.kegg.jp/conv/hsa/ncbi-geneid:7157"

# Convert KEGG compound to PubChem
curl -s "https://rest.kegg.jp/conv/pubchem/compound:C00031"

# Convert UniProt to KEGG gene IDs
curl -s "https://rest.kegg.jp/conv/hsa/uniprot:P04637"

Supported Databases

DatabaseCodeDescription
PathwaypathwayMetabolic and signaling pathway maps
ModulemoduleFunctional units within pathways
KOkoKEGG Orthology (functional orthologs)
GenomegenomeOrganism genomes
GenesgenesGene entries per organism (e.g., hsa)
CompoundcompoundSmall molecules and metabolites
DrugdrugDrug and pharmaceutical entries
DiseasediseaseHuman disease entries

Common Patterns

# Full workflow: find pathways for a gene, then get pathway details
curl -s "https://rest.kegg.jp/link/pathway/hsa:7157"   # Step 1: find pathways
curl -s "https://rest.kegg.jp/get/hsa04115"             # Step 2: get details

# Map between KEGG and external IDs for batch processing
curl -s "https://rest.kegg.jp/conv/ncbi-geneid/hsa"

Organism Codes

Common codes: hsa (human), mmu (mouse), rno (rat), dme (fly), sce (yeast), eco (E. coli).

Best Practices

  1. KEGG returns tab-separated plain text by default -- parse with cut, awk, or similar.
  2. Use /link for mapping between databases and /conv for external ID conversion.
  3. Prefix gene IDs with the organism code (e.g., hsa:7157 for human TP53).
  4. Pathway IDs use organism prefix + number (e.g., hsa04210); use map04210 for reference.
  5. No authentication is required, but KEGG limits heavy automated access -- keep requests reasonable.
  6. Download pathway images with /get/{pathway_id}/image for visual reference.
  7. Use /find for keyword search and /list to enumerate all entries in a database.

Data Integrity Rule

NEVER fabricate database results from training data. Every protein ID, gene name, compound property, pathway ID, structure detail, and metadata MUST come from an actual API response in this conversation. If the API returns no results, errors, or partial data, report exactly what happened. Do not "fill in" missing data from memory or make up identifiers.

我的收藏