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

Fullerene and 3D molecules are not represented as 3D in the Miew 3D window #4291

Closed
AlexeyGirin opened this issue Mar 21, 2024 · 5 comments
Closed
Assignees
Labels
bug CDX-ChemDraw Bucket: Save/View/Open of CDX forrmat related issues Priority: Medium
Projects

Comments

@AlexeyGirin
Copy link
Collaborator

Steps to Reproduce

  1. Open CDX file from ChemDraw (Fullerene and 3D molecules)
    image

  2. Ketcher Mview
    image

Actual behavior
Fullerene and 3D molecules are not represented as 3D in the Miew 3D window.
Kindly see pictures.
Task #4232

Expected behavior
Fullerene and 3D molecules should be represented as 3D in the Miew 3D window.

Attachments
FullereneCDX-example.zip

Environment details:
• OS: Windows 10 Pro (version 22H2) x64
• Browser: Сhrome
• Version: (122.0.6261.95) x64

Ketcher version 2.19.0 – rc.2
Indigo Toolkit
Version 1.18.0-rc.6.0-g98bf384e0-x86_64-linux-gnu-11.2.1

@AlexeyGirin
Copy link
Collaborator Author

Moved to Refined Backlog since no fix over 2 versions

@NataliaLoginova
Copy link
Collaborator

The issue was partially fixed in PR #3501 3d mol files appear as 2D in Miew

@AlexeyGirin
Copy link
Collaborator Author

AlexeyGirin commented May 7, 2024

Check with @even1024 if it is indigo problem and move to Indigo if yes
@NataliaLoginova will bring here her investigation results from ketcher side

@baranovdv
Copy link
Collaborator

If we open or save file in Ketcher, there are two different conversion flows(depends on file extension):

  • .ket/.mol - Ketcher converts the file using its own methods
  • Other extensions - Ketcher sends the contents of the file to the Indigo API to receive a file in .ket format

For example, there is 3D molecule from Chem3D app:

image image

It’s saved in .cdx format
If we open this file in Ketcher. It will make API call to Indigo with such data:

format: "ket" options: { "smart-layout": true, "ignore-stereochemistry-errors": true, "mass-skip-error-on-pseudoatoms": false, "gross-formula-add-rsites": true, "aromatize-skip-superatoms": true, "dearomatize-on-load": false, "ignore-no-chiral-flag": false } struct: "base64::VmpDRDAxMDAEAwIBAAAAAAAAAAAAAAAAAAAAAAUIBAAAAB4AGggCAAMAGwgCAAQAAAEkAAAAAgACAOn9BQBBcmlhbAMA6f0PAFRpbWVzIE5ldyBSb21hbgADMgAIAP///////wAAAAAAAP//AAAAAP////8AAAAA//8AAAAA/////wAAAAD/////AAD//wGAAAAAABAIAgABAA8IAgABAAOABAAAAASABQAAAAACCAAxk1AAikVDAAAABIAGAAAAAgQCAAgAKwQCAAAAAAIIAGW+WwDEumYABoAAAAAAAAIIAGW+WwDEumYAIwgBAAAABw0AAQAAAAMAYADIAAAATwAAAAAEgAcAAAACBAIAEAArBAIAAAAAAggABXogAMaTQQAGgAAAAAAAAggABXogAMaTQQAjCAEAAAAHDQABAAAAAwBgAMgAAABTAAAAAASACAAAAAIEAgABAAACCADH4VoAHbo1AAaAAAAAAAACCADH4VoAHbo1ACMIAQAAAAcNAAEAAAADAGAAyAAAAEgAAAAABIAJAAAAAgQCAAEAAAIIANHjWgC3tjUABoAAAAAAAAIIANHjWgC3tjUAIwgBAAAABw0AAQAAAAMAYADIAAAASAAAAAAEgAoAAAACBAIAAQAAAggAPLh0AEZ6ZgAGgAAAAAAAAggAPLh0AEZ6ZgAjCAEAAAAHDQABAAAAAwBgAMgAAABIAAAAAASACwAAAAIEAgABAAACCAAAAB4AAAAeAAaAAAAAAAACCAAAAB4AAAAeACMIAQAAAAcNAAEAAAADAGAAyAAAAEgAAAAABYAMAAAABAYEAAUAAAAFBgQABgAAAAAABYANAAAABAYEAAUAAAAFBgQABwAAAAAABYAOAAAABAYEAAUAAAAFBgQACAAAAAAABYAPAAAABAYEAAUAAAAFBgQACQAAAAAABYAQAAAABAYEAAYAAAAFBgQACgAAAAAABYARAAAABAYEAAcAAAAFBgQACwAAAAAAAAAAAAAAAAA="

Indigo responses with such .ket file:
{ "root": { "nodes": [ { "$ref": "mol0" } ] }, "mol0": { "type": "molecule", "atoms": [ { "label": "C", "location": [ 2.242333173751831, -2.685666561126709, 0.0 ] }, { "label": "O", "location": [ 3.424333333969116, -3.057999849319458, 0.0 ] }, { "label": "S", "location": [ 2.186000108718872, -1.0826666355133057, 0.0 ] }, { "label": "H", "location": [ 1.7910000085830689, -3.0293333530426027, 0.0 ] }, { "label": "H", "location": [ 1.7903332710266114, -3.0296666622161867, 0.0 ] }, { "label": "H", "location": [ 3.4160001277923586, -3.8906667232513429, 0.0 ] }, { "label": "H", "location":[ 1.0, -1.0, 0.0 ] } ], "bonds":[ { "type": 1, "atoms": [ 0, 1 ] }, { "type": 1, "atoms": [ 0, 2 ] }, { "type": 1, "atoms": [ 0, 3 ] }, { "type": 1, "atoms": [ 0, 4 ] }, { "type": 1, "atoms": [ 1, 5 ] }, { "type": 1, "atoms": [ 2, 6 ] } ] } }

All z-axis coordinates are zeroed, that causes 2D style drawing of molecule in Miew:
image

Correct .ket file should be like that:
{ "root": { "nodes": [ { "$ref": "mol0" } ], "connections": [], "templates": [] }, "mol0": { "type": "molecule", "atoms": [ { "label": "C", "location": [ 9.230228843914343, -5.76550492482726, 0.00017677686499614848 ] }, { "label": "O", "location": [ 10.412158963278591, -6.137797002509149, 0.00017677686499614848 ] }, { "label": "S", "location": [ 9.173748635548073, -4.162227147744692, 0.00017677686499614848 ] }, { "label": "H", "location": [ 8.77874073071418, -6.109070761947275, -0.803450851407495 ] }, { "label": "H", "location": [ 8.77829878855169, -6.10933592724477, 0.803450851407495 ] }, { "label": "H", "location": [ 10.403762062191275, -6.97032764820851, 0.00017677686499614848 ] }, { "label": "H", "location": [ 7.987841036721411, -4.079672351791491, 0.00017677686499614848 ] } ], "bonds": [ { "type": 1, "atoms": [ 0, 1 ] }, { "type": 1, "atoms": [ 0, 2 ] }, { "type": 1, "atoms": [ 0, 3 ] }, { "type": 1, "atoms": [ 0, 4 ] }, { "type": 1, "atoms": [ 1, 5 ] }, { "type": 1, "atoms": [ 2, 6 ] } ] } }

This .ket file Indigo converts to .cml correctly and Miew draws 3D molecule:
image

@AlexeyGirin
Copy link
Collaborator Author

Moved to Indigo - epam/Indigo#1944

@AlexeyGirin AlexeyGirin closed this as not planned Won't fix, can't repro, duplicate, stale May 7, 2024
@AlexeyGirin AlexeyGirin removed this from the Ketcher 2.22.0-rc.1 milestone May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug CDX-ChemDraw Bucket: Save/View/Open of CDX forrmat related issues Priority: Medium
Projects
Ketcher
  
Awaiting triage
Development

No branches or pull requests

5 participants