Files
macrolactone-toolkit/README.md
lingyuzeng 3e07402f4e feat(numbering): publish canonical numbering API
Add a public numbering module and route fragmenting, validation,
and scaffold preparation through the canonical numbering entry.

Rewrite the repository entry docs around the fixed numbering
contract, add MkDocs landing pages, and document the mirror
mapping used for medicinal-chemistry comparisons.

Also refresh the validation analysis reports to explain the
canonical-versus-mirrored numbering relationship.
2026-03-20 15:14:31 +08:00

2.1 KiB
Raw Permalink Blame History

macro_lactone_toolkit

macro_lactone_toolkit 是一个用于 12-20 元大环内酯识别、canonical numbering、侧链裂解和拼接准备的 Python 工具包。

先看哪里

渐进式入口

1. 先确认编号契约

这个仓库只有一套 canonical numbering

  • 1 = 内酯羰基碳
  • 2 = 相邻酯氧
  • 3..N = 从 2 位出发沿环唯一图遍历顺序继续编号

对 16 元环,镜像映射是固定的:

  • 3 → 16
  • 4 → 15
  • 5 → 14
  • 6 → 13
  • 7 → 12
  • 8 → 11
  • 9 → 10
  • 10 → 9
  • 11 → 8
  • 12 → 7
  • 13 → 6
  • 14 → 5
  • 15 → 4
  • 16 → 3

这不是视觉顺时针/逆时针切换,公开 API 也不提供 clockwise / anticlockwise 参数。

2. 再看最小用法

from macro_lactone_toolkit import MacroLactoneAnalyzer, MacrolactoneFragmenter

analyzer = MacroLactoneAnalyzer()
fragmenter = MacrolactoneFragmenter()

print(analyzer.get_valid_ring_sizes("O=C1CCCCCCCCCCCCCCO1"))
print(fragmenter.number_molecule("O=C1CCCCCCCCCCCCCCO1").position_to_atom)
pixi install
pixi run pytest
pixi run macro-lactone-toolkit analyze --smiles "O=C1CCCCCCCCCCCCCCO1"
pixi run macro-lactone-toolkit number --smiles "O=C1CCCCCCCCCCCCCCO1"
pixi run macro-lactone-toolkit fragment --smiles "O=C1CCCC(C)CCCCCCCCCCO1" --parent-id mol_001

3. 再深入到页面

维护约束

  • 根目录 AGENTS.md 是唯一权威 agent 入口。
  • 入口文档只保留当前真实存在、持续维护的页面。
  • 如果你要把药化文献里的镜像位置拿来对照,先按 canonical numbering 记账,再做镜像转换。