jpskill.com
💼 ビジネス コミュニティ

kegg-database

KEGGデータベースにREST APIで直接アクセスし、パスウェイ解析、遺伝子とパスウェイのマッピング、代謝経路、医薬品相互作用、ID変換などを実行できるため、特定のKEGGデータに直接アクセスしたい場合に活用するSkill。

📜 元の英語説明(参考)

Direct REST API access to KEGG (academic use only). Pathway analysis, gene-pathway mapping, metabolic pathways, drug interactions, ID conversion. For Python workflows with multiple databases, prefer bioservices. Use this for direct HTTP/REST work or KEGG-specific control.

🇯🇵 日本人クリエイター向け解説

一言でいうと

KEGGデータベースにREST APIで直接アクセスし、パスウェイ解析、遺伝子とパスウェイのマッピング、代謝経路、医薬品相互作用、ID変換などを実行できるため、特定のKEGGデータに直接アクセスしたい場合に活用するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o kegg-database.zip https://jpskill.com/download/18439.zip && unzip -o kegg-database.zip && rm kegg-database.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/18439.zip -OutFile "$d\kegg-database.zip"; Expand-Archive "$d\kegg-database.zip" -DestinationPath $d -Force; ri "$d\kegg-database.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して kegg-database.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → kegg-database フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
3

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

KEGGデータベース

概要

KEGG(Kyoto Encyclopedia of Genes and Genomes:京都遺伝子ゲノム百科事典)は、生物学的経路解析および分子間相互作用ネットワークのための包括的なバイオインフォマティクスリソースです。

重要: KEGG APIは、学術ユーザーによる学術利用のみに提供されています。

このSkillを使用する場面

このSkillは、KEGGのREST APIを使用して、複数の生物にわたる経路、遺伝子、化合物、酵素、疾患、および薬剤をクエリする場合に使用する必要があります。

クイックスタート

このSkillは以下を提供します。

  1. すべてのKEGG REST API操作のためのPythonヘルパー関数 (scripts/kegg_api.py)
  2. 詳細なAPI仕様を含む包括的なリファレンスドキュメント (references/kegg_reference.md)

ユーザーがKEGGデータを要求する場合、どの操作が必要かを判断し、scripts/kegg_api.pyから適切な関数を使用してください。

コア操作

1. データベース情報 (kegg_info)

KEGGデータベースに関するメタデータと統計情報を取得します。

使用する場面: データベース構造の理解、利用可能なデータの確認、リリース情報の取得。

使用法:

from scripts.kegg_api import kegg_info

# 経路データベースの情報を取得
info = kegg_info('pathway')

# 生物固有の情報を取得
hsa_info = kegg_info('hsa')  # ヒトゲノム

一般的なデータベース: kegg, pathway, module, brite, genes, genome, compound, glycan, reaction, enzyme, disease, drug

2. エントリーのリスト表示 (kegg_list)

KEGGデータベースからエントリーの識別子と名前をリスト表示します。

使用する場面: 生物のすべての経路を取得、遺伝子のリスト表示、化合物カタログの取得。

使用法:

from scripts.kegg_api import kegg_list

# すべての参照経路をリスト表示
pathways = kegg_list('pathway')

# ヒト特異的な経路をリスト表示
hsa_pathways = kegg_list('pathway', 'hsa')

# 特定の遺伝子をリスト表示 (最大10個)
genes = kegg_list('hsa:10458+hsa:10459')

一般的な生物コード: hsa (ヒト), mmu (マウス), dme (ショウジョウバエ), sce (酵母), eco (大腸菌)

3. 検索 (kegg_find)

キーワードまたは分子特性でKEGGデータベースを検索します。

使用する場面: 名前/説明で遺伝子を検索、式または質量で化合物を検索、キーワードでエントリーを発見。

使用法:

from scripts.kegg_api import kegg_find

# キーワード検索
results = kegg_find('genes', 'p53')
shiga_toxin = kegg_find('genes', 'shiga toxin')

# 化学式検索 (完全一致)
compounds = kegg_find('compound', 'C7H10N4O2', 'formula')

# 分子量範囲検索
drugs = kegg_find('drug', '300-310', 'exact_mass')

検索オプション: formula (完全一致), exact_mass (範囲), mol_weight (範囲)

4. エントリーの取得 (kegg_get)

完全なデータベースエントリーまたは特定のデータ形式を取得します。

使用する場面: 経路の詳細の取得、遺伝子/タンパク質配列の取得、経路マップのダウンロード、化合物構造へのアクセス。

使用法:

from scripts.kegg_api import kegg_get

# 経路エントリーを取得
pathway = kegg_get('hsa00010')  # 解糖経路

# 複数のエントリーを取得 (最大10個)
genes = kegg_get(['hsa:10458', 'hsa:10459'])

# タンパク質配列を取得 (FASTA)
sequence = kegg_get('hsa:10458', 'aaseq')

# ヌクレオチド配列を取得
nt_seq = kegg_get('hsa:10458', 'ntseq')

# 化合物構造を取得
mol_file = kegg_get('cpd:C00002', 'mol')  # MOL形式のATP

# 経路をJSONとして取得 (単一エントリーのみ)
pathway_json = kegg_get('hsa05130', 'json')

# 経路画像をを取得 (単一エントリーのみ)
pathway_img = kegg_get('hsa05130', 'image')

出力形式: aaseq (タンパク質FASTA), ntseq (ヌクレオチドFASTA), mol (MOL形式), kcf (KCF形式), image (PNG), kgml (XML), json (経路JSON)

重要: image、KGML、およびJSON形式は、一度に1つのエントリーのみを許可します。

5. ID変換 (kegg_conv)

KEGGと外部データベース間で識別子を変換します。

使用する場面: KEGGデータを他のデータベースと統合、遺伝子IDのマッピング、化合物識別子の変換。

使用法:

from scripts.kegg_api import kegg_conv

# すべてのヒト遺伝子をNCBI Gene IDに変換
conversions = kegg_conv('ncbi-geneid', 'hsa')

# 特定の遺伝子を変換
gene_id = kegg_conv('ncbi-geneid', 'hsa:10458')

# UniProtに変換
uniprot_id = kegg_conv('uniprot', 'hsa:10458')

# 化合物をPubChemに変換
pubchem_ids = kegg_conv('pubchem', 'compound')

# 逆変換 (NCBI Gene IDからKEGGへ)
kegg_id = kegg_conv('hsa', 'ncbi-geneid')

サポートされている変換: ncbi-geneid, ncbi-proteinid, uniprot, pubchem, chebi

6. 相互参照 (kegg_link)

KEGGデータベース内およびデータベース間で関連するエントリーを検索します。

使用する場面: 遺伝子を含む経路の検索、経路内の遺伝子の取得、遺伝子をKOグループにマッピング、経路内の化合物の検索。

使用法:

from scripts.kegg_api import kegg_link

# ヒト遺伝子にリンクされた経路を検索
pathways = kegg_link('pathway', 'hsa')

# 特定の経路内の遺伝子を取得
genes = kegg_link('genes', 'hsa00010')  # 解糖遺伝子

# 特定の遺伝子を含む経路を検索
gene_pathways = kegg_link('pathway', 'hsa:10458')

# 経路内の化合物を検索
compounds = kegg_link('compound', 'hsa00010')

# 遺伝子をKO(オーソロジー)グループにマッピング
ko_groups = kegg_link('ko', 'hsa:10458')

一般的なリンク: genes ↔ pathway, pathway ↔ compound, pathway ↔ enzyme, genes ↔ ko (orthology)

7. 薬物間相互作用 (kegg_ddi)

薬物間相互作用を確認します。

使用する場面: 薬物併用の分析、禁忌の確認、薬理学的研究。

使用法:

from scripts.kegg_api import kegg_ddi

# 単一の薬物をチェック
interactions = kegg_ddi('D00001')

# 複数の薬物をチェック (最大10個)
interactions = kegg_ddi(['D00001', 'D00002', 'D00003'])

一般的な分析ワークフロー

ワークフロー1:遺伝子から経路へのマッピング

ユースケース: 関心のある遺伝子に関連付けられた経路の検索(例:経路エンリッチメント分析用)。

from scripts.kegg_api import kegg_find, kegg_link, kegg_get

# ステップ1:名前で遺伝子IDを検索
gene_results = kegg_find('genes', 'p53')

# ステップ2:L
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

KEGG Database

Overview

KEGG (Kyoto Encyclopedia of Genes and Genomes) is a comprehensive bioinformatics resource for biological pathway analysis and molecular interaction networks.

Important: KEGG API is made available only for academic use by academic users.

When to Use This Skill

This skill should be used when querying pathways, genes, compounds, enzymes, diseases, and drugs across multiple organisms using KEGG's REST API.

Quick Start

The skill provides:

  1. Python helper functions (scripts/kegg_api.py) for all KEGG REST API operations
  2. Comprehensive reference documentation (references/kegg_reference.md) with detailed API specifications

When users request KEGG data, determine which operation is needed and use the appropriate function from scripts/kegg_api.py.

Core Operations

1. Database Information (kegg_info)

Retrieve metadata and statistics about KEGG databases.

When to use: Understanding database structure, checking available data, getting release information.

Usage:

from scripts.kegg_api import kegg_info

# Get pathway database info
info = kegg_info('pathway')

# Get organism-specific info
hsa_info = kegg_info('hsa')  # Human genome

Common databases: kegg, pathway, module, brite, genes, genome, compound, glycan, reaction, enzyme, disease, drug

2. Listing Entries (kegg_list)

List entry identifiers and names from KEGG databases.

When to use: Getting all pathways for an organism, listing genes, retrieving compound catalogs.

Usage:

from scripts.kegg_api import kegg_list

# List all reference pathways
pathways = kegg_list('pathway')

# List human-specific pathways
hsa_pathways = kegg_list('pathway', 'hsa')

# List specific genes (max 10)
genes = kegg_list('hsa:10458+hsa:10459')

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

3. Searching (kegg_find)

Search KEGG databases by keywords or molecular properties.

When to use: Finding genes by name/description, searching compounds by formula or mass, discovering entries by keywords.

Usage:

from scripts.kegg_api import kegg_find

# Keyword search
results = kegg_find('genes', 'p53')
shiga_toxin = kegg_find('genes', 'shiga toxin')

# Chemical formula search (exact match)
compounds = kegg_find('compound', 'C7H10N4O2', 'formula')

# Molecular weight range search
drugs = kegg_find('drug', '300-310', 'exact_mass')

Search options: formula (exact match), exact_mass (range), mol_weight (range)

4. Retrieving Entries (kegg_get)

Get complete database entries or specific data formats.

When to use: Retrieving pathway details, getting gene/protein sequences, downloading pathway maps, accessing compound structures.

Usage:

from scripts.kegg_api import kegg_get

# Get pathway entry
pathway = kegg_get('hsa00010')  # Glycolysis pathway

# Get multiple entries (max 10)
genes = kegg_get(['hsa:10458', 'hsa:10459'])

# Get protein sequence (FASTA)
sequence = kegg_get('hsa:10458', 'aaseq')

# Get nucleotide sequence
nt_seq = kegg_get('hsa:10458', 'ntseq')

# Get compound structure
mol_file = kegg_get('cpd:C00002', 'mol')  # ATP in MOL format

# Get pathway as JSON (single entry only)
pathway_json = kegg_get('hsa05130', 'json')

# Get pathway image (single entry only)
pathway_img = kegg_get('hsa05130', 'image')

Output formats: aaseq (protein FASTA), ntseq (nucleotide FASTA), mol (MOL format), kcf (KCF format), image (PNG), kgml (XML), json (pathway JSON)

Important: Image, KGML, and JSON formats allow only one entry at a time.

5. ID Conversion (kegg_conv)

Convert identifiers between KEGG and external databases.

When to use: Integrating KEGG data with other databases, mapping gene IDs, converting compound identifiers.

Usage:

from scripts.kegg_api import kegg_conv

# Convert all human genes to NCBI Gene IDs
conversions = kegg_conv('ncbi-geneid', 'hsa')

# Convert specific gene
gene_id = kegg_conv('ncbi-geneid', 'hsa:10458')

# Convert to UniProt
uniprot_id = kegg_conv('uniprot', 'hsa:10458')

# Convert compounds to PubChem
pubchem_ids = kegg_conv('pubchem', 'compound')

# Reverse conversion (NCBI Gene ID to KEGG)
kegg_id = kegg_conv('hsa', 'ncbi-geneid')

Supported conversions: ncbi-geneid, ncbi-proteinid, uniprot, pubchem, chebi

6. Cross-Referencing (kegg_link)

Find related entries within and between KEGG databases.

When to use: Finding pathways containing genes, getting genes in a pathway, mapping genes to KO groups, finding compounds in pathways.

Usage:

from scripts.kegg_api import kegg_link

# Find pathways linked to human genes
pathways = kegg_link('pathway', 'hsa')

# Get genes in a specific pathway
genes = kegg_link('genes', 'hsa00010')  # Glycolysis genes

# Find pathways containing a specific gene
gene_pathways = kegg_link('pathway', 'hsa:10458')

# Find compounds in a pathway
compounds = kegg_link('compound', 'hsa00010')

# Map genes to KO (orthology) groups
ko_groups = kegg_link('ko', 'hsa:10458')

Common links: genes ↔ pathway, pathway ↔ compound, pathway ↔ enzyme, genes ↔ ko (orthology)

7. Drug-Drug Interactions (kegg_ddi)

Check for drug-drug interactions.

When to use: Analyzing drug combinations, checking for contraindications, pharmacological research.

Usage:

from scripts.kegg_api import kegg_ddi

# Check single drug
interactions = kegg_ddi('D00001')

# Check multiple drugs (max 10)
interactions = kegg_ddi(['D00001', 'D00002', 'D00003'])

Common Analysis Workflows

Workflow 1: Gene to Pathway Mapping

Use case: Finding pathways associated with genes of interest (e.g., for pathway enrichment analysis).

from scripts.kegg_api import kegg_find, kegg_link, kegg_get

# Step 1: Find gene ID by name
gene_results = kegg_find('genes', 'p53')

# Step 2: Link gene to pathways
pathways = kegg_link('pathway', 'hsa:7157')  # TP53 gene

# Step 3: Get detailed pathway information
for pathway_line in pathways.split('\n'):
    if pathway_line:
        pathway_id = pathway_line.split('\t')[1].replace('path:', '')
        pathway_info = kegg_get(pathway_id)
        # Process pathway information

Workflow 2: Pathway Enrichment Context

Use case: Getting all genes in organism pathways for enrichment analysis.

from scripts.kegg_api import kegg_list, kegg_link

# Step 1: List all human pathways
pathways = kegg_list('pathway', 'hsa')

# Step 2: For each pathway, get associated genes
for pathway_line in pathways.split('\n'):
    if pathway_line:
        pathway_id = pathway_line.split('\t')[0]
        genes = kegg_link('genes', pathway_id)
        # Process genes for enrichment analysis

Workflow 3: Compound to Pathway Analysis

Use case: Finding metabolic pathways containing compounds of interest.

from scripts.kegg_api import kegg_find, kegg_link, kegg_get

# Step 1: Search for compound
compound_results = kegg_find('compound', 'glucose')

# Step 2: Link compound to reactions
reactions = kegg_link('reaction', 'cpd:C00031')  # Glucose

# Step 3: Link reactions to pathways
pathways = kegg_link('pathway', 'rn:R00299')  # Specific reaction

# Step 4: Get pathway details
pathway_info = kegg_get('map00010')  # Glycolysis

Workflow 4: Cross-Database Integration

Use case: Integrating KEGG data with UniProt, NCBI, or PubChem databases.

from scripts.kegg_api import kegg_conv, kegg_get

# Step 1: Convert KEGG gene IDs to external database IDs
uniprot_map = kegg_conv('uniprot', 'hsa')
ncbi_map = kegg_conv('ncbi-geneid', 'hsa')

# Step 2: Parse conversion results
for line in uniprot_map.split('\n'):
    if line:
        kegg_id, uniprot_id = line.split('\t')
        # Use external IDs for integration

# Step 3: Get sequences using KEGG
sequence = kegg_get('hsa:10458', 'aaseq')

Workflow 5: Organism-Specific Pathway Analysis

Use case: Comparing pathways across different organisms.

from scripts.kegg_api import kegg_list, kegg_get

# Step 1: List pathways for multiple organisms
human_pathways = kegg_list('pathway', 'hsa')
mouse_pathways = kegg_list('pathway', 'mmu')
yeast_pathways = kegg_list('pathway', 'sce')

# Step 2: Get reference pathway for comparison
ref_pathway = kegg_get('map00010')  # Reference glycolysis

# Step 3: Get organism-specific versions
hsa_glycolysis = kegg_get('hsa00010')
mmu_glycolysis = kegg_get('mmu00010')

Pathway Categories

KEGG organizes pathways into seven major categories. When interpreting pathway IDs or recommending pathways to users:

  1. Metabolism (e.g., map00010 - Glycolysis, map00190 - Oxidative phosphorylation)
  2. Genetic Information Processing (e.g., map03010 - Ribosome, map03040 - Spliceosome)
  3. Environmental Information Processing (e.g., map04010 - MAPK signaling, map02010 - ABC transporters)
  4. Cellular Processes (e.g., map04140 - Autophagy, map04210 - Apoptosis)
  5. Organismal Systems (e.g., map04610 - Complement cascade, map04910 - Insulin signaling)
  6. Human Diseases (e.g., map05200 - Pathways in cancer, map05010 - Alzheimer disease)
  7. Drug Development (chronological and target-based classifications)

Reference references/kegg_reference.md for detailed pathway lists and classifications.

Important Identifiers and Formats

Pathway IDs

  • map##### - Reference pathway (generic, not organism-specific)
  • hsa##### - Human pathway
  • mmu##### - Mouse pathway

Gene IDs

  • Format: organism:gene_number (e.g., hsa:10458)

Compound IDs

  • Format: cpd:C##### (e.g., cpd:C00002 for ATP)

Drug IDs

  • Format: dr:D##### (e.g., dr:D00001)

Enzyme IDs

  • Format: ec:EC_number (e.g., ec:1.1.1.1)

KO (KEGG Orthology) IDs

  • Format: ko:K##### (e.g., ko:K00001)

API Limitations

Respect these constraints when using the KEGG API:

  1. Entry limits: Maximum 10 entries per operation (except image/kgml/json: 1 entry only)
  2. Academic use: API is for academic use only; commercial use requires licensing
  3. HTTP status codes: Check for 200 (success), 400 (bad request), 404 (not found)
  4. Rate limiting: No explicit limit, but avoid rapid-fire requests

Detailed Reference

For comprehensive API documentation, database specifications, organism codes, and advanced usage, refer to references/kegg_reference.md. This includes:

  • Complete list of KEGG databases
  • Detailed API operation syntax
  • All organism codes
  • HTTP status codes and error handling
  • Integration with Biopython and R/Bioconductor
  • Best practices for API usage

Troubleshooting

404 Not Found: Entry or database doesn't exist; verify IDs and organism codes 400 Bad Request: Syntax error in API call; check parameter formatting Empty results: Search term may not match entries; try broader keywords Image/KGML errors: These formats only work with single entries; remove batch processing

Additional Tools

For interactive pathway visualization and annotation:

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。