Avoid that lone atoms which are part of a ring in one of the molecules become part of the MCS #4065
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.
While looking at some of the test cases in #4019 I have noticed that currently the MCS does not do what is expected in this case:
As
AtomCompareParameters.CompleteRingsOnly
was set toTrue
, atom 5 should not be part of the MCS, as we have requested that only atoms which are part of a complete ring are included, and this is not the case.The reason why this happens is that in #3695, when I implemented the
AtomCompareParameters.CompleteRingsOnly
parameter (in addition to the already existingBondCompareParameters.CompleteRingsOnly
), I omitted to also set theAtomCompareParameters.RingMatchesRingOnly
flag (as already happened for itsBondCompareParameters.CompleteRingsOnly
counterpart).In fact, as
AtomCompareParameters.CompleteRingsOnly
impliesBondCompareParameters.CompleteRingsOnly
, a non-ring atom can never be matched to a ring atom as that would imply including an incomplete ring in the MCS.With this change, the MCS returned in the above test case is cyclopentane, as expected.
I had to tweak the results of a few unit tests that I added in #3695 as the expected result did not include atom ring specifiers in the SMARTS string, as they should have.