# SDF（文件格式）

**SDF**（Structure-Data File，结构数据文件，也写作SDfile，扩展名为.sdf或.sd）是一种纯文本化学文件格式，用于存储一个或多个分子结构记录及其任意关联数据字段。它由分子设计有限公司（Molecular Design Limited，MDL）开发，是其CTfile（化学表格文件）家族的一部分，并成为化学信息学中小分子数据集事实上的交换格式。<sup>[1](https://depth-first.com/articles/2020/07/13/the-sdfile-format/)</sup><sup> • </sup><sup>[2](https://graphinout.com/format/sdf-structure-data-file)</sup> 不应将其与语义定义格式（Semantic Definition Format，RFC 9880）混淆，后者是互联网工程任务组（IETF）用于描述物联网设备数据与交互的无关格式。<sup>[3](https://www.rfc-editor.org/rfc/rfc9880.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 全称 | 结构数据文件（Structure-Data File，SDfile、SD File、SDF）；扩展名.sdf和.sd<sup>[1](https://depth-first.com/articles/2020/07/13/the-sdfile-format/)</sup><sup> • </sup><sup>[4](https://reference.wolfram.com/language/ref/format/SDF.html)</sup> |
| 起源 | 由分子设计有限公司（MDL）于20世纪80年代作为CTfile家族的一部分开发并发布<sup>[2](https://graphinout.com/format/sdf-structure-data-file)</sup><sup> • </sup><sup>[5](https://publications.jrc.ec.europa.eu/repository/bitstream/JRC107492/kjna28708enn.pdf)</sup> |
| 当前维护方 | 在MDL历经Symyx Technologies和Accelrys之后，规范由达索系统（Dassault Systèmes）子公司BIOVIA维护<sup>[2](https://graphinout.com/format/sdf-structure-data-file)</sup> |
| 记录分隔符 | 恰好包含四个美元符号（$$$$）的一行用于分隔记录<sup>[2](https://graphinout.com/format/sdf-structure-data-file)</sup> |
| 结构编码 | 每条记录包含一个V2000或V3000 molfile连接表，以M  END结尾<sup>[1](https://depth-first.com/articles/2020/07/13/the-sdfile-format/)</sup> |
| 数据字段 | 由以>开头的标题行和尖括号中的字段名引入的标记属性-值对<sup>[1](https://depth-first.com/articles/2020/07/13/the-sdfile-format/)</sup> |
| MIME类型 | chemical/x-mdl-sdfile<sup>[1](https://depth-first.com/articles/2020/07/13/the-sdfile-format/)</sup> |
| 典型用户 | PubChem、ChemSpider、ChEBI、筛选化合物库以及FDA药物主文件提交<sup>[6](https://pmc.ncbi.nlm.nih.gov/articles/PMC6226248/)</sup><sup> • </sup><sup>[7](https://www.fda.gov/media/151718/download)</sup> |

## 起源与规范

MDL Information Systems于20世纪80年代创建了CTfile家族，用于表示和传递化学信息，并发布了一份技术规范，其标题始终包含“CTfile Formats”字样。<sup>[2](https://graphinout.com/format/sdf-structure-data-file)</sup><sup> • </sup><sup>[8](https://mdli.com/downloads/literature/ctfile.pdf)</sup> 该公司后更名为MDL Information Systems，随后被Symyx Technologies收购，规范谱系最终传至达索系统子公司BIOVIA。<sup>[5](https://publications.jrc.ec.europa.eu/repository/bitstream/JRC107492/kjna28708enn.pdf)</sup><sup> • </sup><sup>[2](https://graphinout.com/format/sdf-structure-data-file)</sup> 这段历史解释了为何该格式至今仍与MDL相关联，包括其MIME类型。<sup>[1](https://depth-first.com/articles/2020/07/13/the-sdfile-format/)</sup>

在CTfile家族中，molfile描述单个分子结构，RGfile描述带R基团的查询，rxnfile描述反应，而SDfile包含任意数量分子的结构和数据。与RDfiles一起，SDfiles是MDL数据库之间大规模数据传输的主要格式。<sup>[8](https://mdli.com/downloads/literature/ctfile.pdf)</sup> 一个只含单个分子且无数据字段的SDF，逐字节而言，就是一个追加了$$$$的molfile。<sup>[9](https://academy.optersoft.com/bio/molecule/sdf)</sup>

## 文件结构

SDF文件是记录的串联，每条记录以恰好包含四个美元符号（$$$$）的一行结尾。<sup>[2](https://graphinout.com/format/sdf-structure-data-file)</sup> 每条记录以普通MDL molfile开头：三行标题（分子名称、程序/时间戳/维度行以及自由文本注释），随后是计数行和连接表（Ctab）。<sup>[2](https://graphinout.com/format/sdf-structure-data-file)</sup> 在较旧的V2000变体中，计数行将原子和键总数压缩到三字符固定列中；每条原子行包含以埃为单位的x、y、z坐标、元素符号，以及涵盖电荷、质量差和立体奇偶性的条目；每条键行以从1开始的编号标识两个原子，并给出类型——单键、双键、三键或芳香键。<sup>[2](https://graphinout.com/format/sdf-structure-data-file)</sup> 结构部分以M  END行结束，可使用V2000或V3000 molfile格式。<sup>[1](https://depth-first.com/articles/2020/07/13/the-sdfile-format/)</sup>

**数据项。** 结构之后，记录可携带零个或多个数据项，每项由数据标题、零个或多个数据行以及一个空白终止行组成。数据标题以大于号（>）开头，必须包含尖括号中的字段名或字段编号；字段名不得包含空格、连字符、句点、等号、百分号或尖括号。<sup>[1](https://depth-first.com/articles/2020/07/13/the-sdfile-format/)</sup> 以下示例记录展示了这一模式：<sup>[5](https://publications.jrc.ec.europa.eu/repository/bitstream/JRC107492/kjna28708enn.pdf)</sup>

```
> <ClogP>
5.825
> <Vendor>
Sigma
> <Molecular Weight>
499.611
$$$$
```

MDL规范要求，若任何文本字段的单行超过200个字符，则须硬回车换行；但该规则在实践中常被违反，因为许多SMILES和InChI字符串超过该长度。<sup>[5](https://publications.jrc.ec.europa.eu/repository/bitstream/JRC107492/kjna28708enn.pdf)</sup>

**并非网格。** 与CSV或电子表格文件不同，SDF不保证是矩形的：某条记录的数据项可能比另一条更多、更少或不同，且每条记录定义自己的字段列表及其顺序。将SDF视为带可选空白字段的网格的应用程序，做出了规范并不保证的假设。<sup>[1](https://depth-first.com/articles/2020/07/13/the-sdfile-format/)</sup>

## 用途

SDF将分子结构编码为按原子类型索引的2D或3D原子坐标，使用整数字段表示键类型和局部立体化学，并支持数量不限的一组带标签的信息字段，用于分子特定元数据，如化合物名称、合成方案、数量、纯度和毒性，以及科学数据点如分子量、溶解度、ClogP和生物测定活性。<sup>[10](https://pmc.ncbi.nlm.nih.gov/articles/PMC3796186/)</sup> 这种组合使其成为在筛选、目录和数据库流程中传输化合物集及关联属性的标准载体。<sup>[11](https://formats.jarhalab.com/comparisons/mol2-vs-sdf)</sup>

**数据库与存储库。** SDF被绝大多数公开化学数据库使用，包括PubChem、ChemSpider和ChEBI，用于将化学结构与属性关联。<sup>[6](https://pmc.ncbi.nlm.nih.gov/articles/PMC6226248/)</sup> PubChem接受SDF文件上传结构，并提供提交者所提供的结构及搜索结果的SDF下载。<sup>[12](https://pubchem.ncbi.nlm.nih.gov/docs/upload-chemicals)</sup><sup> • </sup><sup>[13](https://pubchem.ncbi.nlm.nih.gov/docs/structures)</sup>

**法规提交。** FDA关于II型药物主文件（DMF）提交的指南描述了制药行业如何通过电子通用技术文档（eCTD）以单一SD文件形式提交化学结构，使用标准化数据字段，置于模块3第3.2.S.3.2节。该指南推荐V2000格式，一个文件包含所有关注的结构（原料药、工艺杂质、中间体、降解产物和起始物料，不包括试剂和溶剂），以及标准化列如Name、CAS、Role、ID、UNII和Application Number。<sup>[7](https://www.fda.gov/media/151718/download)</sup>

**扩展应用。** NMReDATA倡议将核磁共振（NMR）谱图归属打包为SDF文件（.nmredata.sdf）内以NMREDATA_为前缀的标签，使结构可视化软件仅显示嵌入的MOL结构，而NMR软件可读取归属标签。<sup>[6](https://pmc.ncbi.nlm.nih.gov/articles/PMC6226248/)</sup> 《化学信息学杂志》鼓励作者以CSV、TSV或SDF格式的附加文件提交化学结构信息，以支持可发现性和复用。<sup>[14](https://jcheminf.biomedcentral.com/track/pdf/10.1186/s13321-021-00520-4)</sup>

## 与相关格式的比较

单分子MOL（molfile）格式共享SDF的连接表核心；SDF增加了多记录能力和数据字段。<sup>[10](https://pmc.ncbi.nlm.nih.gov/articles/PMC3796186/)</sup> Tripos MOL2格式将分子包裹在@<TRIPOS>段中，带有SYBYL原子类型和部分电荷，这是对接和建模流程所期望的，使其具有更丰富的逐结构化学细节，而SDF在批量化合物交换和属性字段工作流方面更强。<sup>[11](https://formats.jarhalab.com/comparisons/mol2-vs-sdf)</sup> 如SMILES等行记号法比SDF或MOL2更紧凑地存储分子，但无法携带笛卡尔坐标。<sup>[15](https://arxiv.org/abs/2404.19391)</sup><sup> • </sup><sup>[16](https://formats.jarhalab.com/comparisons/mol-vs-mol2)</sup> RDKit和[Open Babel](https://www.edgepedia.org/zh/open-babel)等工具包可读写SDF及这些替代格式，Open Babel的V3000输出选项可覆盖超过999个原子或键的分子。<sup>[17](https://openbabel.org/docs/FileFormats/MDL_MOL_format.html)</sup>

## References

1. [The SDfile Format, Depth-First (Richard L. Apodaca)](https://depth-first.com/articles/2020/07/13/the-sdfile-format/)
2. [MDL Molfile / SDF File Format, GraphInOut.com](https://graphinout.com/format/sdf-structure-data-file)
3. [RFC 9880: Semantic Definition Format (SDF) for Data and Interactions of Things](https://www.rfc-editor.org/rfc/rfc9880.html)
4. [SDF (.sdf, .sd), Wolfram Language Documentation](https://reference.wolfram.com/language/ref/format/SDF.html)
5. [JRC QSAR Model Database: DATA FORMAT, How to create from SMILES, EUR 28708 EN (2017)](https://publications.jrc.ec.europa.eu/repository/bitstream/JRC107492/kjna28708enn.pdf)
6. [NMReDATA, a standard to report the NMR assignment and parameters of organic compounds, Magn. Reson. Chem. (PMC)](https://pmc.ncbi.nlm.nih.gov/articles/PMC6226248/)
7. [Quick Guide to Creating a Structure-Data File (SD File) for Type II Drug Master File (DMF) Submissions, FDA (updated February 7, 2024)](https://www.fda.gov/media/151718/download)
8. [CTfile Formats, MDL Information Systems (December 1999)](https://mdli.com/downloads/literature/ctfile.pdf)
9. [Structured Data Format · Molecule · Bio, Opterrix Academy](https://academy.optersoft.com/bio/molecule/sdf)
10. [Chemical Informatics and the Drug Discovery Knowledge Pyramid, PMC](https://pmc.ncbi.nlm.nih.gov/articles/PMC3796186/)
11. [MOL2 vs SDF — Format Comparison, JarhaLab File Formats](https://formats.jarhalab.com/comparisons/mol2-vs-sdf)
12. [Upload Chemicals, PubChem](https://pubchem.ncbi.nlm.nih.gov/docs/upload-chemicals)
13. [Structures, PubChem](https://pubchem.ncbi.nlm.nih.gov/docs/structures)
14. [FAIR chemical structures in the Journal of Cheminformatics](https://jcheminf.biomedcentral.com/track/pdf/10.1186/s13321-021-00520-4)
15. [ZSMILES: an approach for efficient SMILES storage for random access in Virtual Screening, arXiv:2404.19391](https://arxiv.org/abs/2404.19391)
16. [MOL vs MOL2: Molfile Exchange or Typed Ligand?, JarhaLab File Formats](https://formats.jarhalab.com/comparisons/mol-vs-mol2)
17. [MDL MOL format (mdl, mol, sd, sdf), Open Babel documentation](https://openbabel.org/docs/FileFormats/MDL_MOL_format.html)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 软件与编程 › Data formats and serialization

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/sdf-file-format

English original: https://www.edgepedia.org/sdf-file-format
