CHEMBUGS-64 Automapping fails to guard against contradictory reaction center annotation, corrupts future structure export data #3257
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.
Issue details:
If auto-mapping is done on a reaction center that alreacy have RC_UNCHANGED, but changing into RC_ORDER_CHANGED, or the other way around, you can get a broken (RC_ORDER_CHANGED | RC_UNCHANGED) flag happening at the same time in the same react center, causing future load of any exports to MOL V3000 to fail.
Original Reporter:
Rob Brown, Head of Science Office @ Sapio Sciences LLC.
Implementation Done By:
Yechen Qiao, Core Platform Developer @ Sapio Sciences LLC.
Test file:
CuAAC Click Example fixed.zip
Test instruction:
Extract zip to get the RXN data.
Use the automap(keep) in python or whatever other api you prefer.
Export V3000.
Try load it back using ketcher or something.
Before the fix, you will fail to load because it has a section that looks like this:
M V30 4 2 3 2 RXCTR=10
RXCTR=10 is bad because it is a bitwise OR to both RC_UNCHANGED = 2 and RC_ORDER_CHANGED = 8
Fun fact: Chemaxon automatically fix this condition on load by picking one or another during MOL V3000 loading, but that is not in this PR. I'm not sure if it's a good idea to fix automatically without throwing a warning. This PR only contains fixes to automapping logic.
After the fix, the export after automap will load normally without error.
Remove-me-section
Generic request
#1234 – issue name