Skip to content

Exhaustive fragmenter fix and improvements#1238

Merged
johnmay merged 47 commits intocdk:mainfrom
ToLeWeiss:exhaustive_fragmenter
Nov 5, 2025
Merged

Exhaustive fragmenter fix and improvements#1238
johnmay merged 47 commits intocdk:mainfrom
ToLeWeiss:exhaustive_fragmenter

Conversation

@ToLeWeiss
Copy link
Copy Markdown
Contributor

Fix for Saturation Issues in ExhaustiveFragmenter (#1119)

Aims to resolve the saturation-related issues in the ExhaustiveFragmenter, as described in issue #1119.

Fixes & Improvements

Correct Fragment Saturation:

  • the generated fragments are now explicitly copied, preventing unintended modifications
  • added the ability to set and control the saturation state of returned fragments
  • added setting to preserve stereochemistry

Bond Splitting Logic:

  • improved performance by splitting a specific combination of bonds only once
  • usage of new cycle detection which runs only once
  • added setting of a maximum tree depth to regulate the upper limit of bonds that will be split

… saturated or unsaturated fragments, added a test and renamed some tests to prepare for the tests for unsaturated fragments
… algorithm changes to use a power set to reduce computations
…ve or too small because of truncation of BigInt to int
…se and therefore cant have more elements than 2^31 - 1
…ion and added more comprehensive comments for subset generation
Bringing this feature branch up to date.
…tries to implement the pseudo-R-atom saturation
Update to be on par with the cdk main branch.
Update the branch to be up to date
…added a setting for copying setereo information + tests
Bringing branch up to date with upstream cdk repositories main branch
…lied the changes from BigInt back to int manually
@johnmay
Copy link
Copy Markdown
Member

johnmay commented Oct 24, 2025

I've just had a quick skim and there is a lot to check but is/can the public API preserved?

@JonasSchaub
Copy link
Copy Markdown
Contributor

I've just had a quick skim and there is a lot to check but is/can the public API preserved?

Hi @johnmay ,
yes, all pre-existing public methods are still there and haven't been changed. The output might differ a bit, though, because of the saturation fix and other alterations to make the algorithm more "usable".

@JonasSchaub
Copy link
Copy Markdown
Contributor

@rajarshi,
we saw that you originally implemented this algorithm way back when. Might I ask whether you had a (literature) reference for the algorithm? Or did you develop it yourself? Did you have a specific application in mind?

@rajarshi
Copy link
Copy Markdown
Member

Hi @JonasSchaub as far as I can recall this was not based on any literature reference. I figured it was such a trivial method, that nobody would write it up! At this point I can't recall why I implemented it, beyond providing an alternative to the Bemis-Murcko fragmentation scheme

@JonasSchaub
Copy link
Copy Markdown
Contributor

Thanks, @rajarshi, for the quick response!
We also couldn't find any literature about the algorithm itself, even though an approach like this is used in multiple places, e.g. MetFrag and some matched molecular pair algorithms.

@johnmay also did something similar to improve database searches (https://www.nextmovesoftware.com/talks/Mayfield_HoneyIShrunkTheDatabase_ICCS2025.pdf).

We are going to integrate it as an additional fragmentation scheme into our MORTAR application and then see what useful stuff we can do with it.

@johnmay johnmay merged commit 13b77a5 into cdk:main Nov 5, 2025
7 of 8 checks passed
@johnmay
Copy link
Copy Markdown
Member

johnmay commented Nov 5, 2025

Sorry for delay, been busy. Looks good, thanks for the improvements.

@egonw
Copy link
Copy Markdown
Member

egonw commented Nov 6, 2025

@ToLeWeiss, I looked at the git history, and personally prefer a more linear history. It's hard to see what happens, with all those mergers. An alternative is to regularly use git rebase on your branch (/PR).

@ToLeWeiss
Copy link
Copy Markdown
Contributor Author

Thank you for taking the time to take a look at the changes @johnmay!

@egonw, thanks for the tip! I will be careful to rebase instead of merging in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants