关于 interpro-database
interpro-database 是一项通过 InterPro REST API 查询蛋白质分类与注释资源的技能,面向生物信息学工作流。它涵盖蛋白质功能分析、条目检索、结构域架构查询及 GO 术语映射。
主要功能
- 01查询蛋白质注释
- 02获取 InterPro 条目详情
- 03按条目搜索蛋白质
- 04查看结构域架构
- 05映射蛋白质 GO 术语
- 06批量查询蛋白质
适用场景
- 01分析尚未注释的蛋白质
- 02查找某蛋白质家族成员
- 03比较蛋白质结构域排列
- 04批量注释蛋白质序列
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ leonchaox/ qinyan-academic-skills --skill interpro-database安装后在 Claude Code 中输入/interpro-database确认已加载。
附带文件references/domain_analysis.md
详细介绍
InterPro 数据库
概述
InterPro(https://www.ebi.ac.uk/interpro/)是由 EMBL-EBI 维护的综合性蛋白质家族和结构域分类资源。它整合了 13 个成员数据库中的特征签名,包括 Pfam、PANTHER、PRINTS、ProSite、SMART、TIGRFAM、SUPERFAMILY、CDD 等,为超过 1 亿条蛋白质序列提供统一的功能注释视图。
InterPro 将蛋白质分类为:
- 家族:具有共同祖先和功能的蛋白质组
- 结构域:可独立折叠的结构/功能单元
- 同源超家族:结构相似的蛋白质区域
- 重复序列:短串联序列
- 位点:功能位点(活性、结合、PTM)
主要资源:
- InterPro 网站:https://www.ebi.ac.uk/interpro/
- REST API:https://www.ebi.ac.uk/interpro/api/
- API 文档:https://github.com/ProteinsWebTeam/interpro7-api/blob/master/docs/
- Python 客户端:通过
requests
何时使用此技能
以下情况可使用 InterPro:
- 蛋白质功能预测:一个未经表征的蛋白质可能具有哪些功能?
- 结构域架构:蛋白质由哪些结构域组成,排列顺序如何?
- 蛋白质家族分类:蛋白质属于哪个家族/超家族?
- GO 术语注释:通过 InterPro 将蛋白质序列映射到 Gene Ontology 术语
- 进化分析:两个蛋白质是否属于同一个同源超家族?
- 结构预测背景:新的蛋白质结构应与哪些结构域进行比较?
- 流程注释:批量注释蛋白质组或新序列
核心功能
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()
2. 查询蛋白质
def get_protein_entries(uniprot_id):
"""Get all InterPro entries that match a UniProt protein."""
data = interpro_get(f"protein/UniProt/{uniprot_id}/entry/InterPro/")
return data
# Example: Human p53 (TP53)
result = get_protein_entries("P04637")
entries = result.get("results", [])
for entry in entries:
meta = entry["metadata"]
print(f" {meta['accession']} ({meta['type']}): {meta['name']}")
# e.g., IPR011615 (domain): p53, tetramerisation domain
# IPR010991 (domain): p53, DNA-binding domain
# IPR013872 (family): p53 family
3. 获取特定的 InterPro 条目
def get_entry(interpro_id):
"""Fetch details for an InterPro entry."""
return interpro_get(f"entry/InterPro/{interpro_id}/")
# Example: Get Pfam domain PF00397 (WW domain)
ww_entry = get_entry("IPR001202")
print(f"Name: {ww_entry['metadata']['name']}")
print(f"Type: {ww_entry['metadata']['type']}")
# Also supports member database IDs:
def get_pfam_entry(pfam_id):
return interpro_get(f"entry/Pfam/{pfam_id}/")
pfam = get_pfam_entry("PF00397")
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}
data = interpro_get(f"entry/InterPro/{interpro_id}/protein/{database}/", params)
return data
# Example: Find all human kinase-domain proteins
kinase_proteins = get_proteins_for_entry("IPR000719") # Protein kinase domain
print(f"Total proteins: {kinase_proteins['count']}")
5. 结构域架构
def get_domain_architecture(uniprot_id):
"""Get the complete domain architecture of a protein."""
data = interpro_get(f"protein/UniProt/{uniprot_id}/")
return data
# Example: Get full domain architecture for EGFR
egfr = get_domain_architecture("P00533")
# The response includes locations of all matching entries on the sequence
for entry in egfr.get("entries", []):
for fragment in entry.get("entry_protein_locations", []):
for loc in fragment.get("fragments", []):
print(f" {entry['accession']}: {loc['start']}-{loc['end']}")
6. GO 术语映射
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}/")
# GO terms are embedded in the entry metadata
go_terms = []
for entry in data.get("entries", []):
go = entry.get("metadata", {}).get("go_terms", [])
go_terms.extend(go)
# Deduplicate
seen = set()
unique_go = []
for term in go_terms:
if term["identifier"] not in seen:
seen.add(term["identifier"])
unique_go.append(term)
return unique_go
# GO terms include:
# {"identifier": "GO:0004672", "name": "protein kinase activity", "category": {"code": "F", "name": "Molecular Function"}}
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"protein/{database}/{uid}/entry/InterPro/")
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:
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:表征未知蛋白质
- 在本地或通过网页(https://www.ebi.ac.uk/interpro/search/sequence/)运行 InterProScan,扫描蛋白质序列
- 解析结果,识别结构域架构
- 查询每个 InterPro 条目,了解其生物学背景
- 从相关 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:查找蛋白质家族的所有成员
- 确定 InterPro 家族条目 ID(例如,蛋白激酶对应 IPR000719)
- 查询所有带有该条目标注的 UniProt 蛋白质
- 根据需要按生物体/分类单元筛选
- 下载 FASTA 序列,用于系统发育分析
工作流 3:比较结构域分析
- 收集感兴趣的蛋白质(例如,所有旁系同源蛋白)
- 获取每个蛋白质的结构域架构
- 比较结构域组成和排列顺序
- 识别结构域获得/丢失事件
API 端点摘要
| 端点 | 描述 |
|---|---|
/protein/UniProt/{id}/ | 蛋白质的完整注释 |
/protein/UniProt/{id}/entry/InterPro/ | 蛋白质对应的 InterPro 条目 |
/entry/InterPro/{id}/ | InterPro 条目的详细信息 |
/entry/Pfam/{id}/ | Pfam 条目详细信息 |
/entry/InterPro/{id}/protein/UniProt/ | 带有该条目的蛋白质 |
/entry/InterPro/ | 搜索/列出 InterPro 条目 |
/taxonomy/UniProt/{tax_id}/ | 来自某分类单元的蛋白质 |
/structure/PDB/{pdb_id}/ | 映射到 InterPro 的结构 |
成员数据库
| 数据库 | 重点 |
|---|---|
| Pfam | 蛋白质结构域(HMM 配置文件) |
| PANTHER | 蛋白质家族和亚家族 |
| PRINTS | 蛋白质指纹 |
| ProSitePatterns | 氨基酸模式 |
| ProSiteProfiles | 蛋白质配置文件模式 |
| SMART | 蛋白质结构域分析 |
| TIGRFAM | JCVI 精选的蛋白质家族 |
| SUPERFAMILY | 结构分类 |
| CDD | 保守结构域数据库(NCBI) |
| HAMAP | 微生物蛋白质家族 |
| NCBIfam | NCBI 精选的 TIGRFAM |
| Gene3D | CATH 结构分类 |
| PIRSR | PIR 位点规则 |
最佳实践
- 使用 UniProt 登录号(而非基因名称),以获得最可靠的查询结果
- 区分类型:
family提供广泛分类;domain提供具体的结构/功能单元 - 新序列使用 InterProScan 更快:对于 UniProt 中没有的序列,请提交至 Web 服务
- 处理分页:大型结果集需要逐页遍历
- 结合 UniProt 数据使用:InterPro 条目通常包含指向 UniProt、PDB 和 GO 的链接
更多资源
- InterPro 网站:https://www.ebi.ac.uk/interpro/
- InterProScan(本地运行):https://github.com/ebi-pf-team/interproscan
- API 文档:https://github.com/ProteinsWebTeam/interpro7-api/blob/master/docs/
- Pfam:https://www.ebi.ac.uk/interpro/entry/pfam/
- 引用文献:Paysan-Lafosse T et al.(2023)Nucleic Acids Research。PMID: 36350672
评论
支持 Markdown