mcpField
A
alterlab-interpro

alterlab-interpro

github.com/alterlab-ieuデータ・データベース7867 回インストール5 週間前に更新
リポジトリ

alterlab-interpro について

alterlab-interproは、InterPro REST APIでタンパク質ファミリー、ドメイン、機能注釈を調べる研究者向けスキルです。バッチ検索やドメイン構成の分析にも対応します。

主な機能

  1. 01UniProtタンパク質のInterProエントリー検索
  2. 02エントリー詳細とマッチ位置の取得
  3. 03エントリー注釈タンパク質の検索
  4. 04GO用語のマッピング
  5. 05エントリーと分類群データの検索

活用シーン

  1. 01未知タンパク質の機能推定
  2. 02タンパク質ドメイン構成の比較
  3. 03タンパク質ファミリーのメンバー検索
  4. 04タンパク質へのGO用語マッピング

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/alterlab-ieu/alterlab-academic-skills --skill alterlab-interpro

インストール後、Claude Code で/alterlab-interproを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

evals/
evals.json
references/
domain_analysis.md
scripts/
query_interpro.py

詳細

InterPro データベース

概要

InterPro(https://www.ebi.ac.uk/interpro/)は、EMBL-EBI が維持管理する、タンパク質ファミリーとドメインの分類に関する包括的なリソースです。Pfam、PANTHER、PRINTS、ProSite、SMART、NCBIfam、SUPERFAMILY、CDD、Gene3D などのメンバーデータベース(下記のメンバーデータベースの表を参照)が提供する予測シグネチャーを統合し、エントリーの統一セットとしてまとめることで、UniProtKB 全体の機能アノテーションを一元的に確認できます。(従来の TIGRFAMs は NCBIfam に統合されました。)

InterPro はタンパク質を次のように分類します。

  • ファミリー:共通の祖先と機能を持つタンパク質のグループ
  • ドメイン:独立して折りたたまれる構造的・機能的単位
  • 相同スーパーファミリー:構造的に類似したタンパク質領域
  • リピート:短いタンデム配列
  • サイト:機能部位(活性部位、結合部位、PTM)

主なリソース:

スクリプト

scripts/query_interpro.py — InterPro REST API にクエリを実行します(標準ライブラリのみを使用し、JSON を標準出力に出力します)。

python scripts/query_interpro.py protein P04637          # InterPro entries for a UniProt protein
python scripts/query_interpro.py entry IPR000719         # entry details
python scripts/query_interpro.py entry-proteins IPR000719 --page-size 25   # proteins with an entry

このスキルを使用する場面

次の場合に InterPro を使用します。

  • タンパク質機能の予測:機能が不明なタンパク質は、どのような機能を持つと考えられますか?
  • ドメイン構成:タンパク質を構成するドメインとその順序はどのようなものですか?
  • タンパク質ファミリーの分類:タンパク質はどのファミリー/スーパーファミリーに属していますか?
  • GO 用語のアノテーション:InterPro を介してタンパク質配列を Gene Ontology 用語に対応付けます
  • 進化解析:2 つのタンパク質は同じ相同スーパーファミリーに属していますか?
  • 構造予測のコンテキスト:新しいタンパク質構造は、どのドメインと比較すべきですか?
  • パイプラインでのアノテーション:プロテオームや新規配列に対して一括でアノテーションを行います
使用しない場面
シナリオ代わりに使用
UniProt エントリー、FASTA 配列、ID マッピングの取得alterlab-uniprot
予測 3D モデルと pLDDT 信頼度alterlab-alphafold-db
実験構造、リガンド、分解能alterlab-pdb
タンパク質間相互作用ネットワークとエンリッチメントalterlab-string-db
データベースに対する配列類似性検索alterlab-blast

主な機能

1. InterPro REST API

ベース URL:https://www.ebi.ac.uk/interpro/api/

import requests

BASE_URL = "https://www.ebi.ac.uk/interpro/api"

def interpro_get(endpoint, params=None):
    url = f"{BASE_URL}/{endpoint}"
    headers = {"Accept": "application/json"}
    response = requests.get(url, params=params, headers=headers)
    response.raise_for_status()
    return response.json()

エンドポイントの方向に関する注意(まずお読みください)。 InterPro API では、パスの 最初の セグメントが返されるリソースの種類です。タンパク質のエントリーを一覧表示するには、タンパク質のフィルターを最後に指定します:entry/InterPro/protein/UniProt/{id}/。エントリーに属するタンパク質を一覧表示するには、タンパク質リソースを先頭に指定します:protein/UniProt/entry/InterPro/{id}/。逆の形式(protein/UniProt/{id}/entry/InterPro/、entry/InterPro/{id}/protein/UniProt/)では、results がなく count: null の *_url ラッパーだけが返されます。エラーではなく、何も返さずに終了します。

2. タンパク質の検索
def get_protein_entries(uniprot_id):
    """Get all InterPro entries that match a UniProt protein."""
    # Resource (entry) first, protein filter last — see direction gotcha above.
    data = interpro_get(f"entry/InterPro/protein/UniProt/{uniprot_id}/")
    return data

# Example: Human p53 (TP53)
result = get_protein_entries("P04637")
entries = result.get("results", [])

for entry in entries:
    meta = entry["metadata"]  # `name` is a string on this grouped endpoint
    print(f"  {meta['accession']} ({meta['type']}): {meta['name']}")
    # e.g., IPR002117 (family): p53 tumour suppressor family
    #       IPR011615 (domain): p53, DNA-binding domain
    #       IPR010991 (domain): p53, tetramerisation domain
3. 特定の InterPro エントリーの取得
def get_entry(interpro_id):
    """Fetch details for an InterPro entry."""
    return interpro_get(f"entry/InterPro/{interpro_id}/")

# Example: Get the InterPro entry the WW domain maps to
ww_entry = get_entry("IPR001202")
# On the single-entry detail endpoint, `name` is a dict {"name", "short"};
# on list/grouped endpoints it is a plain string. Handle both:
name = ww_entry["metadata"]["name"]
print(f"Name: {name['name'] if isinstance(name, dict) else name}")
print(f"Type: {ww_entry['metadata']['type']}")  # -> domain

# Member-database accessions resolve through the same endpoint shape.
# Use lowercase db names (entry/pfam/...); the response carries the
# integrated InterPro accession under metadata['integrated'].
def get_pfam_entry(pfam_id):
    return interpro_get(f"entry/pfam/{pfam_id}/")

pfam = get_pfam_entry("PF00397")  # metadata['integrated'] == 'IPR001202'
4. InterPro エントリーによるタンパク質の検索
def get_proteins_for_entry(interpro_id, database="UniProt", page_size=25):
    """Get all proteins annotated with an InterPro entry."""
    params = {"page_size": page_size}
    # Resource (protein) first, entry filter last — see direction gotcha above.
    data = interpro_get(f"protein/{database}/entry/InterPro/{interpro_id}/", params)
    return data

# Example: count proteins carrying the protein kinase domain
kinase_proteins = get_proteins_for_entry("IPR000719")  # Protein kinase domain
print(f"Total proteins: {kinase_proteins['count']}")  # response has count/next/results
5. ドメイン構成

残基ごとの一致位置は、単独の protein/UniProt/{id}/ レコードではなく、entry/protein grouped エンドポイントにあります(このレコードには metadata のみが含まれ、entries キーはありません)。各エントリーのヒットは results[].proteins[].entry_protein_locations[].fragments[] に格納されています。

def get_domain_architecture(uniprot_id):
    """Get the domain architecture of a protein with sequence positions."""
    data = interpro_get(f"entry/InterPro/protein/UniProt/{uniprot_id}/")

    arch = []
    for result in data.get("results", []):
        meta = result["metadata"]
        for prot in result.get("proteins", []):
            for loc in prot.get("entry_protein_locations", []):
                for frag in loc.get("fragments", []):
                    arch.append({
                        "accession": meta["accession"],
                        "type": meta["type"],
                        "name": meta["name"],
                        "start": frag["start"],
                        "end": frag["end"],
                    })
    # Order along the sequence to read off the architecture N->C terminus
    arch.sort(key=lambda d: d["start"])
    return arch

# Example: full domain architecture for EGFR, ordered along the sequence
for d in get_domain_architecture("P00533"):
    print(f"  {d['start']:>5}-{d['end']:<5} {d['accession']} ({d['type']}): {d['name']}")
6. GO 用語のマッピング

タンパク質レコードには、すべての InterPro シグネチャーから集約された GO 用語が metadata.go_terms に格納されています(重複排除済み)。そのため、エントリーごとにたどる必要はありません。

def get_go_terms_for_protein(uniprot_id):
    """Get GO terms associated with a protein via InterPro."""
    data = interpro_get(f"protein/UniProt/{uniprot_id}/")
    # NB: go_terms can be present but null for proteins with no GO mapping,
    # so coalesce to [] rather than relying on the dict default.
    return data.get("metadata", {}).get("go_terms") or []

# GO terms look like:
# {"identifier": "GO:0004672", "name": "protein kinase activity",
#  "category": {"code": "F", "name": "molecular_function"}}
# category.code is one of F (molecular_function), P (biological_process),
# C (cellular_component).

タンパク質全体ではなく特定のシグネチャーに GO 用語を対応付けるには、entry/InterPro/protein/UniProt/{id}/ から各エントリーの metadata.go_terms を読み取ります(各エントリーにはそれぞれの go_terms が含まれます)。

7. タンパク質の一括検索
def batch_lookup_proteins(uniprot_ids, database="UniProt"):
    """Look up multiple proteins and collect their InterPro entries."""
    import time
    results = {}
    for uid in uniprot_ids:
        try:
            data = interpro_get(f"entry/InterPro/protein/{database}/{uid}/")
            entries = data.get("results", [])
            results[uid] = [
                {
                    "accession": e["metadata"]["accession"],
                    "name": e["metadata"]["name"],
                    "type": e["metadata"]["type"]
                }
                for e in entries
            ]
        except Exception as e:
            results[uid] = {"error": str(e)}
        time.sleep(0.3)  # Rate limiting
    return results

# Example
proteins = ["P04637", "P00533", "P38398", "Q9Y6I9"]
domain_info = batch_lookup_proteins(proteins)
for uid, entries in domain_info.items():
    print(f"\n{uid}:")
    for e in entries[:3]:
        print(f"  - {e['accession']} ({e['type']}): {e['name']}")
8. テキストまたは分類群による検索
def search_entries(query, entry_type=None, taxonomy_id=None):
    """Search InterPro entries by text."""
    params = {"search": query, "page_size": 20}
    if entry_type:
        params["type"] = entry_type  # family, domain, homologous_superfamily, etc.

    endpoint = "entry/InterPro/"
    if taxonomy_id:
        # taxonomy is a filter, not the returned resource, so it can follow
        # the entry resource directly (lowercase 'uniprot' in the path).
        endpoint = f"entry/InterPro/taxonomy/uniprot/{taxonomy_id}/"

    return interpro_get(endpoint, params)

# Search for kinase-related entries
kinase_entries = search_entries("kinase", entry_type="domain")

クエリのワークフロー

ワークフロー 1:未知のタンパク質を特徴づける
  1. InterProScan を実行して、ローカルまたはウェブ(https://www.ebi.ac.uk/interpro/search/sequence/)でタンパク質配列をスキャンします
  2. 結果を解析してドメイン構成を特定します
  3. 各 InterPro エントリを調べて生物学的な背景情報を確認します
  4. 関連する InterPro エントリから GO 用語を取得して機能を推定します
# After running InterProScan and getting a UniProt ID:
def characterize_protein(uniprot_id):
    """Complete characterization workflow."""

    # 1. Get all annotations
    entries = get_protein_entries(uniprot_id)

    # 2. Group by type
    by_type = {}
    for e in entries.get("results", []):
        t = e["metadata"]["type"]
        by_type.setdefault(t, []).append({
            "accession": e["metadata"]["accession"],
            "name": e["metadata"]["name"]
        })

    # 3. Get GO terms
    go_terms = get_go_terms_for_protein(uniprot_id)

    return {
        "families": by_type.get("family", []),
        "domains": by_type.get("domain", []),
        "superfamilies": by_type.get("homologous_superfamily", []),
        "go_terms": go_terms
    }
ワークフロー 2:タンパク質ファミリーの全メンバーを見つける
  1. InterPro ファミリーのエントリ ID を特定します(例:タンパク質キナーゼの IPR000719)
  2. そのエントリがアノテーションされた UniProt タンパク質をすべて照会します
  3. 必要に応じて、生物種/分類で絞り込みます
  4. 系統解析用に FASTA 配列をダウンロードします
ワークフロー 3:ドメインを比較解析する
  1. 対象のタンパク質を収集します(例:すべてのパラログ)
  2. 各タンパク質のドメイン構成を取得します
  3. ドメインの構成と順序を比較します
  4. ドメインの獲得/喪失イベントを特定します

API エンドポイントの概要

返されるリソースの種類は、パスの先頭にあるものです。末尾のフィルターで範囲を絞り込みます。2 つの部分の順序を逆にすると、*_url のみを返すラッパーになります。

エンドポイント説明
/protein/UniProt/{id}/タンパク質の完全なアノテーション(metadata.go_terms を含む)
/entry/InterPro/protein/UniProt/{id}/タンパク質に含まれる InterPro エントリ(一致位置を含む)
/entry/InterPro/{id}/InterPro エントリの詳細(name は {name,short} の辞書)
/entry/pfam/{id}/Pfam メンバーデータベースのエントリ詳細(metadata.integrated = InterPro ID)
/protein/UniProt/entry/InterPro/{id}/エントリを持つタンパク質(ページネーション対応、count を含む)
/entry/InterPro/?search=...InterPro エントリの検索/一覧表示(ここでの name は文字列)
/entry/InterPro/taxonomy/uniprot/{tax_id}/ある分類群で確認された InterPro エントリ(ページネーション対応)
/structure/PDB/entry/InterPro/{id}/エントリにマッピングされた構造

メンバーデータベース

API が返すソースデータベース名(source_database フィールド/entry/{db}/... パス部分)は、異なる場合に括弧内に示します。

データベース対象
Pfam(pfam)タンパク質ドメイン(HMM プロファイル)
PANTHER(panther)タンパク質ファミリーとサブファミリー
PRINTS(prints)タンパク質フィンガープリント
ProSite パターン(prosite)アミノ酸パターン
ProSite プロファイル(profile)タンパク質プロファイルパターン
SMART(smart)可動性シグナル伝達/細胞外ドメイン
NCBIfam(ncbifam)NCBI がキュレーションしたファミリー(旧 TIGRFAMs を吸収)
SUPERFAMILY(ssf)SCOP 構造分類
CDD(cdd)保存ドメインデータベース(NCBI)
HAMAP(hamap)微生物タンパク質ファミリー
Gene3D(cathgene3d)CATH 構造分類
PIRSF(pirsf)PIR の全タンパク質ファミリー
SFLD(sfld)構造機能連関データベース(酵素)
AntiFam(antifam)偽 ORF フィルター(偽陽性の除去)

ベストプラクティス

  • UniProt アクセッション番号を使用してください(遺伝子名ではなく)。最も信頼性の高い検索結果が得られます
  • 種類を区別してください。family は広範な分類を示し、domain は特定の構造的/機能的単位を示します
  • 新規配列には InterProScan が高速です。UniProt に登録されていない配列は、ウェブサービスに送信してください
  • ページネーションを処理してください。大規模な結果セットでは、複数ページを順に取得する必要があります
  • UniProt データと組み合わせてください。InterPro エントリには、UniProt、PDB、GO へのリンクが含まれていることがよくあります

追加リソース

コメント