Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to define attachment points for molecules #4530

Closed
rrodionov91 opened this issue Apr 24, 2024 · 3 comments · Fixed by #4598, #4695 or #4727
Closed

Add ability to define attachment points for molecules #4530

rrodionov91 opened this issue Apr 24, 2024 · 3 comments · Fixed by #4598, #4695 or #4727
Assignees
Labels
feature request Test Cases Written Test cases has been written for that issue

Comments

@rrodionov91
Copy link
Collaborator

rrodionov91 commented Apr 24, 2024

Background
Currently there is no way to define attachment points for molecules, so it is not possible to connect them in macromolecules mode with monomer.

Solution
New items should be added to atom context menu: Add attachment point, Remove attachment point. It should appear only for atoms which are NOT part of s-group.

When add attachment point, system should create new superatom s-group for whole structure implicitly without label. System should draw label(R1/.../R8) depends on next free attachment point number and single bond from atom to that label. If all 8 attachment points exist in structure system should NOT create attachment point.

System should NOT allow to show brackets and collapse superatoms without labels.

When remove attachment point system should delete label and corresponding bond. When last attachment point deleted system should delete s-group superatom.

Such attachment points should be converted into monomer attachment points during the switching to macromolecules mode and vice versa.

System should save such attachment points to sgroup.attachmentPoints field during the serialization to ket format and should set leavingGroup new atom H.

Extra info:

  1. What happens if I apply R-Group on AP label?
    No, since AP is not an atom - its a label connected to atom by bond (we can do that with atom AP label connected to)

  2. Can I wrap atom/molecule with AP to R-Group fragment tool?
    No, since AP is not an atom - its a label connected to atom by bond (we can do that with atom AP label connected to)

  3. Can I attach "old" AP to new AP?
    No, since AP is not an atom - its a label connected to atom by bond (we can do that with atom AP label connected to)

  4. Can I charge (A+/A-) AP?
    No, since AP is not an atom - its a label connected to atom by bond (we can do that with atom AP label connected to)

  5. Can I bond AP with bond? (i.e. attach bond to AP)
    No, since AP is not an atom - its a label connected to atom by bond (we can do that with atom AP label connected to)

  6. Erase logic (since system enumerate AP automatically). What if we have R1, R2, R3 and I delete R2 and add NEW AP? What if we have R1-R8 in place and I delete R2 and try to add new AP?
    Gaps should start be filled if we rich the R8 (later this will be changed to let user choose AP name himself)

  7. Selection logic? Partial selection? Should selection be saved in KET?
    Selection should work the same as for atoms but without saving selection state in KET file
    Extra work over selection login is needed here. Will be done separatedy

  8. Items in context menu? Context menu if selected together with bond and atom?
    Only Delete item should be remain in the context menu for now

  9. Open from IMAGE?
    Load from image is not supported

  10. Should we support save to:
    We support all formats that support s-groups and attachment points
    If no - just got it lost in save file + warning in save dialog

    • MOL 2000 - YES
    • MOL 3000 - YES
    • SDF 2000 - YES
    • SDF 3000 - YES
    • SMARTS - NO
    • SMILES - NO
    • Extended SMILES - YES C[C@H](n)C(*)=O |$;;;_AP1;;_AP2;$|
    • CML - YES (?)
    • InChl - NO
    • InChl Auxinfo - NO
    • InChlKey - NO
    • PNG IMAGE - YES
    • CDXML - YES
    • Base64 CDX - YES
    • CDX - YES
  11. Copy/Cut/Paste logic?
    Should work if at least one atom is selected for copy, if only AP label - than NO

  12. Undo/Redo logic since we have two Undo/Redo sequences in Micro and Macro - how to resolve conflicts? Invalidate?
    Switching between Micro and Macro should invalidated Undo-Redo sequence

  13. Aromatize/Dearomatize should work
    Yes.

  14. Layout should work
    Yes. (AP label behave as atom)

  15. Clean Up should work
    Yes.

  16. Calculate CIPs should work
    Yes.

  17. Structure Check should work
    Yes.

  18. Calculate values should work (? - doesn't work for R-Groups now)
    Yes. (probably will require to to correct indigo - leaving group should disappear

  19. 3D view should work
    No, should be hydrogen in there. Should not crash

  20. Bond between micro and macro - can we edit it and change its type? Set query properties?
    No. We shouldn't allow that

  21. Connect molecule over AP? Should we allow?
    Yes. But no extra dialogs (such as Remove abbreviation) should appear. Connection should be established but AP info should remain virtually in memory and should appear back if we delete bond. Should remain even after save/load to ket/mol3000. Should be visual indication on the canvas in the same manner as if it done in Marvin

  22. Since AP is s-group - should we allow Remove Abbreviation?
    No. Never. it is not an s-group

  23. Stand alone connection point since it is s-group?
    No. it is not.

  24. Is it possible to connect AP to single atom?
    Yes we can

Open questions
25. Label numbering - allow users to set
26. Label/living group operations
27. Undo/Redo - inclusion of mode switching in it - is this a bug? Valentin sees that yes, but Roman claims that this is what they wanted. It looks like a crutch. Sasha was always against it.

@Zhirnoff
Copy link
Collaborator

Zhirnoff commented May 6, 2024

Tests added to the automation table.

@Zhirnoff Zhirnoff added the Test Cases Written Test cases has been written for that issue label May 6, 2024
@rrodionov91 rrodionov91 self-assigned this May 9, 2024
rrodionov91 added a commit that referenced this issue May 9, 2024
…hem attachment points in macromolecules mode

- unblocked rglabels to attachment points conversion for molecules
rrodionov91 added a commit that referenced this issue May 10, 2024
…hem attachment points in macromolecules mode (#4598)

- unblocked rglabels to attachment points conversion for molecules
- added validation for attachment points creation from rglabels
@AlexeyGirin AlexeyGirin self-assigned this May 13, 2024
@AlexeyGirin
Copy link
Collaborator

Verified.

  • Indigo Toolkit Version 1.20.0-dev.1.32-gf28bad61-wasm32-wasm-clang-12.0.0
  • Ketcher Version 2.21.0-rc.2 Build at 2024-05-13; 05:32:02
  • Chrome Version 124.0.6367.201 (Official Build) (64-bit)
  • Windows 10

@rrodionov91 rrodionov91 changed the title Convert Rx connection points created in molecules mode into chem attachment points in macromolecules mode Add ability to define attachment points for molecules May 17, 2024
@rrodionov91 rrodionov91 reopened this May 17, 2024
@rrodionov91
Copy link
Collaborator Author

Reopened due to requirements change.

@AlexeyGirin AlexeyGirin removed the Test Cases Written Test cases has been written for that issue label May 17, 2024
rrodionov91 added a commit that referenced this issue May 27, 2024
- added conversion of molecules to superatoms without label after adding superatom attachment points
- added connections between molecules and monomers
@rrodionov91 rrodionov91 linked a pull request May 27, 2024 that will close this issue
9 tasks
rrodionov91 added a commit that referenced this issue May 30, 2024
- added conversion of molecules to superatoms without label after adding superatom attachment points
- added connections between molecules and monomers
@AlexeyGirin AlexeyGirin added the Test Cases Written Test cases has been written for that issue label May 31, 2024
rrodionov91 added a commit that referenced this issue May 31, 2024
- added conversion of molecules to superatoms without label after adding superatom attachment points
- added connections between molecules and monomers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment