SKETCH-2375: Migrate to RDKit native attachment point handling - #360
Open
cdvonbargen wants to merge 6 commits into
Open
SKETCH-2375: Migrate to RDKit native attachment point handling#360cdvonbargen wants to merge 6 commits into
cdvonbargen wants to merge 6 commits into
Conversation
cdvonbargen
force-pushed
the
pr/SKETCH-2375-native-attachment-points
branch
from
August 4, 2026 13:29
a869a44 to
321fd89
Compare
cdvonbargen
marked this pull request as ready for review
August 4, 2026 13:40
cdvonbargen
requested review from
ethan-schrodinger and
rachelnwalker
as code owners
August 4, 2026 13:40
Replace custom attachment point expand/collapse functions with RDKit's native MolOps::expandAttachmentPoints() and collapseAttachmentPoints(). Set _fromAttachPoint property on AP dummies for compatibility with the native API, while keeping atomLabel for molecule-level numbering. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…mentPoint Delegate is_attachment_point_dummy() to RDKit's MolOps::details::isAttachmentPoint() and replace make_new_attachment_point() with MolOps::details::addExplicitAttachmentPoint(). This requires all AP dummies to have _fromAttachPoint set, so label_expanded_attachment_points() now also marks CXSMILES-sourced APs that only have atomLabel. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…hmentPoint Remove the is_attachment_point_dummy wrapper from rdkit_extensions and replace all call sites with RDKit::MolOps::details::isAttachmentPoint(). Also simplify collapse_attachment_point_dummies to just call collapseAttachmentPoints without the redundant marking loop, since all AP creation and read paths now set _fromAttachPoint. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Inline the single collapseAttachmentPoints call at the write site and drop the unnecessary updatePropertyCache calls that bookended it. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cdvonbargen
force-pushed
the
pr/SKETCH-2375-native-attachment-points
branch
from
August 4, 2026 13:46
321fd89 to
a426dd5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RDKit APIs used
MolOps::expandAttachmentPoints()replacesmolattachpt_property_to_attachment_point_dummies().MolOps::collapseAttachmentPoints()replacesattachment_point_dummies_to_molattachpt_property().MolOps::details::addExplicitAttachmentPoint()replacesmake_new_attachment_point().Functions kept for Sketcher behavior
is_attachment_point_dummy()cannot use RDKit'sisAttachmentPoint()because RDKit tests whether an AP can be collapsed and therefore rejects wedged APs. Sketcher must still recognize those as attachment points and support legacy_AP<n>labels.compute2DCoords()additionally handles HELM structures, frozen atoms, ring templates, and removal of stale molfile wedging.wedgeMolBonds()prevents RDKit from choosing attachment-point bonds for wedging by temporarily making those bonds ineligible._AP<n>UI numbering. RDKit's_fromAttachPointvalues only describe the first or second attachment on an individual parent atom.