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

Support parsing KET file for macromolecules on ketcher side #3230

Closed
rrodionov91 opened this issue Aug 31, 2023 · 0 comments · Fixed by #3292
Closed

Support parsing KET file for macromolecules on ketcher side #3230

rrodionov91 opened this issue Aug 31, 2023 · 0 comments · Fixed by #3292

Comments

@rrodionov91
Copy link
Collaborator

rrodionov91 commented Aug 31, 2023

Requirements

It needs to render monomers and connections from KET file. Specification of KET format for macromolecules:
KET_macromolecules_specification.pdf
In case of variant monomers/monomers groups/hydrogene connections or connections without the link to monomers it needs to show an error.

Implementation details

Algorithm is following:

  1. Iterate over an root.nodes array.
    1.1. If node.type === 'monomer' then create a command for new Monomer creation. Fields origin.x, origin.y should be used for coordinates. Field templateId should be used to find the template in library and take the type of monomer and label.
    1.2. If node.type === 'group' then show error.
    2.1. If node.connectionType === 'single' and node.endPoint1.monomerId !== undefined then create new PolymerBond by using endPoint1.monomerId and endPoint2.monomerId fields as a reference to monomers and endPoint1.attachmentPointId and endPoint2.attachmentPointId as attachment points. if there is no attachmentPointId field for some endPoint then do not set a specific attachment point to Monomer, just create a bond. Show error if node.endPoint1.monomerId === undefined or node.endPoint2.monomerId === undefined or node.connectionType !== 'single'
@rrodionov91 rrodionov91 self-assigned this Aug 31, 2023
@rrodionov91 rrodionov91 added this to the Polymer Editor MVP milestone Sep 5, 2023
rrodionov91 added a commit that referenced this issue Sep 12, 2023
- added ket macromolecules deserializer for monomers and bonds
- changed entities coordinate system to angstrems
rrodionov91 added a commit that referenced this issue Sep 12, 2023
- added ket macromolecules deserializer for monomers and bonds
- changed entities coordinate system to angstrems
@rrodionov91 rrodionov91 linked a pull request Sep 12, 2023 that will close this issue
9 tasks
rrodionov91 added a commit that referenced this issue Sep 13, 2023
- added ket macromolecules deserializer for monomers and bonds
- changed entities coordinate system to angstrems
rrodionov91 added a commit that referenced this issue Sep 15, 2023
- added ket macromolecules deserializer for monomers and bonds
- changed entities coordinate system to angstrems
rrodionov91 added a commit that referenced this issue Sep 18, 2023
…3292)

* #3230 - Support parsing KET file for macromolecules on ketcher side
- added ket macromolecules deserializer for monomers and bonds
- changed entities coordinate system to angstrems

* #3231 - Support serializing canvas to KET format for macromolecules on ketcher side
- added ket macromolecules serializer for monomers and bonds

---------

Co-authored-by: Roman Rodionov <roman_rodionov@epam.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant