jpskill.com
🛠️ 開発・MCP コミュニティ

ensembl-database

Query Ensembl genome database REST API for 250+ species. Gene lookups, sequence retrieval, variant analysis, comparative genomics, orthologs, VEP predictions, for genomic research.

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

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

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

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

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して ensembl-database.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → ensembl-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 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Ensemblデータベース

概要

EMBL-EBIによって維持されている、脊椎動物ゲノムデータの包括的なリソースであるEnsemblゲノムデータベースにアクセスし、クエリを実行します。このデータベースは、250種以上の生物について、遺伝子アノテーション、配列、バリアント、調節情報、および比較ゲノミクスデータを提供します。現在のリリースは115(2025年9月)です。

このSkillを使用するタイミング

このSkillは、以下の場合に使用する必要があります。

  • シンボルまたはEnsembl IDで遺伝子情報をクエリする場合
  • DNA、トランスクリプト、またはタンパク質配列を取得する場合
  • Variant Effect Predictor (VEP)を使用して遺伝的バリアントを分析する場合
  • 種間でオーソログおよびパラログを検索する場合
  • 調節機能およびゲノムアノテーションにアクセスする場合
  • ゲノムアセンブリ間で座標を変換する場合(例:GRCh37からGRCh38)
  • 比較ゲノミクス分析を実行する場合
  • Ensemblデータをゲノム研究パイプラインに統合する場合

主要な機能

1. 遺伝子情報検索

シンボル、Ensembl ID、または外部データベース識別子で遺伝子データをクエリします。

一般的な操作:

  • シンボルで遺伝子情報を検索する(例:"BRCA2"、"TP53")
  • トランスクリプトおよびタンパク質情報を取得する
  • 遺伝子座標および染色体位置を取得する
  • 外部データベース(UniProt、RefSeqなど)へのクロスリファレンスにアクセスする

ensembl_restパッケージの使用:

from ensembl_rest import EnsemblClient

client = EnsemblClient()

# シンボルで遺伝子を検索
gene_data = client.symbol_lookup(
    species='human',
    symbol='BRCA2'
)

# 詳細な遺伝子情報を取得
gene_info = client.lookup_id(
    id='ENSG00000139618',  # BRCA2 Ensembl ID
    expand=True
)

直接REST API (パッケージなし):

import requests

server = "https://rest.ensembl.org"

# シンボル検索
response = requests.get(
    f"{server}/lookup/symbol/homo_sapiens/BRCA2",
    headers={"Content-Type": "application/json"}
)
gene_data = response.json()

2. 配列検索

ゲノム、トランスクリプト、またはタンパク質配列をさまざまな形式(JSON、FASTA、プレーンテキスト)で取得します。

操作:

  • 遺伝子またはゲノム領域のDNA配列を取得する
  • トランスクリプト配列(cDNA)を取得する
  • タンパク質配列にアクセスする
  • フランキング領域または修飾を含む配列を抽出する

例:

# ensembl_restパッケージの使用
sequence = client.sequence_id(
    id='ENSG00000139618',  # 遺伝子ID
    content_type='application/json'
)

# ゲノム領域の配列を取得
region_seq = client.sequence_region(
    species='human',
    region='7:140424943-140624564'  # chromosome:start-end
)

3. バリアント解析

遺伝的バリアントデータをクエリし、Variant Effect Predictor (VEP)を使用してバリアントの結果を予測します。

機能:

  • rsIDまたはゲノム座標でバリアントを検索する
  • バリアントの機能的結果を予測する
  • 集団頻度データにアクセスする
  • 表現型関連性を取得する

VEPの例:

# バリアントの結果を予測
vep_result = client.vep_hgvs(
    species='human',
    hgvs_notation='ENST00000380152.7:c.803C>T'
)

# rsIDでバリアントをクエリ
variant = client.variation_id(
    species='human',
    id='rs699'
)

4. 比較ゲノミクス

種間比較を実行して、オーソログ、パラログ、および進化的関係を特定します。

操作:

  • オーソログ(異なる種における同じ遺伝子)を検索する
  • パラログ(同じ種における関連遺伝子)を特定する
  • 進化的関係を示す遺伝子ツリーにアクセスする
  • 遺伝子ファミリー情報を取得する

例:

# ヒト遺伝子のオーソログを検索
orthologs = client.homology_ensemblgene(
    id='ENSG00000139618',  # ヒトBRCA2
    target_species='mouse'
)

# 遺伝子ツリーを取得
gene_tree = client.genetree_member_symbol(
    species='human',
    symbol='BRCA2'
)

5. ゲノム領域解析

特定の領域内のすべてのゲノム機能(遺伝子、トランスクリプト、調節要素)を検索します。

ユースケース:

  • 染色体領域内のすべての遺伝子を特定する
  • 調節機能(プロモーター、エンハンサー)を検索する
  • 領域内のバリアントを特定する
  • 構造的特徴を取得する

例:

# 領域内のすべての機能を検索
features = client.overlap_region(
    species='human',
    region='7:140424943-140624564',
    feature='gene'
)

6. アセンブリマッピング

異なるゲノムアセンブリ間で座標を変換します(例:GRCh37からGRCh38)。

重要: GRCh37/hg19クエリにはhttps://grch37.rest.ensembl.orgを使用し、現在のアセンブリにはhttps://rest.ensembl.orgを使用してください。

例:

from ensembl_rest import AssemblyMapper

# GRCh37からGRCh38への座標のマッピング
mapper = AssemblyMapper(
    species='human',
    asm_from='GRCh37',
    asm_to='GRCh38'
)

mapped = mapper.map(chrom='7', start=140453136, end=140453136)

APIのベストプラクティス

レート制限

Ensembl REST APIにはレート制限があります。以下のプラクティスに従ってください。

  1. レート制限を尊重する: 匿名ユーザーの場合、1秒あたり最大15リクエスト
  2. 429レスポンスを処理する: レート制限された場合は、Retry-Afterヘッダーを確認して待機する
  3. バッチエンドポイントを使用する: 複数のアイテムをクエリする場合は、可能な場合はバッチエンドポイントを使用する
  4. 結果をキャッシュする: 頻繁にアクセスされるデータを保存して、API呼び出しを減らす

エラー処理

常に適切なエラー処理を実装してください。

import requests
import time

def query_ensembl(endpoint, params=None, max_retries=3):
    server = "https://rest.ensembl.org"
    headers = {"Content-Type": "application/json"}

    for attempt in range(max_retries):
        response = requests.get(
            f"{server}{endpoint}",
            headers=headers,
            params=params
        )

        if response.status_code == 200:
            return response.json()
        elif response.status_code == 429:
            # レート制限 - 待機して再試行
            retry_after = int(response.headers.get('Retry-After', 1))
            time.sleep(retry_after)
        else:
            response.raise_for_status()

    raise Exception(f"Failed after {max_retries} attempts")

インストール

Pythonパッケージ(推奨)

uv pip install ensembl_rest

`ensembl_re

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Ensembl Database

Overview

Access and query the Ensembl genome database, a comprehensive resource for vertebrate genomic data maintained by EMBL-EBI. The database provides gene annotations, sequences, variants, regulatory information, and comparative genomics data for over 250 species. Current release is 115 (September 2025).

When to Use This Skill

This skill should be used when:

  • Querying gene information by symbol or Ensembl ID
  • Retrieving DNA, transcript, or protein sequences
  • Analyzing genetic variants using the Variant Effect Predictor (VEP)
  • Finding orthologs and paralogs across species
  • Accessing regulatory features and genomic annotations
  • Converting coordinates between genome assemblies (e.g., GRCh37 to GRCh38)
  • Performing comparative genomics analyses
  • Integrating Ensembl data into genomic research pipelines

Core Capabilities

1. Gene Information Retrieval

Query gene data by symbol, Ensembl ID, or external database identifiers.

Common operations:

  • Look up gene information by symbol (e.g., "BRCA2", "TP53")
  • Retrieve transcript and protein information
  • Get gene coordinates and chromosomal locations
  • Access cross-references to external databases (UniProt, RefSeq, etc.)

Using the ensembl_rest package:

from ensembl_rest import EnsemblClient

client = EnsemblClient()

# Look up gene by symbol
gene_data = client.symbol_lookup(
    species='human',
    symbol='BRCA2'
)

# Get detailed gene information
gene_info = client.lookup_id(
    id='ENSG00000139618',  # BRCA2 Ensembl ID
    expand=True
)

Direct REST API (no package):

import requests

server = "https://rest.ensembl.org"

# Symbol lookup
response = requests.get(
    f"{server}/lookup/symbol/homo_sapiens/BRCA2",
    headers={"Content-Type": "application/json"}
)
gene_data = response.json()

2. Sequence Retrieval

Fetch genomic, transcript, or protein sequences in various formats (JSON, FASTA, plain text).

Operations:

  • Get DNA sequences for genes or genomic regions
  • Retrieve transcript sequences (cDNA)
  • Access protein sequences
  • Extract sequences with flanking regions or modifications

Example:

# Using ensembl_rest package
sequence = client.sequence_id(
    id='ENSG00000139618',  # Gene ID
    content_type='application/json'
)

# Get sequence for a genomic region
region_seq = client.sequence_region(
    species='human',
    region='7:140424943-140624564'  # chromosome:start-end
)

3. Variant Analysis

Query genetic variation data and predict variant consequences using the Variant Effect Predictor (VEP).

Capabilities:

  • Look up variants by rsID or genomic coordinates
  • Predict functional consequences of variants
  • Access population frequency data
  • Retrieve phenotype associations

VEP example:

# Predict variant consequences
vep_result = client.vep_hgvs(
    species='human',
    hgvs_notation='ENST00000380152.7:c.803C>T'
)

# Query variant by rsID
variant = client.variation_id(
    species='human',
    id='rs699'
)

4. Comparative Genomics

Perform cross-species comparisons to identify orthologs, paralogs, and evolutionary relationships.

Operations:

  • Find orthologs (same gene in different species)
  • Identify paralogs (related genes in same species)
  • Access gene trees showing evolutionary relationships
  • Retrieve gene family information

Example:

# Find orthologs for a human gene
orthologs = client.homology_ensemblgene(
    id='ENSG00000139618',  # Human BRCA2
    target_species='mouse'
)

# Get gene tree
gene_tree = client.genetree_member_symbol(
    species='human',
    symbol='BRCA2'
)

5. Genomic Region Analysis

Find all genomic features (genes, transcripts, regulatory elements) in a specific region.

Use cases:

  • Identify all genes in a chromosomal region
  • Find regulatory features (promoters, enhancers)
  • Locate variants within a region
  • Retrieve structural features

Example:

# Find all features in a region
features = client.overlap_region(
    species='human',
    region='7:140424943-140624564',
    feature='gene'
)

6. Assembly Mapping

Convert coordinates between different genome assemblies (e.g., GRCh37 to GRCh38).

Important: Use https://grch37.rest.ensembl.org for GRCh37/hg19 queries and https://rest.ensembl.org for current assemblies.

Example:

from ensembl_rest import AssemblyMapper

# Map coordinates from GRCh37 to GRCh38
mapper = AssemblyMapper(
    species='human',
    asm_from='GRCh37',
    asm_to='GRCh38'
)

mapped = mapper.map(chrom='7', start=140453136, end=140453136)

API Best Practices

Rate Limiting

The Ensembl REST API has rate limits. Follow these practices:

  1. Respect rate limits: Maximum 15 requests per second for anonymous users
  2. Handle 429 responses: When rate-limited, check the Retry-After header and wait
  3. Use batch endpoints: When querying multiple items, use batch endpoints where available
  4. Cache results: Store frequently accessed data to reduce API calls

Error Handling

Always implement proper error handling:

import requests
import time

def query_ensembl(endpoint, params=None, max_retries=3):
    server = "https://rest.ensembl.org"
    headers = {"Content-Type": "application/json"}

    for attempt in range(max_retries):
        response = requests.get(
            f"{server}{endpoint}",
            headers=headers,
            params=params
        )

        if response.status_code == 200:
            return response.json()
        elif response.status_code == 429:
            # Rate limited - wait and retry
            retry_after = int(response.headers.get('Retry-After', 1))
            time.sleep(retry_after)
        else:
            response.raise_for_status()

    raise Exception(f"Failed after {max_retries} attempts")

Installation

Python Package (Recommended)

uv pip install ensembl_rest

The ensembl_rest package provides a Pythonic interface to all Ensembl REST API endpoints.

Direct REST API

No installation needed - use standard HTTP libraries like requests:

uv pip install requests

Resources

references/

  • api_endpoints.md: Comprehensive documentation of all 17 API endpoint categories with examples and parameters

scripts/

  • ensembl_query.py: Reusable Python script for common Ensembl queries with built-in rate limiting and error handling

Common Workflows

Workflow 1: Gene Annotation Pipeline

  1. Look up gene by symbol to get Ensembl ID
  2. Retrieve transcript information
  3. Get protein sequences for all transcripts
  4. Find orthologs in other species
  5. Export results

Workflow 2: Variant Analysis

  1. Query variant by rsID or coordinates
  2. Use VEP to predict functional consequences
  3. Check population frequencies
  4. Retrieve phenotype associations
  5. Generate report

Workflow 3: Comparative Analysis

  1. Start with gene of interest in reference species
  2. Find orthologs in target species
  3. Retrieve sequences for all orthologs
  4. Compare gene structures and features
  5. Analyze evolutionary conservation

Species and Assembly Information

To query available species and assemblies:

# List all available species
species_list = client.info_species()

# Get assembly information for a species
assembly_info = client.info_assembly(species='human')

Common species identifiers:

  • Human: homo_sapiens or human
  • Mouse: mus_musculus or mouse
  • Zebrafish: danio_rerio or zebrafish
  • Fruit fly: drosophila_melanogaster

Additional Resources

同梱ファイル

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