Export Ketcher File from Editor

Q

How to export structure from Ketcher editor in Ketcher file format?

✍: FYIcenter.com

A

The best way to learn the Ketcher file format is to export different types of chemical structures for the Ketcher editor in Ketcher file format as described below:

1. Open Ketcher editor as shown in previous tutorials.

2. Select the "Benzene" button in the template toolbar at the bottom of the editor window to create the benzene molecule structure in the editor.

3. Click the "Save as" icon in the action toolbar at the top of the editor window. You see the "Save Structure" dialog box displayed.

4. Select "Ket Format" from the "File Format" dropdown list. You see that the structure from the Ketcher editor presented in Ketcher file format.

5. Click "Save" button on the dialog box. The structure is saved as "ketcher.ket" in download directory on your local computer.

Export Structure in Ketcher File Format
Export Structure in Ketcher File Format

6. Open "ketcher.ket" file in a text editor. You see the following Ketcher file:

{
    "root": {
        "nodes": [
            {
                "$ref": "mol0"
            }
        ]
    },
    "mol0": {
        "type": "molecule",
        "atoms": [
            {
                "label": "C",
                "location": [
                    0.8348491521285663,
                    -1.000074417174607,
                    0
                ]
            },
            {
                "label": "C",
                "location": [
                    2.565150847871434,
                    -0.9995892291772028,
                    0
                ]
            },
            {
                "label": "C",
                "location": [
                    1.7016375094912393,
                    -0.49996688885018736,
                    0
                ]
            },
            {
                "label": "C",
                "location": [
                    2.565150847871434,
                    -2.0005320678221477,
                    0
                ]
            },
            {
                "label": "C",
                "location": [
                    0.8348491521285663,
                    -2.005020056798137,
                    0
                ]
            },
            {
                "label": "C",
                "location": [
                    1.7038208554795584,
                    -2.500033111149812,
                    0
                ]
            }
        ],
        "bonds": [
            {
                "type": 2,
                "atoms": [
                    2,
                    0
                ]
            },
            {
                "type": 2,
                "atoms": [
                    3,
                    1
                ]
            },
            {
                "type": 1,
                "atoms": [
                    0,
                    4
                ]
            },
            {
                "type": 1,
                "atoms": [
                    1,
                    2
                ]
            },
            {
                "type": 2,
                "atoms": [
                    4,
                    5
                ]
            },
            {
                "type": 1,
                "atoms": [
                    5,
                    3
                ]
            }
        ]
    }
}

As you can see, this Ketcher file contains 1 referenced-object named as "mol0":

            {
                "$ref": "mol0"
            }

 

Import Ketcher File to Editor

Ketcher File Structure

Ketcher File Format for Chemical Structures

⇑⇑ Ketcher - Chemical Structure Editor

2024-03-23, 184🔥, 0💬