uniprot について
このスキルはUniProt REST APIをHTTPリクエストで利用し、タンパク質配列や注釈を取得します。エントリー検索、ドメインや変異の確認、PDBの相互参照が必要なワークフロー向けです。
主な機能
- 01FASTA配列とJSONエントリーの取得
- 02クエリと生物種による検索
- 03ドメイン注釈の取得
- 04天然変異とPDB参照の収集
活用シーン
- 01遺伝子名や名称からタンパク質エントリーを検索
- 02タンパク質のドメインと変異を確認
- 03エントリーに関連するPDB構造を特定
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ adaptyvbio/ protein-design-skills --skill uniprotインストール後、Claude Code で/uniprotを入力して読み込まれたか確認します。
詳細
UniProt データベースへのアクセス
注記:このスキルは UniProt REST API を直接使用します。Modal のデプロイは不要です。すべての操作は HTTP リクエストを介してローカルで実行されます。
配列の取得
アクセッション番号で取得
# FASTA format
curl "https://rest.uniprot.org/uniprotkb/P00533.fasta"
# JSON format with annotations
curl "https://rest.uniprot.org/uniprotkb/P00533.json"
Python を使用
import requests
def get_uniprot_sequence(accession):
"""Fetch sequence from UniProt."""
url = f"https://rest.uniprot.org/uniprotkb/{accession}.fasta"
response = requests.get(url)
if response.ok:
lines = response.text.strip().split('\n')
header = lines[0]
sequence = ''.join(lines[1:])
return header, sequence
return None, None
アノテーションの取得
エントリー全体
def get_uniprot_entry(accession):
"""Fetch full UniProt entry as JSON."""
url = f"https://rest.uniprot.org/uniprotkb/{accession}.json"
response = requests.get(url)
return response.json() if response.ok else None
entry = get_uniprot_entry("P00533")
print(f"Protein: {entry['proteinDescription']['recommendedName']['fullName']['value']}")
ドメインの境界
def get_domains(accession):
"""Extract domain annotations."""
entry = get_uniprot_entry(accession)
domains = []
for feature in entry.get('features', []):
if feature['type'] == 'Domain':
domains.append({
'name': feature.get('description', ''),
'start': feature['location']['start']['value'],
'end': feature['location']['end']['value']
})
return domains
# Example: EGFR domains
domains = get_domains("P00533")
# [{'name': 'Kinase', 'start': 712, 'end': 979}, ...]
UniProt の検索
遺伝子名で検索
def search_uniprot(query, organism=None, limit=10):
"""Search UniProt by query."""
url = "https://rest.uniprot.org/uniprotkb/search"
params = {
"query": query,
"format": "json",
"size": limit
}
if organism:
params["query"] += f" AND organism_id:{organism}"
response = requests.get(url, params=params)
return response.json()['results']
# Search for human EGFR
results = search_uniprot("EGFR", organism=9606)
配列類似性で検索(BLAST)
# Use UniProt BLAST
# https://www.uniprot.org/blast
相互参照
PDB 構造の取得
def get_pdb_references(accession):
"""Get PDB structures for UniProt entry."""
entry = get_uniprot_entry(accession)
pdbs = []
for xref in entry.get('uniProtKBCrossReferences', []):
if xref['database'] == 'PDB':
pdbs.append({
'pdb_id': xref['id'],
'method': xref.get('properties', [{}])[0].get('value', ''),
'chains': xref.get('properties', [{}])[1].get('value', '')
})
return pdbs
# Example: PDB structures for EGFR
pdbs = get_pdb_references("P00533")
よくあるユースケース
ターゲットの選定
# 1. Find protein by name
results = search_uniprot("insulin receptor", organism=9606)
# 2. Get accession
accession = results[0]['primaryAccession'] # e.g., P06213
# 3. Get domains
domains = get_domains(accession)
# 4. Find PDB structure
pdbs = get_pdb_references(accession)
# 5. Download best structure for design
配列アラインメント情報
def get_sequence_variants(accession):
"""Get natural variants from UniProt."""
entry = get_uniprot_entry(accession)
variants = []
for feature in entry.get('features', []):
if feature['type'] == 'Natural variant':
variants.append({
'position': feature['location']['start']['value'],
'original': feature.get('alternativeSequence', {}).get('originalSequence', ''),
'variant': feature.get('alternativeSequence', {}).get('alternativeSequences', [''])[0],
'description': feature.get('description', '')
})
return variants
API リファレンス
| エンドポイント | 説明 |
|---|---|
/uniprotkb/{id}.fasta | FASTA 配列 |
/uniprotkb/{id}.json | エントリー全体の JSON |
/uniprotkb/search | エントリーの検索 |
/uniprotkb/stream | 一括ダウンロード |
トラブルシューティング
エントリーが見つからない場合:アクセッション番号の形式を確認してください(例:P00533) レート制限:リクエストの間隔を空けてください 大容量のダウンロード:ページネーションを使って stream エンドポイントを使用してください
次へ:配列を esm とともに使用して埋め込みを生成するか、chai / boltz を使用して構造を生成します。
コメント
Markdown 対応