[ PROMPT_NODE_26274 ]
identifier_mapping
[ SKILL_DOCUMENTATION ]
# BioServices: 标识符映射指南
本文档提供了关于使用 BioServices 在不同生物数据库之间转换标识符的综合信息。
## 目录
1. [概述](#overview)
2. [UniProt 映射服务](#uniprot-mapping-service)
3. [UniChem 化合物映射](#unichem-compound-mapping)
4. [KEGG 标识符转换](#kegg-identifier-conversions)
5. [常见映射模式](#common-mapping-patterns)
6. [故障排除](#troubleshooting)
---
## 概述
生物数据库使用不同的标识符系统。交叉引用需要在这些系统之间进行映射。BioServices 提供了多种方法:
1. **UniProt 映射**:全面的蛋白质/基因 ID 转换
2. **UniChem**:化学化合物 ID 映射
3. **KEGG**:条目中内置的交叉引用
4. **PICR**:蛋白质标识符交叉引用服务
---
## UniProt 映射服务
UniProt 映射服务是用于蛋白质和基因标识符转换的最全面的工具。
### 基本用法
python
from bioservices import UniProt
u = UniProt()
# 映射单个 ID
result = u.mapping(
fr="UniProtKB_AC-ID", # 源数据库
to="KEGG", # 目标数据库
query="P43403" # 要转换的标识符
)
print(result)
# 输出: {'P43403': ['hsa:7535']}
### 批量映射
python
# 映射多个 ID (逗号分隔)
ids = ["P43403", "P04637", "P53779"]
result = u.mapping(
fr="UniProtKB_AC-ID",
to="KEGG",
query=",".join(ids)
)
for uniprot_id, kegg_ids in result.items():
print(f"{uniprot_id} → {kegg_ids}")
### 支持的数据库对
UniProt 支持 100 多种数据库对之间的映射。主要包括:
#### 蛋白质/基因数据库
| 源格式 | 代码 | 目标格式 | 代码 |
|---------------|------|---------------|------|
| UniProtKB AC/ID | `UniProtKB_AC-ID` | KEGG | `KEGG` |
| UniProtKB AC/ID | `UniProtKB_AC-ID` | Ensembl | `Ensembl` |
| UniProtKB AC/ID | `UniProtKB_AC-ID` | Ensembl Protein | `Ensembl_Protein` |
| UniProtKB AC/ID | `UniProtKB_AC-ID` | Ensembl Transcript | `Ensembl_Transcript` |
| UniProtKB AC/ID | `UniProtKB_AC-ID` | RefSeq Protein | `RefSeq_Protein` |
| UniProtKB AC/ID | `UniProtKB_AC-ID` | RefSeq Nucleotide | `RefSeq_Nucleotide` |
| UniProtKB AC/ID | `UniProtKB_AC-ID` | GeneID (Entrez) | `GeneID` |
| UniProtKB AC/ID | `UniProtKB_AC-ID` | HGNC | `HGNC` |
| UniProtKB AC/ID | `UniProtKB_AC-ID` | MGI | `MGI` |
| KEGG | `KEGG` | UniProtKB | `UniP