Implement the KET format contract agreed with the Ketcher team: attachmentGroups declared on a molecule, and a haptic bond expressed as a root-level connection.
Watch out for two contract details: a haptic connection is keyed by type, while existing monomer connections use connectionType; and all ids (atomId, attachmentGroupId, group id) are strings, while attachmentGroups[].atoms are numbers. On save the molecule is split into components, and a haptic bond crosses that split — the bonds must be collected before splitting.
Done when: both reference examples load and survive a round-trip; a group whose molecule node is missing from root.nodes, or a connection referring to an unknown group/atom, fails with a clear message; attachment groups feed the connectivity sets used to split a reaction KET, so a ferrocene reactant stays one component instead of three.
Implement the KET format contract agreed with the Ketcher team:
attachmentGroupsdeclared on a molecule, and a haptic bond expressed as a root-level connection.Watch out for two contract details: a haptic connection is keyed by
type, while existing monomer connections useconnectionType; and all ids (atomId,attachmentGroupId, groupid) are strings, whileattachmentGroups[].atomsare numbers. On save the molecule is split into components, and a haptic bond crosses that split — the bonds must be collected before splitting.Done when: both reference examples load and survive a round-trip; a group whose molecule node is missing from
root.nodes, or a connection referring to an unknown group/atom, fails with a clear message; attachment groups feed the connectivity sets used to split a reaction KET, so a ferrocene reactant stays one component instead of three.