[ PROMPT_NODE_26974 ]
Pdb Database API 参考
[ SKILL_DOCUMENTATION ]
# RCSB PDB API 参考
本文档提供了有关 RCSB 蛋白质数据库 (Protein Data Bank) API 的详细信息,包括高级使用模式、数据模式和最佳实践。
## API 概览
RCSB PDB 提供了多种编程接口:
1. **Data API** - 当您拥有标识符时检索 PDB 数据
2. **Search API** - 查找符合特定搜索条件的标识符
3. **ModelServer API** - 访问大分子模型子集
4. **VolumeServer API** - 检索体积数据子集
5. **Sequence Coordinates API** - 获取结构数据库与序列数据库之间的比对
6. **Alignment API** - 执行结构比对计算
## Data API
### 核心数据对象
Data API 按层级组织信息:
- **core_entry**: PDB 条目或计算结构模型 (CSM ID 以 AF_ 或 MA_ 开头)
- **core_polymer_entity**: 蛋白质、DNA 和 RNA 实体
- **core_nonpolymer_entity**: 配体、辅因子、离子
- **core_branched_entity**: 寡糖
- **core_assembly**: 生物组装体
- **core_polymer_entity_instance**: 单个链
- **core_chem_comp**: 化学组件
### REST API 端点
基础 URL: `https://data.rcsb.org/rest/v1/`
**条目数据:**
GET https://data.rcsb.org/rest/v1/core/entry/{entry_id}
**聚合物实体:**
GET https://data.rcsb.org/rest/v1/core/polymer_entity/{entry_id}_{entity_id}
**组装体:**
GET https://data.rcsb.org/rest/v1/core/assembly/{entry_id}/{assembly_id}
**示例:**
bash
# 获取血红蛋白的条目数据
curl https://data.rcsb.org/rest/v1/core/entry/4HHB
# 获取第一个聚合物实体
curl https://data.rcsb.org/rest/v1/core/polymer_entity/4HHB_1
# 获取生物组装体 1
curl https://data.rcsb.org/rest/v1/core/assembly/4HHB/1
### GraphQL API
端点: `https://data.rcsb.org/graphql`
GraphQL API 支持灵活的数据检索,允许您在单个查询中从层级的任何级别获取任何数据片段。
**查询示例:**
graphql
{
entry(entry_id: "4HHB") {
struct {
title
}
exptl {
method
}
rcsb_entry_info {
resolution_combined
deposited_atom_count
polymer_entity_count
}
rcsb_accession_info {
deposit_date
initial_release_date
}
}
}
**Python 示例:**
python
import requests
query = """
{
polymer_entity(entity_id: "4HHB_1") {
rcsb_polymer_entity {
pdbx_description
formula_weight
}
entity_poly {
pdbx