MolParser 2.0:端到端分子识别升级,全面支持 E-SMILES 2.0 规范
从几何检测到端到端序列化
在光学化学结构识别(Optical Chemical Structure Recognition, OCSR)领域,业界主要存在两条技术范式:基于原子-键检测(Atom-Bond Pipeline)和端到端序列化(End-to-End OCSR)。
为什么选择端到端路线?
- 传统 Atom-Bond 方案虽然能输出携带二维坐标的
.mol格式,但是该格式难以直接被下游 LLM / Agent 理解和处理,仍需进行SMILES转换。但在执行图论重构与序列化转译时,极易因微小像素间距漂移导致连通性判定错误,产生“视觉上看似闭环、实际拓扑已断开”的致命假象。而端到端模型直接在隐空间建模化学键拓扑语义,从根本上杜绝了几何拼接失效和转换SMILES的失败。 - 端到端路线将复杂的 2D 分子网格压缩为高密度的线性字符串,极大降低了表征冗余度。生成的标准化文本可以直接无缝注入多模态模型(MLLM)或化学专用大语言模型(LLM)的上下文窗口,提升下游二次推理、分子性质预测与逆合成设计的吞吐效率。直接序列化表示是更适合大模型和agent应用的 1D 表示。
从 MolParser 到 MolParser 2.0
传统 SMILES 与 Mol 格式在表征能力上存在显著边界,为此,我们在 MolParser 工作中设计并提出了 E-SMILES (Extended-SMILES)语法体系。该体系为文献与专利中常见的环上任意位点取代(Regio-uncertain Attachment)、子结构复制与聚合度(SRU)及复杂马库什(Markush)结构,提供了精准、规范的序列化表示。我们的工作首次证实:在真实文献及手写分子等严苛场景下,端到端 OCSR 模型的性能完全可以达到乃至超越基于规则的 Atom-Bond 流程;不仅展现出持续突破的精度上限,在推理吞吐量上亦具备数量级优势,极为契合大规模化学文献挖掘工程。
在本次 MolParser 2.0 更新中,我们延续并深化了这一技术路线,正式引入全新的 E-SMILES 2.0 规范。该升级进一步拓宽了 OCSR 算法的识别边界与表达维度,实现了对海量文献与专利中绘图风格各异、拓扑结构高度复杂的 Markush 分子更全面、更深度的解析支持。
MolParser-2.0-GA(General Availability,正式可用版)发布
相比 Uni-Parser 1.4.0 版本中的 MolParser-2.0-preview,新版 Uni-Parser 带来的 MolParser-2.0-GA,首次引入了OCSR模型的自进化机制,模型能力可以随推理数目的增加而不断提升。在 BioVista OCSR Benchmark 上 MolParser-2.0-GA 取得了新的 SOTA(准确率从测试版的 84.5% 提升至正式版的 85.7%)。针对 Atom-Bond 方法难以处理的各类复杂立体异构结构,新版本表现显著改善;同时,Markush、基团缩写、SRU等识别能力也在自进化中得到明显增强。此外,新版本进一步完善了 E-SMILES 后处理与 Markush 代入的开源配套生态,对药物、化学文献领域Agent的应用提供了坚实的生态基础。
扩展支持范围
E-SMILES(Extended-SMILES)由标准 SMILES 与可选的扩展片段组成,在保持 RDKit-friendly 的同时,为 SMILES 提供 LLM-friendly 的扩展表示:
SMILES<sep>EXTENSION
普通分子(Simple)
普通分子直接使用标准 SMILES 表达,并以 <sep> 结束
| 图像 | E-SMILES 表示 | E-SMILES 2.0 表示 |
|---|---|---|
![]() | | |
[Updated] 连接点(Dummy Attachment Point)
连接位点使用 <d></d> 表达:
<d>ATOM_INDEX:<dum></d>
其中:
ATOM_INDEX表示连接点对应的原子序号;<dum>表示该位置为 dummy attachment point,用于表示结构与未展开部分的连接。
环上不定连接(Ring Attachment / Regio-uncertain Attachment)
当取代基连接于某个环或区域,但具体连接原子不确定时,使用 <r></r> 表达:
<r>RING_INDEX:GROUP</r>
其中:
RING_INDEX表示该不定连接所属的环的index(rdkit计算的环序号,从0开始);GROUP表示连接到该区域的取代基或 Markush 基团;- 对于多个环上的不定连接,使用逗号分隔不同环 index,如
<r>RING_INDEX_1,RING_INDEX_2:GROUP</r>,表示该取代基可连接于指定多个环区域中的任意位置;
抽象环(Abstract Ring)
无法明确展开具体环结构、仅以抽象环节点表示的结构使用 <c></c> 表达:
<c>ATOM_INDEX:LABEL</c>
其中:
ATOM_INDEX表示抽象环在主体结构中的对应位置;LABEL表示该抽象环的类型或标识;- 抽象环仅保留其作为整体结构单元的连接关系,不展开内部原子和键
Markush分子和缩写基团 (Markush & Abbreviation)
普通 Markush 分子或缩写基团在主体 SMILES 后使用 <a></a> 标记可变取代基:
<a>ATOM_INDEX:GROUP</a>
其中:
ATOM_INDEX表示 Markush 基团连接到主体结构的原子序号;GROUP表示对应的可变基团,如R[1]、R[2]等;- 同一结构中可定义多个 Markush 位点,用于表示不同位置的可变取代基。
| 图像 | E-SMILES 表示 | E-SMILES 2.0 表示 |
|---|---|---|
![]() | | |
[New] 特殊Markush (Special Markush)
特殊 Markush 用于表示无法直接映射为普通原子、官能团或标准 R 基的抽象化学片段,例如 DNA、RNA、彩色圆球或其他自定义结构标签。使用 <id>...</id> 表达其自定义标识:
<a>ATOM_INDEX:<id>[LABEL]</id></a>
其中:
ATOM_INDEX表示特殊 Markush 与主体结构连接的原子位置;<id>LABEL</id>用于记录该抽象片段的语义标签;LABEL为自由文本标识,例如DNA、ball(白色圆圈)、blue(蓝色小球) 等;- 特殊 Markush 只保留图中给出的抽象身份及连接关系,不对其内部化学结构进行展开或推断。
[New] 子结构复制(SRU)
对于单个取代基或单个节点的子结构复制支持使用 ?COUNT 表达局部片段的重复次数,其中:
?COUNT表示其前方局部子结构的复制次数;COUNT可以为确定数值、范围或变量,例如?3、?1-3、?n;?n中的实际重复次数可由对应的 Markush 定义给出;- 该表示适用于
CH2?n、取代基多重性等局部重复结构。
对于局部骨架片段的子结构复制,无法使用 ?COUNT 无歧义的表示时,需要使用 <g></g> 标记需要整体重复的结构范围,并通过 |Sg:COUNT| 指定重复次数:
<g>[INNER_PORT1:OUTER_PORT1]:[INNER_PORT2:OUTER_PORT2]:|Sg:COUNT|</g>
其中:
<g></g>用于定义需要整体复制的局部结构;-
[INNER_PORT:OUTER_PORT]表示该重复结构的一个内外边界连接端口(inner/outer boundary port): -
INNER_PORT:重复结构(SRU)内部的原子索引; OUTER_PORT:重复结构外部、与该内部原子相连的原子索引;- 因此,该表示描述的是从重复结构内部到外部的边界连接关系;
- 一个局部重复结构通常具有两个边界连接端口,分别定义重复单元的两端。例如:其中
[3:2]和[4:5]分别表示两个内外边界连接端口,即重复单元内部原子3、4分别与外部原子2、5相连;
text
<g>[3:2]:[4:5]:|Sg:20|</g>
- COUNT 表示该局部结构的重复次数,可以为变量、确定数值或简单范围,例如 n、m、20 等;
- 当整个分子作为一个结构重复单元(structural repeating unit, SRU),并通过其两端连接形成高分子链时,属于 Polymer 的特殊情况,此时直接使用 |Sg:COUNT| 表示整体重复,不再使用 <g></g>。
[Updated] 高分子(Polymer/SRU)
高分子重复单元使用 * 表示与相邻重复单元相连的端点,并通过 <d></d> 标记对应的连接位点:
*CC*<sep><d>0:<dum></d><d>3:<dum></d>|Sg:n|
其中:
*表示高分子重复单元两端的连接点;<d>ATOM_INDEX:<dum></d>用于标记对应的 dummy attachment point;|Sg:COUNT|表示重复单元的聚合度或重复次数,高分子不指定重复次数默认为 |Sg:n|;
[New] 虚拟连接弧(Virtual Arc)
虚拟连接弧(Virtual Arc)使用 <v></v> 标签表示:
<v>[VIRTUALARC_INDEX]:[VIRTUALARC_NAME]:[FROM_ATOM:TO_ATOM]</v>
其中:
VIRTUALARC_INDEX表示虚拟连接弧的索引,从0开始,并使用独立于原子和环的索引空间;VIRTUALARC_NAME表示虚拟连接弧的来源标签,例如A、Ar或M;如果原图中没有对应标签,可以为空;FROM_ATOM和TO_ATOM表示虚拟连接弧两端对应的原子索引,均为基于 Base SMILES 的 0-based atom index;[FROM_ATOM:TO_ATOM]用于指定虚拟连接弧的两个端点。该连接不表示真实化学键,而是用于表达结构图中的特殊抽象连接关系,例如图中通过大环、跨越结构或其他非标准键线表示的连接;
[New] 轴手性 (Stereogenic Axis)
手性轴统一使用 <x></x> 标签表示,将原联芳基键的定义泛化为手性轴向量的两端定义点(Terminal Reference Points of Chiral Axis):
<x>[ATOM_1:ATOM_2]:STATE</x>
其中:
ATOM_1和ATOM_2表示定义手性轴拓扑跨度的两端关键原子序号,严格遵循ATOM_1 < ATOM_2;[ATOM_1:ATOM_2]用于唯一锁定承载轴手性的结构骨架(单键阻转时为该化学键两端原子;多原子累积或正交体系时为主轴两端关键原子);-
STATE表示轴手性的绝对构型,取值为: -
Ra:R 型轴手性(R axial); Sa:S 型轴手性(S axial)
| 轴手性类型 | 拓扑 / 阻转本质 | 轴两端原子定义规则 | 语法示例 |
|---|---|---|---|
| 联芳基体系 | 单键旋转受阻(C-C) | 连接两个芳环的 C-C 单键原子序号 | <x>[5:12]:Ra</x> |
| 芳基 - 烯基 / 二烯体系 | 单键旋转受阻(C-C) | 芳环碳原子与烯基 α- 碳原子序号 | <x>[4:9]:Sa</x> |
| 芳基酰胺 / 酰亚胺体系 | 单键旋转受阻(C-N) | 芳环碳原子与酰胺氮原子序号 | <x>[6:7]:Ra</x> |
| 丙二烯 / 累积多烯体系 | 共线 π 轨道正交累积双键体系 | 两端的 sp² 碳原子序号 | <x>[2:4]:Sa</x> |
| 烷基叉环烷烃 | 环与双键正交 | 环内连接原子与双键末端碳原子序号 | <x>[3:8]:Sa</x> |
| 螺环化合物 | 螺原子几何正交 | 穿过螺原子的主轴线两端最远端原子(对位顶点)序号 | <x>[1:10]:Ra</x> |
E-SMILES 2.0 工具链与开源生态
Github 开源
E-SMILES 2.0 已在 MolParser 开源仓库 中提供完整的工具与规范支持:
- 提供 E-SMILES 后处理规范化、格式转换、Markush 代入、以及结构渲染 等基础工具;
- 提供 E-SMILES Skills,用于帮助 Agent 理解 E-SMILES 2.0 的表示规范与典型案例,可用于 Uni-Parser / MolParser 输出结果的解析、校验、规范化与下游消费;
E-SMILES 后处理
from molparser import utils as mutils
raw = "*c1ccccc1<sep><a>0:CF3</a>"
result = mutils.postprocess_caption(raw)
print(result["smi"])
# FC(F)(F)c1ccccc1
print(result["esmi"])
# FC(F)(F)c1ccccc1<sep>
Markush 代入
from molparser import utils as mutils
# --------------------------------------------
# Example 1:
result = mutils.substitute_markush("*c1ccccc1<sep><a>0:NHR[1]</a>", {"R1": "Me"})
print(result)
# CNc1ccccc1
# --------------------------------------------
# Example 2:
result = mutils.substitute_markush("COCCOC<sep><g>[1:0]:[3:4]:|Sg:n|</g>", {"n": 5})
print(result)
# COCCOCCOCCOCCOCCOC
# --------------------------------------------
# Example 3:
result = mutils.substitute_markush(
"c1ccccc1<sep><r>0:R[1]?1-3</r>",
{"R1": "Me"},
)
print(result)
# ['Cc1cc(C)cc(C)c1', 'Cc1ccc(C)c(C)c1', 'Cc1ccc(C)cc1', 'Cc1cccc(C)c1', 'Cc1cccc(C)c1C', 'Cc1ccccc1', 'Cc1ccccc1C']
# --------------------------------------------
# Example 4:
from molparser import utils as mutils
result = mutils.substitute_markush(
"c1ccc2ccccc2c1<sep><r>0,1:R[1]</r>",
{"R1": "Me"},
)
print(result)
# ['Cc1ccc2ccccc2c1', 'Cc1cccc2ccccc12']
E-SMILES 分子结构渲染
from molparser import utils as mutils
esmiles = "*c1ccccc1<sep><a>0:R[1]</a>"
svg = mutils.draw(esmiles, output_format="svg")
png = mutils.draw(esmiles, output_format="png")
E-SMILES Skills
仓库同时维护了面向 LLM / Agent 的 E-SMILES Skills,包括:
skills/molparser-extended-smiles/
├── SKILL.md
├── extended-smiles-spec.md
└── figure-index.md
这些 Skills 可直接作为大模型上下文,用于 E-SMILES的识别、校验、规范化、Markush 代入与渲染,从而更方便地消费 Uni-Parser / MolParser 的结构化输出。
Huggingface 开源
欢迎关注 Uni-Parser 团队(DP Technology) 在 Hugging Face 上持续发布的模型与数据:
https://huggingface.co/UniParser
我们将持续为社区提供有价值的开源内容!
主观对比
MolParser 2.0: End-to-End Molecular Recognition Upgrade with Full E-SMILES 2.0 Support
From Geometric Detection to End-to-End Serialization
In optical chemical structure recognition (Optical Chemical Structure Recognition, OCSR), there are two main technical paradigms: atom-bond detection (Atom-Bond Pipeline) and end-to-end serialization (End-to-End OCSR).
Why Choose an End-to-End Approach?
- Although traditional Atom-Bond approaches can output
.molfiles carrying two-dimensional coordinates, this format is difficult for downstream LLMs / Agents to understand and process directly, so conversion to SMILES is still required. During graph reconstruction and serialization, however, even small shifts in pixel spacing can cause incorrect connectivity judgments, creating the critical illusion of a structure that looks closed visually but is topologically disconnected. End-to-end models directly model chemical bond topology semantics in latent space, fundamentally eliminating geometric assembly failures and failures in conversion to SMILES. - The end-to-end approach compresses complex 2D molecular grids into dense linear strings, greatly reducing representational redundancy. The standardized text can be injected directly into the context windows of multimodal models (MLLMs) or chemistry-specific large language models (LLMs), improving throughput for downstream reasoning, molecular property prediction, and retrosynthesis design. Direct serialization provides a 1D representation better suited to large models and agent applications.
From MolParser to MolParser 2.0
Traditional SMILES and Mol formats have significant limits in their representational capabilities. In our MolParser work, we therefore designed and proposed the E-SMILES (Extended-SMILES) syntax. It provides precise, standardized serialized representations for regio-uncertain attachment, substructure replication and degree of polymerization (SRU), and complex Markush structures commonly found in literature and patents. Our work demonstrated for the first time that, even in demanding settings such as real-world literature and handwritten molecules, end-to-end OCSR models can match or surpass rule-based Atom-Bond pipelines. In addition to continually improving accuracy limits, they offer order-of-magnitude advantages in inference throughput, making them particularly suitable for large-scale chemical literature mining.
In this MolParser 2.0 update, we continue and deepen this technical approach by formally introducing the new E-SMILES 2.0 specification. The upgrade further expands the recognition boundaries and expressive dimensions of OCSR algorithms, supporting more comprehensive and deeper parsing of Markush molecules with diverse drawing styles and highly complex topologies across literature and patents.
MolParser-2.0-GA (General Availability) Release
Compared with MolParser-2.0-preview in Uni-Parser 1.4.0, the MolParser-2.0-GA included in the new Uni-Parser introduces a self-evolution mechanism for OCSR models for the first time, allowing model capabilities to improve as the number of inferences increases. MolParser-2.0-GA achieves a new SOTA on the BioVista OCSR Benchmark, with accuracy increasing from 84.5% in the preview to 85.7% in the general release. The new version significantly improves performance on complex stereoisomeric structures that are difficult for Atom-Bond methods to handle. Recognition of Markush structures, group abbreviations, and SRUs also improves through self-evolution. In addition, the new version further develops the supporting open-source ecosystem for E-SMILES post-processing and Markush substitution, providing a solid foundation for Agent applications in pharmaceutical and chemical literature.
Extended Support
E-SMILES (Extended-SMILES) consists of standard SMILES and an optional extension. While remaining RDKit-friendly, it provides LLM-friendly extensions to SMILES:
SMILES<sep>EXTENSION
Simple Molecules (Simple)
Simple molecules use standard SMILES directly and end with <sep>.
| Source image | E-SMILES | E-SMILES 2.0 |
|---|---|---|
![]() | | |
[Updated] Attachment Points (Dummy Attachment Point)
Attachment points use <d></d>:
<d>ATOM_INDEX:<dum></d>
Here:
ATOM_INDEXis the atom index corresponding to the attachment point;<dum>indicates a dummy attachment point, representing a connection between the structure and an unexpanded part.
Ring Attachment / Regio-uncertain Attachment
When a substituent is attached to a ring or region but the exact attachment atom is uncertain, use <r></r>:
<r>RING_INDEX:GROUP</r>
Here:
RING_INDEXis the index of the ring containing the uncertain attachment (the zero-based ring index calculated by RDKit);GROUPis the substituent or Markush group attached to that region;- For uncertain attachment across multiple rings, separate ring indexes with commas, as in
<r>RING_INDEX_1,RING_INDEX_2:GROUP</r>, indicating that the substituent may attach at any position within the specified ring regions.
Abstract Ring
Structures represented only as abstract ring nodes, whose specific ring structures cannot be explicitly expanded, use <c></c>:
<c>ATOM_INDEX:LABEL</c>
Here:
ATOM_INDEXis the position of the abstract ring in the main structure;LABELis the type or identifier of that abstract ring;- An abstract ring retains only its connections as a whole structural unit, without expanding its internal atoms and bonds.
Markush Molecules and Abbreviated Groups (Markush & Abbreviation)
Ordinary Markush molecules or abbreviated groups use <a></a> after the main SMILES to mark variable substituents:
<a>ATOM_INDEX:GROUP</a>
Here:
ATOM_INDEXis the atom index where the Markush group connects to the main structure;GROUPis the corresponding variable group, such asR[1]orR[2];- Multiple Markush sites can be defined in the same structure to represent variable substituents at different positions.
| Source image | E-SMILES | E-SMILES 2.0 |
|---|---|---|
![]() | | |
[New] Special Markush
Special Markush represents abstract chemical fragments that cannot be mapped directly to ordinary atoms, functional groups, or standard R groups, such as DNA, RNA, colored spheres, or other custom structural labels. Their custom identifiers use <id>...</id>:
<a>ATOM_INDEX:<id>[LABEL]</id></a>
Here:
ATOM_INDEXis the atom position where the special Markush connects to the main structure;<id>LABEL</id>records the semantic label of the abstract fragment;LABELis a free-text identifier, such asDNA,ball(a white circle), orblue(a small blue sphere);- Special Markush retains only the abstract identity and connectivity shown in the image, without expanding or inferring its internal chemical structure.
[New] Substructure Replication (SRU)
For substructure replication of a single substituent or node, ?COUNT expresses the number of repetitions of a local fragment:
?COUNTis the replication count of the preceding local substructure;COUNTcan be a definite number, range, or variable, such as?3,?1-3, or?n;- The actual repetition count in
?ncan be supplied by the corresponding Markush definition; - This representation applies to local repeated structures such as
CH2?nand substituent multiplicity.
For replication of a local skeleton fragment that cannot be represented unambiguously with ?COUNT, use <g></g> to mark the structure to be repeated as a whole, and specify the repetition count with |Sg:COUNT|:
<g>[INNER_PORT1:OUTER_PORT1]:[INNER_PORT2:OUTER_PORT2]:|Sg:COUNT|</g>
Here:
<g></g>defines the local structure to be replicated as a whole;[INNER_PORT:OUTER_PORT]is an inner/outer boundary port of the repeated structure:INNER_PORT: the atom index inside the repeating structure (SRU);OUTER_PORT: the atom index outside the repeating structure that connects to that internal atom;- The representation therefore describes the boundary connection from inside to outside the repeating structure;
- A local repeating structure usually has two boundary ports defining its two ends. For example,
[3:2]and[4:5]represent two inner/outer boundary ports: internal atoms3and4connect to external atoms2and5, respectively:
text
<g>[3:2]:[4:5]:|Sg:20|</g>
COUNTis the repetition count of the local structure, and can be a variable, definite number, or simple range, such asn,m, or20;- When an entire molecule is a structural repeating unit (SRU) and forms a polymer chain through connections at its two ends, this is a special case of Polymer. Use
|Sg:COUNT|directly for whole-unit repetition, without<g></g>.
[Updated] Polymers (Polymer/SRU)
Polymer repeating units use * for endpoints connected to adjacent repeating units, and <d></d> marks the corresponding attachment points:
*CC*<sep><d>0:<dum></d><d>3:<dum></d>|Sg:n|
Here:
*represents attachment points at both ends of the polymer repeating unit;<d>ATOM_INDEX:<dum></d>marks the corresponding dummy attachment point;|Sg:COUNT|is the degree of polymerization or repetition count. If no repetition count is specified for a polymer, it defaults to|Sg:n|.
[New] Virtual Arc
Virtual arcs use <v></v>:
<v>[VIRTUALARC_INDEX]:[VIRTUALARC_NAME]:[FROM_ATOM:TO_ATOM]</v>
Here:
VIRTUALARC_INDEXis the index of the virtual arc, starting from0, in an index space independent of atoms and rings;VIRTUALARC_NAMEis the source label of the virtual arc, such asA,Ar, orM; it can be empty if the original image has no corresponding label;FROM_ATOMandTO_ATOMare the atom indexes of the two endpoints of the virtual arc, both using 0-based atom indexes in the Base SMILES;[FROM_ATOM:TO_ATOM]specifies the two endpoints. This connection does not represent a real chemical bond; it expresses special abstract connections in structural diagrams, such as those shown using large rings, spans across structures, or other nonstandard bond lines.
[New] Stereogenic Axis
Chiral axes uniformly use <x></x>, generalizing the original biaryl bond definition to the terminal reference points of a chiral axis vector (Terminal Reference Points of Chiral Axis):
<x>[ATOM_1:ATOM_2]:STATE</x>
Here:
ATOM_1andATOM_2are the indexes of the key atoms defining the topological span of the chiral axis, strictly followingATOM_1 < ATOM_2;[ATOM_1:ATOM_2]uniquely identifies the structural skeleton carrying axial chirality (the two atoms of the bond for single-bond atropisomerism, or the key terminal atoms of the main axis for multi-atom cumulative or orthogonal systems);STATEis the absolute configuration of axial chirality:Ra: R axial;Sa: S axial.
| Axial chirality type | Topological / rotational restriction | Definition of the two axial atoms | Syntax example |
|---|---|---|---|
| Biaryl systems | Restricted single-bond rotation (C-C) | Atom indexes of the C-C single bond joining two aromatic rings | <x>[5:12]:Ra</x> |
| Aryl–alkenyl / diene systems | Restricted single-bond rotation (C-C) | Indexes of the aromatic carbon and alkenyl α-carbon | <x>[4:9]:Sa</x> |
| Aryl amide / imide systems | Restricted single-bond rotation (C-N) | Indexes of the aromatic carbon and amide nitrogen | <x>[6:7]:Ra</x> |
| Allene / cumulene systems | Orthogonally accumulated collinear π-orbital double-bond systems | Indexes of the two terminal sp² carbons | <x>[2:4]:Sa</x> |
| Alkylidenecycloalkanes | Orthogonality of the ring and double bond | Indexes of the connection atom in the ring and the terminal carbon of the double bond | <x>[3:8]:Sa</x> |
| Spiro compounds | Geometric orthogonality at the spiro atom | Indexes of the farthest terminal atoms (opposite vertices) on the principal axis through the spiro atom | <x>[1:10]:Ra</x> |
E-SMILES 2.0 Toolchain and Open-Source Ecosystem
Github Open Source
The MolParser open-source repository provides complete tool and specification support for E-SMILES 2.0:
- Basic tools for E-SMILES post-processing and normalization, format conversion, Markush substitution, and structure rendering;
- E-SMILES Skills that help Agents understand the E-SMILES 2.0 representation and typical examples, for parsing, validation, normalization, and downstream consumption of Uni-Parser / MolParser outputs.
E-SMILES Post-processing
from molparser import utils as mutils
raw = "*c1ccccc1<sep><a>0:CF3</a>"
result = mutils.postprocess_caption(raw)
print(result["smi"])
# FC(F)(F)c1ccccc1
print(result["esmi"])
# FC(F)(F)c1ccccc1<sep>
Markush Substitution
from molparser import utils as mutils
# --------------------------------------------
# Example 1:
result = mutils.substitute_markush("*c1ccccc1<sep><a>0:NHR[1]</a>", {"R1": "Me"})
print(result)
# CNc1ccccc1
# --------------------------------------------
# Example 2:
result = mutils.substitute_markush("COCCOC<sep><g>[1:0]:[3:4]:|Sg:n|</g>", {"n": 5})
print(result)
# COCCOCCOCCOCCOCCOC
# --------------------------------------------
# Example 3:
result = mutils.substitute_markush(
"c1ccccc1<sep><r>0:R[1]?1-3</r>",
{"R1": "Me"},
)
print(result)
# ['Cc1cc(C)cc(C)c1', 'Cc1ccc(C)c(C)c1', 'Cc1ccc(C)cc1', 'Cc1cccc(C)c1', 'Cc1cccc(C)c1C', 'Cc1ccccc1', 'Cc1ccccc1C']
# --------------------------------------------
# Example 4:
from molparser import utils as mutils
result = mutils.substitute_markush(
"c1ccc2ccccc2c1<sep><r>0,1:R[1]</r>",
{"R1": "Me"},
)
print(result)
# ['Cc1ccc2ccccc2c1', 'Cc1cccc2ccccc12']
E-SMILES Molecular Structure Rendering
from molparser import utils as mutils
esmiles = "*c1ccccc1<sep><a>0:R[1]</a>"
svg = mutils.draw(esmiles, output_format="svg")
png = mutils.draw(esmiles, output_format="png")
E-SMILES Skills
The repository also maintains E-SMILES Skills for LLMs / Agents, including:
skills/molparser-extended-smiles/
├── SKILL.md
├── extended-smiles-spec.md
└── figure-index.md
These Skills can be used directly as large-model context for E-SMILES recognition, validation, normalization, Markush substitution, and rendering, making it easier to consume structured Uni-Parser / MolParser output.
Huggingface Open Source
Follow the models and datasets continuously published by the Uni-Parser team (DP Technology) on Hugging Face:
https://huggingface.co/UniParser
We will continue providing valuable open-source content to the community!

























































