Merged
Conversation
…ccepted by BIOVIA's tools - both of these have inconsistencies between the parent/root structure and defined attachments. I agree these are wrong. Here I have added a verify check to strict reading mode which checks and reports on these errors.
…rtain operations easier and will greatly simplify JChemPaint since we work in flattened mode and then turn it into a real RgroupQuery as needed.
…ent points where needed and disambiguating nested definitions.
The StructureDiagramGenerator has been rewritten to have a convenience function for depiction a grid of molecules. For Markush structures we layout the root structure(s) first then the definitions below.
|
Member
|
Nice! |
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.



Following on from some patches last year to make things work easier in JCP this adds better RGroup support to the core library. Specifically like with reactions with now have the ability to flatten/unflatten an RGroupQuery structure so you can work with and pass it around like a normal molecule. This is handled by the new
RGroupQueryManipulator. Ideally this would be located along with the other manipulators but the use of the Query APIs makes this tricky - perhaps something to target for CDK 3.0.Two of the existing RGroup test files are not actually valid (tested with BIOVIA tools) and I have added a strict mode for that.
I have also added support for reading/writing from CXSMILES and doing the layout depiction logic - this is already live on SiMolecule / cdkdepict. This requires handling implied attachment points and disambiguating nesting. For example consider this structure:
Note there are 2 conflicting definitions for R2 depending on which substituent is loaded. Without care we would accidentally load the structure like this:
Instead what we do is relabel one of the R2's to allow an unambiguous depiction:
The existing RGroupQuery does not really support nesting like this but the depiction/layout is at least correct.
One slight quirk is due to dependency/packaging I can't currently access the RGroupManipulator from the SMILES writer so you need to manually convert it before generating. I think that is acceptable for now:
For reference here is the CXSMILES for our 7 rgfile tests: