diff --git a/api/c/indigo/indigo.h b/api/c/indigo/indigo.h index 82f6a39f85..bf5b84c763 100644 --- a/api/c/indigo/indigo.h +++ b/api/c/indigo/indigo.h @@ -501,6 +501,9 @@ CEXPORT int indigoCountHydrogens(int item, int* hydro); // Applicable to non-query molecules and atoms. CEXPORT int indigoCountImplicitHydrogens(int item); +// Calculate macromolecule properties. Return Json string with properties. +CEXPORT const char* indigoMacroProperties(int object); + // On success, returns always the same pointer to a 3-element array; // you should not free() it, but rather memcpy() it if you want to keep it. CEXPORT float* indigoXYZ(int atom); diff --git a/api/c/indigo/src/indigo_misc.cpp b/api/c/indigo/src/indigo_misc.cpp index b897483e78..f02237ec41 100644 --- a/api/c/indigo/src/indigo_misc.cpp +++ b/api/c/indigo/src/indigo_misc.cpp @@ -1699,6 +1699,26 @@ CEXPORT const char* indigoJson(int item) INDIGO_END(0); } +CEXPORT const char* indigoMacroProperties(int object) +{ + INDIGO_BEGIN + { + auto& tmp = self.getThreadTmpData(); + ArrayOutput out(tmp.string); + + IndigoObject& obj = self.getObject(object); + + if (IndigoBaseMolecule::is(obj) || IndigoBaseReaction::is(obj) || IndigoKetDocument::is(obj)) + { + auto& doc = obj.getKetDocument(); + doc.CalculateMacroProps(out, self.json_saving_pretty); + } + out.writeChar(0); + return tmp.string.ptr(); + } + INDIGO_END(0); +} + CEXPORT const char* indigoGetOriginalFormat(int item) { INDIGO_BEGIN diff --git a/api/dotnet/src/IndigoLib.cs b/api/dotnet/src/IndigoLib.cs index 7c7c5984b8..8a0a1a78e6 100644 --- a/api/dotnet/src/IndigoLib.cs +++ b/api/dotnet/src/IndigoLib.cs @@ -95,6 +95,9 @@ public unsafe class IndigoLib [DllImport("indigo"), SuppressUnmanagedCodeSecurity] public static extern int indigoClose(int item); + [DllImport("indigo"), SuppressUnmanagedCodeSecurity] + public static extern byte* indigoMacroProperties(int id); + [DllImport("indigo"), SuppressUnmanagedCodeSecurity] public static extern byte* indigoGetOriginalFormat(int id); diff --git a/api/dotnet/src/IndigoObject.cs b/api/dotnet/src/IndigoObject.cs index f92bc3df46..dcb204edf7 100644 --- a/api/dotnet/src/IndigoObject.cs +++ b/api/dotnet/src/IndigoObject.cs @@ -138,6 +138,12 @@ public string cml() return dispatcher.checkResult(IndigoLib.indigoCml(self)); } + public string macroProperties() + { + dispatcher.setSessionID(); + return dispatcher.checkResult(IndigoLib.indigoMacroProperties(self)); + } + public string getOriginalFormat() { dispatcher.setSessionID(); diff --git a/api/java/indigo/src/main/java/com/epam/indigo/IndigoLib.java b/api/java/indigo/src/main/java/com/epam/indigo/IndigoLib.java index d5b0175f32..5e17e65d27 100644 --- a/api/java/indigo/src/main/java/com/epam/indigo/IndigoLib.java +++ b/api/java/indigo/src/main/java/com/epam/indigo/IndigoLib.java @@ -87,6 +87,8 @@ public interface IndigoLib extends Library { int indigoRemove(int item); + Pointer indigoMacroProperties(int item); + Pointer indigoGetOriginalFormat(int item); int indigoCreateMolecule(); diff --git a/api/java/indigo/src/main/java/com/epam/indigo/IndigoObject.java b/api/java/indigo/src/main/java/com/epam/indigo/IndigoObject.java index 6c31b110bf..5ee006b2ff 100644 --- a/api/java/indigo/src/main/java/com/epam/indigo/IndigoObject.java +++ b/api/java/indigo/src/main/java/com/epam/indigo/IndigoObject.java @@ -102,6 +102,11 @@ public String helm(IndigoObject library) { return Indigo.checkResultString(this, lib.indigoHelm(self, library.self)); } + public String macroProperties() { + dispatcher.setSessionID(); + return Indigo.checkResultString(this, lib.indigoMacroProperties(self)); + } + public String getOriginalFormat() { dispatcher.setSessionID(); return Indigo.checkResultString(this, lib.indigoGetOriginalFormat(self)); diff --git a/api/python/indigo/indigo/indigo_lib.py b/api/python/indigo/indigo/indigo_lib.py index 38d2b618b9..a498854cfe 100644 --- a/api/python/indigo/indigo/indigo_lib.py +++ b/api/python/indigo/indigo/indigo_lib.py @@ -286,6 +286,8 @@ def __init__(self) -> None: IndigoLib.lib.indigoIndex.argtypes = [c_int] IndigoLib.lib.indigoRemove.restype = c_int IndigoLib.lib.indigoRemove.argtypes = [c_int] + IndigoLib.lib.indigoMacroProperties.restype = c_char_p + IndigoLib.lib.indigoMacroProperties.argtypes = [c_int] IndigoLib.lib.indigoGetOriginalFormat.restype = c_char_p IndigoLib.lib.indigoGetOriginalFormat.argtypes = [c_int] IndigoLib.lib.indigoSaveMolfileToFile.restype = c_int diff --git a/api/python/indigo/indigo/indigo_object.py b/api/python/indigo/indigo/indigo_object.py index 532439d22c..4c01e98ebe 100644 --- a/api/python/indigo/indigo/indigo_object.py +++ b/api/python/indigo/indigo/indigo_object.py @@ -236,6 +236,17 @@ def remove(self): return IndigoLib.checkResult(self._lib().indigoRemove(self.id)) + def macroProperties(self): + """Method return macro-molecules properties + + Returns: + str: json with properties + """ + + return IndigoLib.checkResultString( + self._lib().indigoMacroProperties(self.id) + ) + def getOriginalFormat(self): """Molecule method return format molecule loaded from diff --git a/api/tests/integration/ref/formats/macromol_props.py.out b/api/tests/integration/ref/formats/macromol_props.py.out new file mode 100644 index 0000000000..1848a0425e --- /dev/null +++ b/api/tests/integration/ref/formats/macromol_props.py.out @@ -0,0 +1,4 @@ +*** HELM to KET *** +props_double_dna.json: SUCCEED +props_peptides.json: SUCCEED +props_peptides_micro.json: SUCCEED diff --git a/api/tests/integration/tests/formats/macromol_props.py b/api/tests/integration/tests/formats/macromol_props.py new file mode 100644 index 0000000000..f8f842f2e6 --- /dev/null +++ b/api/tests/integration/tests/formats/macromol_props.py @@ -0,0 +1,56 @@ +import difflib +import os +import sys + + +def find_diff(a, b): + return "\n".join(difflib.unified_diff(a.splitlines(), b.splitlines())) + + +sys.path.append( + os.path.normpath( + os.path.join(os.path.abspath(__file__), "..", "..", "..", "common") + ) +) +from env_indigo import ( # noqa + Indigo, + IndigoException, + getIndigoExceptionText, + joinPathPy, +) + +indigo = Indigo() +indigo.setOption("json-saving-pretty", True) +indigo.setOption("ignore-stereochemistry-errors", True) + +print("*** HELM to KET ***") + +root = joinPathPy("molecules/", __file__) +ref = joinPathPy("ref/", __file__) + +macro_data = [ + "props_double_dna", + "props_peptides", + "props_peptides_micro", +] + +lib = indigo.loadMonomerLibraryFromFile( + os.path.join(ref, "monomer_library.ket") +) + +for filename in sorted(macro_data): + mol = indigo.loadKetDocumentFromFile(os.path.join(root, filename + ".ket")) + try: + props = mol.macroProperties() + except IndigoException as e: + print("Test '%s' filed: %", (filename, getIndigoExceptionText(e))) + # with open(os.path.join(ref, filename) + ".json", "w") as file: + # file.write(props) + with open(os.path.join(ref, filename) + ".json", "r") as file: + props_ref = file.read() + diff = find_diff(props_ref, props) + if not diff: + print(filename + ".json: SUCCEED") + else: + print(filename + ".json: FAILED") + print(diff) diff --git a/api/tests/integration/tests/formats/molecules/props_double_dna.ket b/api/tests/integration/tests/formats/molecules/props_double_dna.ket new file mode 100644 index 0000000000..e63769bf04 --- /dev/null +++ b/api/tests/integration/tests/formats/molecules/props_double_dna.ket @@ -0,0 +1,1836 @@ +{ + "root": { + "nodes": [ + { + "$ref": "monomer0" + }, + { + "$ref": "monomer1" + }, + { + "$ref": "monomer2" + }, + { + "$ref": "monomer3" + }, + { + "$ref": "monomer4" + }, + { + "$ref": "monomer5" + }, + { + "$ref": "monomer6" + }, + { + "$ref": "monomer7" + }, + { + "$ref": "monomer8" + }, + { + "$ref": "monomer9" + }, + { + "$ref": "monomer10" + }, + { + "$ref": "monomer11" + }, + { + "$ref": "monomer12" + }, + { + "$ref": "monomer13" + }, + { + "$ref": "monomer14" + }, + { + "$ref": "monomer15" + }, + { + "$ref": "monomer16" + }, + { + "$ref": "monomer17" + }, + { + "$ref": "monomer18" + }, + { + "$ref": "monomer19" + }, + { + "$ref": "monomer20" + }, + { + "$ref": "monomer21" + }, + { + "$ref": "monomer22" + }, + { + "$ref": "monomer23" + } + ], + "connections": [ + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer0", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer1", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer1", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer2", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer3", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer4", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer4", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer5", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer6", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer7", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer2", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer4", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer5", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer7", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer8", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer9", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer9", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer10", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer11", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer12", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer12", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer13", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer14", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer15", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer10", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer12", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer13", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer15", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "hydrogen", + "endpoint1": { + "monomerId": "monomer14" + }, + "endpoint2": { + "monomerId": "monomer0" + } + }, + { + "connectionType": "hydrogen", + "endpoint1": { + "monomerId": "monomer11" + }, + "endpoint2": { + "monomerId": "monomer3" + } + }, + { + "connectionType": "hydrogen", + "endpoint1": { + "monomerId": "monomer8" + }, + "endpoint2": { + "monomerId": "monomer6" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer16", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer17", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer17", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer18", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer19", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer20", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer21", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer22", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer22", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer23", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer18", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer20", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "hydrogen", + "endpoint1": { + "monomerId": "monomer21" + }, + "endpoint2": { + "monomerId": "monomer16" + } + } + ], + "templates": [ + { + "$ref": "monomerTemplate-A___Adenine" + }, + { + "$ref": "monomerTemplate-R___Ribose" + }, + { + "$ref": "monomerTemplate-P___Phosphate" + }, + { + "$ref": "monomerTemplate-C___Cytosine" + }, + { + "$ref": "monomerTemplate-G___Guanine" + }, + { + "$ref": "monomerTemplate-T___Thymine" + }, + { + "$ref": "monomerTemplate-U___Uracil" + } + ] + }, + "monomer0": { + "type": "monomer", + "id": "0", + "position": { + "x": 1.25, + "y": -2.75 + }, + "alias": "A", + "templateId": "A___Adenine" + }, + "monomerTemplate-A___Adenine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.0354, + 0.2498, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.0792, + -0.754, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.5057, + -0.2906, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.8177, + 1.1766, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.7031, + 2.1804, + 0 + ] + }, + { + "label": "N", + "location": [ + 0.7235, + 1.717, + 0 + ] + }, + { + "label": "N", + "location": [ + -2.3871, + -1.5034, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.5053, + -2.7168, + 0 + ] + }, + { + "label": "N", + "location": [ + -0.0787, + -2.2532, + 0 + ] + }, + { + "label": "N", + "location": [ + 2.1768, + -0.1209, + 0 + ] + }, + { + "label": "H", + "location": [ + -3.5871, + -1.5034, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 9 + ] + }, + { + "type": 2, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 10 + ] + }, + { + "type": 2, + "atoms": [ + 7, + 8 + ] + } + ], + "class": "Base", + "classHELM": "RNA", + "id": "A___Adenine", + "fullName": "Adenine", + "alias": "A", + "attachmentPoints": [ + { + "attachmentAtom": 6, + "leavingGroup": { + "atoms": [ + 10 + ] + }, + "type": "left" + } + ], + "naturalAnalogShort": "A" + }, + "monomer1": { + "type": "monomer", + "id": "1", + "position": { + "x": 1.25, + "y": -1.25 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomerTemplate-R___Ribose": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "O", + "location": [ + -1.1017, + -1.0663, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.5897, + 0.3436, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 0.0809, + -1.9889, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 0.9095, + 0.2924, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 1.3239, + -1.1493, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "O", + "location": [ + 1.8285, + 1.4755, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.4518, + -1.5589, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.431, + 1.5834, + 0 + ] + }, + { + "label": "O", + "location": [ + 0.0399, + -3.1881, + 0 + ] + }, + { + "label": "O", + "location": [ + -2.9279, + 1.4755, + 0 + ] + }, + { + "label": "H", + "location": [ + -3.6017, + 2.4684, + 0 + ] + }, + { + "label": "H", + "location": [ + 3.0174, + 1.3125, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 7 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 2, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 8 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 5 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 4, + 6 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 10 + ] + } + ], + "class": "Sugar", + "classHELM": "RNA", + "id": "R___Ribose", + "fullName": "Ribose", + "alias": "R", + "attachmentPoints": [ + { + "attachmentAtom": 9, + "leavingGroup": { + "atoms": [ + 10 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 5, + "leavingGroup": { + "atoms": [ + 11 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 2, + "leavingGroup": { + "atoms": [ + 8 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "R" + }, + "monomer2": { + "type": "monomer", + "id": "2", + "position": { + "x": 2.75, + "y": -1.25 + }, + "alias": "P", + "templateId": "P___Phosphate" + }, + "monomerTemplate-P___Phosphate": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "P", + "location": [ + -0.2399, + 0, + 0 + ] + }, + { + "label": "O", + "location": [ + -1.4399, + 0, + 0 + ] + }, + { + "label": "O", + "location": [ + 0.3598, + -1.0394, + 0 + ] + }, + { + "label": "O", + "location": [ + 0.9601, + 0, + 0 + ] + }, + { + "label": "O", + "location": [ + 0.3598, + 1.0394, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 4 + ] + } + ], + "class": "Phosphate", + "classHELM": "RNA", + "id": "P___Phosphate", + "fullName": "Phosphate", + "alias": "P", + "attachmentPoints": [ + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 1 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 3 + ] + }, + "type": "right" + } + ], + "idtAliases": { + "base": "Phos", + "modifications": { + "endpoint3": "3Phos", + "endpoint5": "5Phos" + } + }, + "naturalAnalogShort": "P" + }, + "monomer3": { + "type": "monomer", + "id": "3", + "position": { + "x": 4.25, + "y": -2.75 + }, + "alias": "C", + "templateId": "C___Cytosine" + }, + "monomerTemplate-C___Cytosine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.8617, + 1.3499, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.1117, + 2.6489, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.3882, + 2.649, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.1382, + 1.35, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.3883, + 0.0509, + 0 + ] + }, + { + "label": "N", + "location": [ + 1.1117, + 0.0509, + 0 + ] + }, + { + "label": "N", + "location": [ + 3.0618, + 1.3499, + 0 + ] + }, + { + "label": "O", + "location": [ + -0.9884, + -0.9883, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.3383, + 1.35, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 6 + ] + }, + { + "type": 2, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 2, + "atoms": [ + 4, + 7 + ] + } + ], + "class": "Base", + "classHELM": "RNA", + "id": "C___Cytosine", + "fullName": "Cytosine", + "alias": "C", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 8 + ] + }, + "type": "left" + } + ], + "naturalAnalogShort": "C" + }, + "monomer4": { + "type": "monomer", + "id": "4", + "position": { + "x": 4.25, + "y": -1.25 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomer5": { + "type": "monomer", + "id": "5", + "position": { + "x": 5.75, + "y": -1.25 + }, + "alias": "P", + "templateId": "P___Phosphate" + }, + "monomer6": { + "type": "monomer", + "id": "6", + "position": { + "x": 7.25, + "y": -2.75 + }, + "alias": "G", + "templateId": "G___Guanine" + }, + "monomerTemplate-G___Guanine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.0354, + 0.2498, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.0792, + -0.754, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.5057, + -0.2906, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.8177, + 1.1766, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.7031, + 2.1804, + 0 + ] + }, + { + "label": "N", + "location": [ + 0.7235, + 1.717, + 0 + ] + }, + { + "label": "N", + "location": [ + -2.3871, + -1.5034, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.5053, + -2.7168, + 0 + ] + }, + { + "label": "N", + "location": [ + -0.0787, + -2.2532, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.1768, + -0.1209, + 0 + ] + }, + { + "label": "N", + "location": [ + -0.9527, + 3.3542, + 0 + ] + }, + { + "label": "H", + "location": [ + -3.5871, + -1.5034, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 0, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 11 + ] + }, + { + "type": 2, + "atoms": [ + 7, + 8 + ] + } + ], + "class": "Base", + "classHELM": "RNA", + "id": "G___Guanine", + "fullName": "Guanine", + "alias": "G", + "attachmentPoints": [ + { + "attachmentAtom": 6, + "leavingGroup": { + "atoms": [ + 11 + ] + }, + "type": "left" + } + ], + "naturalAnalogShort": "G" + }, + "monomer7": { + "type": "monomer", + "id": "7", + "position": { + "x": 7.25, + "y": -1.25 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomer8": { + "type": "monomer", + "id": "8", + "position": { + "x": 7.224153240619644, + "y": -4.221560530130507 + }, + "alias": "A", + "templateId": "A___Adenine" + }, + "monomer9": { + "type": "monomer", + "id": "9", + "position": { + "x": 7.235035122660845, + "y": -5.518204214719301 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomer10": { + "type": "monomer", + "id": "10", + "position": { + "x": 5.764281325412832, + "y": -5.4746766865544965 + }, + "alias": "P", + "templateId": "P___Phosphate" + }, + "monomer11": { + "type": "monomer", + "id": "11", + "position": { + "x": 4.260881882041198, + "y": -4.112741709718486 + }, + "alias": "C", + "templateId": "C___Cytosine" + }, + "monomer12": { + "type": "monomer", + "id": "12", + "position": { + "x": 4.249999999999999, + "y": -5.463794804513293 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomer13": { + "type": "monomer", + "id": "13", + "position": { + "x": 2.8445374949991837, + "y": -5.452912922472095 + }, + "alias": "P", + "templateId": "P___Phosphate" + }, + "monomer14": { + "type": "monomer", + "id": "14", + "position": { + "x": 1.2758467593803484, + "y": -4.101859827677283 + }, + "alias": "G", + "templateId": "G___Guanine" + }, + "monomer15": { + "type": "monomer", + "id": "15", + "position": { + "x": 1.297610523462752, + "y": -5.518204214719299 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomer16": { + "type": "monomer", + "id": "16", + "position": { + "x": 10.408597899308097, + "y": -4.352488767416278 + }, + "alias": "A", + "templateId": "A___Adenine" + }, + "monomer17": { + "type": "monomer", + "id": "17", + "position": { + "x": 10.408597899308097, + "y": -2.8524887674162787 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomer18": { + "type": "monomer", + "id": "18", + "position": { + "x": 11.908597899308097, + "y": -2.8524887674162787 + }, + "alias": "P", + "templateId": "P___Phosphate" + }, + "monomer19": { + "type": "monomer", + "id": "19", + "position": { + "x": 13.422879224720925, + "y": -4.406898177622286 + }, + "alias": "T", + "templateId": "T___Thymine" + }, + "monomerTemplate-T___Thymine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.8617, + 1.3499, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.1117, + 0.0509, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.3883, + 0.0509, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.1382, + 1.35, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.3882, + 2.649, + 0 + ] + }, + { + "label": "N", + "location": [ + 1.1117, + 2.6489, + 0 + ] + }, + { + "label": "O", + "location": [ + 3.0618, + 1.3499, + 0 + ] + }, + { + "label": "O", + "location": [ + -0.9882, + 3.6882, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.3383, + 1.35, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.7117, + -0.9884, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 0, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 8 + ] + }, + { + "type": 2, + "atoms": [ + 4, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 9 + ] + } + ], + "class": "Base", + "classHELM": "RNA", + "id": "T___Thymine", + "fullName": "Thymine", + "alias": "T", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 8 + ] + }, + "type": "left" + } + ], + "naturalAnalogShort": "T" + }, + "monomer20": { + "type": "monomer", + "id": "20", + "position": { + "x": 13.422879224720925, + "y": -2.906898177622286 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomer21": { + "type": "monomer", + "id": "21", + "position": { + "x": 10.365070371143299, + "y": -5.854188489102093 + }, + "alias": "U", + "templateId": "U___Uracil" + }, + "monomerTemplate-U___Uracil": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.8617, + 1.3499, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.1117, + 0.0509, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.3883, + 0.0509, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.1382, + 1.35, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.3882, + 2.649, + 0 + ] + }, + { + "label": "N", + "location": [ + 1.1117, + 2.6489, + 0 + ] + }, + { + "label": "O", + "location": [ + 3.0618, + 1.3499, + 0 + ] + }, + { + "label": "O", + "location": [ + -0.9882, + 3.6882, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.3383, + 1.35, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 0, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 8 + ] + }, + { + "type": 2, + "atoms": [ + 4, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + } + ], + "class": "Base", + "classHELM": "RNA", + "id": "U___Uracil", + "fullName": "Uracil", + "alias": "U", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 8 + ] + }, + "type": "left" + } + ], + "naturalAnalogShort": "U" + }, + "monomer22": { + "type": "monomer", + "id": "22", + "position": { + "x": 10.35418848910209, + "y": -7.3575879324737175 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomer23": { + "type": "monomer", + "id": "23", + "position": { + "x": 11.85418848910209, + "y": -7.3575879324737175 + }, + "alias": "P", + "templateId": "P___Phosphate" + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/formats/molecules/props_peptides.ket b/api/tests/integration/tests/formats/molecules/props_peptides.ket new file mode 100644 index 0000000000..a53455db78 --- /dev/null +++ b/api/tests/integration/tests/formats/molecules/props_peptides.ket @@ -0,0 +1,1958 @@ +{ + "root": { + "nodes": [ + { + "$ref": "monomer0" + }, + { + "$ref": "monomer1" + }, + { + "$ref": "monomer2" + }, + { + "$ref": "monomer3" + }, + { + "$ref": "monomer4" + }, + { + "$ref": "monomer5" + }, + { + "$ref": "monomer6" + }, + { + "$ref": "monomer7" + }, + { + "$ref": "monomer8" + } + ], + "connections": [ + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer0", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer1", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer1", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer2", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer2", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer3", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer3", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer4", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer5", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer6", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer6", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer7", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer7", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer8", + "attachmentPointId": "R1" + } + } + ], + "templates": [ + { + "$ref": "monomerTemplate-A___Alanine" + }, + { + "$ref": "monomerTemplate-C___Cysteine" + }, + { + "$ref": "monomerTemplate-D___Aspartic acid" + }, + { + "$ref": "monomerTemplate-I___Isoleucine" + }, + { + "$ref": "monomerTemplate-U___Selenocysteine" + }, + { + "$ref": "monomerTemplate-N___Asparagine" + }, + { + "$ref": "monomerTemplate-F___Phenylalanine" + }, + { + "$ref": "monomerTemplate-R___Arginine" + }, + { + "$ref": "monomerTemplate-T___Threonine" + } + ] + }, + "monomer0": { + "type": "monomer", + "id": "0", + "position": { + "x": 1.25, + "y": -1.25 + }, + "alias": "A", + "templateId": "A___Alanine" + }, + "monomerTemplate-A___Alanine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "N", + "location": [ + -1.2549, + -0.392, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.272, + 0.2633, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + -0.3103, + 1.7393, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.0523, + -0.392, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.0829, + -1.5722, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.0353, + 0.2633, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.3334, + 0.0905, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 1, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 1, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 6 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "A___Alanine", + "fullName": "Alanine", + "alias": "A", + "attachmentPoints": [ + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 6 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 5 + ] + }, + "type": "right" + } + ], + "naturalAnalogShort": "A" + }, + "monomer1": { + "type": "monomer", + "id": "1", + "position": { + "x": 2.75, + "y": -1.25 + }, + "alias": "C", + "templateId": "C___Cysteine" + }, + "monomerTemplate-C___Cysteine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.4457, + -1.1333, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.1453, + -0.384, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 0.143, + 1.1168, + 0 + ] + }, + { + "label": "S", + "location": [ + -1.1573, + 1.8661, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.1551, + -1.1333, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.4475, + -2.3333, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.4842, + -0.532, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.1942, + -0.5331, + 0 + ] + }, + { + "label": "H", + "location": [ + -1.1591, + 3.0661, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 5, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 8 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "C___Cysteine", + "fullName": "Cysteine", + "alias": "C", + "attachmentPoints": [ + { + "attachmentAtom": 4, + "leavingGroup": { + "atoms": [ + 7 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 6 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 8 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "C" + }, + "monomer2": { + "type": "monomer", + "id": "2", + "position": { + "x": 4.25, + "y": -1.25 + }, + "alias": "D", + "templateId": "D___Aspartic acid" + }, + "monomerTemplate-D___Aspartic acid": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.631, + -1.5578, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.6327, + -2.7392, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.3507, + -0.8201, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "N", + "location": [ + -0.9295, + -1.5578, + 0 + ] + }, + { + "label": "H", + "location": [ + -1.9525, + -0.9669, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.3485, + 0.6575, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.9317, + 1.3952, + 0 + ] + }, + { + "label": "O", + "location": [ + -1.9542, + 0.8032, + 0 + ] + }, + { + "label": "O", + "location": [ + -0.9335, + 2.5766, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.6534, + -0.9658, + 0 + ] + }, + { + "label": "H", + "location": [ + 0.0851, + 3.1751, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 1, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 5 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 2, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 10 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "D___Aspartic acid", + "fullName": "Aspartic acid", + "alias": "D", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 4 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 9 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 8, + "leavingGroup": { + "atoms": [ + 10 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "D" + }, + "monomer3": { + "type": "monomer", + "id": "3", + "position": { + "x": 5.75, + "y": -1.25 + }, + "alias": "I", + "templateId": "I___Isoleucine" + }, + "monomerTemplate-I___Isoleucine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + -1.2557, + 1.6681, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.0245, + 0.9304, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 0.0268, + -0.5472, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "N", + "location": [ + -1.2536, + -1.2849, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.2766, + -0.694, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.3069, + -1.2849, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.3086, + -2.4664, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.3294, + -0.693, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.047, + 1.5223, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.2574, + 2.8495, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 1 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 5 + ] + }, + { + "type": 2, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 8 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 0, + 9 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "I___Isoleucine", + "fullName": "Isoleucine", + "alias": "I", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 4 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 5, + "leavingGroup": { + "atoms": [ + 7 + ] + }, + "type": "right" + } + ], + "naturalAnalogShort": "I" + }, + "monomer4": { + "type": "monomer", + "id": "4", + "position": { + "x": 7.25, + "y": -1.25 + }, + "alias": "U", + "templateId": "U___Selenocysteine" + }, + "monomerTemplate-U___Selenocysteine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "N", + "location": [ + -0.4339745962155608, + -1.0000000000000009, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.4320508075688785, + -0.5000000000000009, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 1.298076211353316, + -1.0000000000000027, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.1641016151377572, + -0.5000000000000027, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.298076211353316, + -2.0000000000000027, + 0 + ] + }, + { + "label": "H", + "location": [ + -1.3, + -0.5000000000000009, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.4320508075688785, + 0.4999999999999991, + 0 + ] + }, + { + "label": "Se", + "location": [ + -0.433974596215559, + 1.0000000000000009, + 0 + ] + }, + { + "label": "H", + "location": [ + -0.433974596215559, + 2, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 2, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 6 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "U___Selenocysteine", + "fullName": "Selenocysteine", + "alias": "U", + "attachmentPoints": [ + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 5 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 2, + "leavingGroup": { + "atoms": [ + 3 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 7, + "leavingGroup": { + "atoms": [ + 8 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "U" + }, + "monomer5": { + "type": "monomer", + "id": "5", + "position": { + "x": 1.25, + "y": -2.75 + }, + "alias": "N", + "templateId": "N___Asparagine" + }, + "monomerTemplate-N___Asparagine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.8929, + -1.4175, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.8947, + -2.5989, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.6127, + -0.6799, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "N", + "location": [ + -0.6676, + -1.4175, + 0 + ] + }, + { + "label": "H", + "location": [ + -1.6907, + -0.8266, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.6104, + 0.7978, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.6698, + 1.5354, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.6922, + 0.9434, + 0 + ] + }, + { + "label": "O", + "location": [ + -0.6716, + 2.7168, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.9153, + -0.8255, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.5341, + 1.7724, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 1, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 5 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 2, + "atoms": [ + 6, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 10 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "N___Asparagine", + "fullName": "Asparagine", + "alias": "N", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 4 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 9 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 7, + "leavingGroup": { + "atoms": [ + 10 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "N" + }, + "monomer6": { + "type": "monomer", + "id": "6", + "position": { + "x": 2.75, + "y": -2.75 + }, + "alias": "F", + "templateId": "F___Phenylalanine" + }, + "monomerTemplate-F___Phenylalanine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + -0.2052, + 2.5398, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.5064, + 3.286, + 0 + ] + }, + { + "label": "C", + "location": [ + -2.8032, + 2.5322, + 0 + ] + }, + { + "label": "C", + "location": [ + -2.7988, + 1.0322, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.4976, + 0.2861, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.2008, + 1.0398, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.0995, + 0.2905, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.1018, + -1.2103, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "N", + "location": [ + -0.1986, + -1.9596, + 0 + ] + }, + { + "label": "C", + "location": [ + 2.4022, + -1.9596, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.404, + -3.1596, + 0 + ] + }, + { + "label": "O", + "location": [ + 3.4407, + -1.3583, + 0 + ] + }, + { + "label": "H", + "location": [ + -1.2376, + -1.3593, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 2, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 6 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 9 + ] + }, + { + "type": 2, + "atoms": [ + 9, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 12 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "F___Phenylalanine", + "fullName": "Phenylalanine", + "alias": "F", + "attachmentPoints": [ + { + "attachmentAtom": 8, + "leavingGroup": { + "atoms": [ + 12 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 9, + "leavingGroup": { + "atoms": [ + 11 + ] + }, + "type": "right" + } + ], + "naturalAnalogShort": "F" + }, + "monomer7": { + "type": "monomer", + "id": "7", + "position": { + "x": 4.25, + "y": -2.75 + }, + "alias": "R", + "templateId": "R___Arginine" + }, + "monomerTemplate-R___Arginine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.7718, + -2.5891, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.7732, + -3.5337, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.7483, + -1.9994, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "N", + "location": [ + -0.2752, + -2.5891, + 0 + ] + }, + { + "label": "H", + "location": [ + -1.0932, + -2.1168, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.7464, + -0.8182, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.2771, + -0.2284, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.2789, + 0.9529, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.3024, + 1.5426, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.3042, + 2.7238, + 0 + ] + }, + { + "label": "N", + "location": [ + -0.4868, + 3.1971, + 0 + ] + }, + { + "label": "N", + "location": [ + -2.1227, + 3.1955, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.5892, + -2.1159, + 0 + ] + }, + { + "label": "H", + "location": [ + -0.4883, + 4.3786, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 1, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 5 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 10 + ] + }, + { + "type": 2, + "atoms": [ + 9, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 12 + ] + }, + { + "type": 1, + "atoms": [ + 10, + 13 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "R___Arginine", + "fullName": "Arginine", + "alias": "R", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 4 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 12 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 10, + "leavingGroup": { + "atoms": [ + 13 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "R" + }, + "monomer8": { + "type": "monomer", + "id": "8", + "position": { + "x": 5.75, + "y": -2.75 + }, + "alias": "T", + "templateId": "T___Threonine" + }, + "monomerTemplate-T___Threonine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.0488, + -1.2558, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.0481, + -2.4369, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.2297, + -0.5156, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "N", + "location": [ + -1.5081, + -1.2558, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.5321, + -0.6672, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.2289, + 0.9614, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "O", + "location": [ + 0.7944, + 1.551, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.251, + 1.5531, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.072, + -0.6661, + 0 + ] + }, + { + "label": "H", + "location": [ + 0.7866, + 2.7318, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 1, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 5 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 9 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "T___Threonine", + "fullName": "Threonine", + "alias": "T", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 4 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 8 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 6, + "leavingGroup": { + "atoms": [ + 9 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "T" + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/formats/molecules/props_peptides_micro.ket b/api/tests/integration/tests/formats/molecules/props_peptides_micro.ket new file mode 100644 index 0000000000..0373291c07 --- /dev/null +++ b/api/tests/integration/tests/formats/molecules/props_peptides_micro.ket @@ -0,0 +1,2135 @@ +{ + "root": { + "nodes": [ + { + "$ref": "monomer0" + }, + { + "$ref": "monomer1" + }, + { + "$ref": "monomer2" + }, + { + "$ref": "monomer3" + }, + { + "$ref": "monomer4" + }, + { + "$ref": "monomer5" + }, + { + "$ref": "monomer6" + }, + { + "$ref": "monomer7" + }, + { + "$ref": "monomer8" + }, + { + "$ref": "mol0" + }, + { + "$ref": "mol1" + } + ], + "connections": [ + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer0", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer1", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer1", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer2", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer2", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer3", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer3", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer4", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer5", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer6", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer6", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer7", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer7", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer8", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer4", + "attachmentPointId": "R2" + }, + "endpoint2": { + "moleculeId": "mol1", + "atomId": "4" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer8", + "attachmentPointId": "R2" + }, + "endpoint2": { + "moleculeId": "mol0", + "atomId": "2" + } + } + ], + "templates": [ + { + "$ref": "monomerTemplate-A___Alanine" + }, + { + "$ref": "monomerTemplate-C___Cysteine" + }, + { + "$ref": "monomerTemplate-D___Aspartic acid" + }, + { + "$ref": "monomerTemplate-I___Isoleucine" + }, + { + "$ref": "monomerTemplate-U___Selenocysteine" + }, + { + "$ref": "monomerTemplate-N___Asparagine" + }, + { + "$ref": "monomerTemplate-F___Phenylalanine" + }, + { + "$ref": "monomerTemplate-R___Arginine" + }, + { + "$ref": "monomerTemplate-T___Threonine" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 7.14937421436393, + -3.5324704155214057, + 0 + ] + }, + { + "label": "C", + "location": [ + 8.15062578563607, + -3.5324704155214057, + 0 + ] + }, + { + "label": "C", + "location": [ + 7.650050188048686, + -2.667529584478595, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 0 + ] + } + ] + }, + "mol1": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 8.759849152128567, + -0.625074417174607, + 0 + ] + }, + { + "label": "C", + "location": [ + 10.490150847871433, + -0.6245892291772028, + 0 + ] + }, + { + "label": "C", + "location": [ + 9.626637509491239, + -0.12496688885018736, + 0 + ] + }, + { + "label": "C", + "location": [ + 10.490150847871433, + -1.6255320678221479, + 0 + ] + }, + { + "label": "C", + "location": [ + 8.759849152128567, + -1.630020056798137, + 0 + ] + }, + { + "label": "C", + "location": [ + 9.628820855479558, + -2.125033111149812, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 2, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 4 + ] + }, + { + "type": 2, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 3, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + } + ] + }, + "monomer0": { + "type": "monomer", + "id": "0", + "position": { + "x": 1.25, + "y": -1.25 + }, + "alias": "A", + "templateId": "A___Alanine" + }, + "monomerTemplate-A___Alanine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "N", + "location": [ + -1.2549, + -0.392, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.272, + 0.2633, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + -0.3103, + 1.7393, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.0523, + -0.392, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.0829, + -1.5722, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.0353, + 0.2633, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.3334, + 0.0905, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 1, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 1, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 6 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "A___Alanine", + "fullName": "Alanine", + "alias": "A", + "attachmentPoints": [ + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 6 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 5 + ] + }, + "type": "right" + } + ], + "naturalAnalogShort": "A" + }, + "monomer1": { + "type": "monomer", + "id": "1", + "position": { + "x": 2.75, + "y": -1.25 + }, + "alias": "C", + "templateId": "C___Cysteine" + }, + "monomerTemplate-C___Cysteine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.4457, + -1.1333, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.1453, + -0.384, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 0.143, + 1.1168, + 0 + ] + }, + { + "label": "S", + "location": [ + -1.1573, + 1.8661, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.1551, + -1.1333, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.4475, + -2.3333, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.4842, + -0.532, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.1942, + -0.5331, + 0 + ] + }, + { + "label": "H", + "location": [ + -1.1591, + 3.0661, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 5, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 8 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "C___Cysteine", + "fullName": "Cysteine", + "alias": "C", + "attachmentPoints": [ + { + "attachmentAtom": 4, + "leavingGroup": { + "atoms": [ + 7 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 6 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 8 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "C" + }, + "monomer2": { + "type": "monomer", + "id": "2", + "position": { + "x": 4.25, + "y": -1.25 + }, + "alias": "D", + "templateId": "D___Aspartic acid" + }, + "monomerTemplate-D___Aspartic acid": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.631, + -1.5578, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.6327, + -2.7392, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.3507, + -0.8201, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "N", + "location": [ + -0.9295, + -1.5578, + 0 + ] + }, + { + "label": "H", + "location": [ + -1.9525, + -0.9669, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.3485, + 0.6575, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.9317, + 1.3952, + 0 + ] + }, + { + "label": "O", + "location": [ + -1.9542, + 0.8032, + 0 + ] + }, + { + "label": "O", + "location": [ + -0.9335, + 2.5766, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.6534, + -0.9658, + 0 + ] + }, + { + "label": "H", + "location": [ + 0.0851, + 3.1751, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 1, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 5 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 2, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 10 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "D___Aspartic acid", + "fullName": "Aspartic acid", + "alias": "D", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 4 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 9 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 8, + "leavingGroup": { + "atoms": [ + 10 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "D" + }, + "monomer3": { + "type": "monomer", + "id": "3", + "position": { + "x": 5.75, + "y": -1.25 + }, + "alias": "I", + "templateId": "I___Isoleucine" + }, + "monomerTemplate-I___Isoleucine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + -1.2557, + 1.6681, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.0245, + 0.9304, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 0.0268, + -0.5472, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "N", + "location": [ + -1.2536, + -1.2849, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.2766, + -0.694, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.3069, + -1.2849, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.3086, + -2.4664, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.3294, + -0.693, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.047, + 1.5223, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.2574, + 2.8495, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 1 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 5 + ] + }, + { + "type": 2, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 8 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 0, + 9 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "I___Isoleucine", + "fullName": "Isoleucine", + "alias": "I", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 4 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 5, + "leavingGroup": { + "atoms": [ + 7 + ] + }, + "type": "right" + } + ], + "naturalAnalogShort": "I" + }, + "monomer4": { + "type": "monomer", + "id": "4", + "position": { + "x": 7.25, + "y": -1.25 + }, + "alias": "U", + "templateId": "U___Selenocysteine" + }, + "monomerTemplate-U___Selenocysteine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "N", + "location": [ + -0.4339745962155608, + -1.0000000000000009, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.4320508075688785, + -0.5000000000000009, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 1.298076211353316, + -1.0000000000000027, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.1641016151377572, + -0.5000000000000027, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.298076211353316, + -2.0000000000000027, + 0 + ] + }, + { + "label": "H", + "location": [ + -1.3, + -0.5000000000000009, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.4320508075688785, + 0.4999999999999991, + 0 + ] + }, + { + "label": "Se", + "location": [ + -0.433974596215559, + 1.0000000000000009, + 0 + ] + }, + { + "label": "H", + "location": [ + -0.433974596215559, + 2, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 2, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 6 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "U___Selenocysteine", + "fullName": "Selenocysteine", + "alias": "U", + "attachmentPoints": [ + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 5 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 2, + "leavingGroup": { + "atoms": [ + 3 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 7, + "leavingGroup": { + "atoms": [ + 8 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "U" + }, + "monomer5": { + "type": "monomer", + "id": "5", + "position": { + "x": 1.25, + "y": -2.75 + }, + "alias": "N", + "templateId": "N___Asparagine" + }, + "monomerTemplate-N___Asparagine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.8929, + -1.4175, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.8947, + -2.5989, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.6127, + -0.6799, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "N", + "location": [ + -0.6676, + -1.4175, + 0 + ] + }, + { + "label": "H", + "location": [ + -1.6907, + -0.8266, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.6104, + 0.7978, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.6698, + 1.5354, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.6922, + 0.9434, + 0 + ] + }, + { + "label": "O", + "location": [ + -0.6716, + 2.7168, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.9153, + -0.8255, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.5341, + 1.7724, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 1, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 5 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 2, + "atoms": [ + 6, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 10 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "N___Asparagine", + "fullName": "Asparagine", + "alias": "N", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 4 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 9 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 7, + "leavingGroup": { + "atoms": [ + 10 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "N" + }, + "monomer6": { + "type": "monomer", + "id": "6", + "position": { + "x": 2.75, + "y": -2.75 + }, + "alias": "F", + "templateId": "F___Phenylalanine" + }, + "monomerTemplate-F___Phenylalanine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + -0.2052, + 2.5398, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.5064, + 3.286, + 0 + ] + }, + { + "label": "C", + "location": [ + -2.8032, + 2.5322, + 0 + ] + }, + { + "label": "C", + "location": [ + -2.7988, + 1.0322, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.4976, + 0.2861, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.2008, + 1.0398, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.0995, + 0.2905, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.1018, + -1.2103, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "N", + "location": [ + -0.1986, + -1.9596, + 0 + ] + }, + { + "label": "C", + "location": [ + 2.4022, + -1.9596, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.404, + -3.1596, + 0 + ] + }, + { + "label": "O", + "location": [ + 3.4407, + -1.3583, + 0 + ] + }, + { + "label": "H", + "location": [ + -1.2376, + -1.3593, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 2, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 6 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 9 + ] + }, + { + "type": 2, + "atoms": [ + 9, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 12 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "F___Phenylalanine", + "fullName": "Phenylalanine", + "alias": "F", + "attachmentPoints": [ + { + "attachmentAtom": 8, + "leavingGroup": { + "atoms": [ + 12 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 9, + "leavingGroup": { + "atoms": [ + 11 + ] + }, + "type": "right" + } + ], + "naturalAnalogShort": "F" + }, + "monomer7": { + "type": "monomer", + "id": "7", + "position": { + "x": 4.25, + "y": -2.75 + }, + "alias": "R", + "templateId": "R___Arginine" + }, + "monomerTemplate-R___Arginine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.7718, + -2.5891, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.7732, + -3.5337, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.7483, + -1.9994, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "N", + "location": [ + -0.2752, + -2.5891, + 0 + ] + }, + { + "label": "H", + "location": [ + -1.0932, + -2.1168, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.7464, + -0.8182, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.2771, + -0.2284, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.2789, + 0.9529, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.3024, + 1.5426, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.3042, + 2.7238, + 0 + ] + }, + { + "label": "N", + "location": [ + -0.4868, + 3.1971, + 0 + ] + }, + { + "label": "N", + "location": [ + -2.1227, + 3.1955, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.5892, + -2.1159, + 0 + ] + }, + { + "label": "H", + "location": [ + -0.4883, + 4.3786, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 1, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 5 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 10 + ] + }, + { + "type": 2, + "atoms": [ + 9, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 12 + ] + }, + { + "type": 1, + "atoms": [ + 10, + 13 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "R___Arginine", + "fullName": "Arginine", + "alias": "R", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 4 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 12 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 10, + "leavingGroup": { + "atoms": [ + 13 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "R" + }, + "monomer8": { + "type": "monomer", + "id": "8", + "position": { + "x": 5.75, + "y": -2.75 + }, + "alias": "T", + "templateId": "T___Threonine" + }, + "monomerTemplate-T___Threonine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.0488, + -1.2558, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.0481, + -2.4369, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.2297, + -0.5156, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "N", + "location": [ + -1.5081, + -1.2558, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.5321, + -0.6672, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.2289, + 0.9614, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "O", + "location": [ + 0.7944, + 1.551, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.251, + 1.5531, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.072, + -0.6661, + 0 + ] + }, + { + "label": "H", + "location": [ + 0.7866, + 2.7318, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 1, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 5 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 9 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "T___Threonine", + "fullName": "Threonine", + "alias": "T", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 4 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 8 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 6, + "leavingGroup": { + "atoms": [ + 9 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "T" + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/formats/ref/props_double_dna.json b/api/tests/integration/tests/formats/ref/props_double_dna.json new file mode 100644 index 0000000000..137657ac60 --- /dev/null +++ b/api/tests/integration/tests/formats/ref/props_double_dna.json @@ -0,0 +1,36 @@ +[ + { + "grossFormula": "C20 N7 O12 P H26", + "mass": 586.4339051246643, + "monomerCount": { + "peptides": {}, + "nucleotides": { + "A": 1, + "T": 1 + } + } + }, + { + "grossFormula": "C58 N26 O36 P4 H74", + "mass": 1834.2558131217957, + "Tm": 7.666666666666667, + "monomerCount": { + "peptides": {}, + "nucleotides": { + "A": 2, + "C": 2, + "G": 2 + } + } + }, + { + "grossFormula": "C9 N2 O9 P H13", + "mass": 323.1812837123871, + "monomerCount": { + "peptides": {}, + "nucleotides": { + "U": 1 + } + } + } +] \ No newline at end of file diff --git a/api/tests/integration/tests/formats/ref/props_peptides.json b/api/tests/integration/tests/formats/ref/props_peptides.json new file mode 100644 index 0000000000..427bb56acf --- /dev/null +++ b/api/tests/integration/tests/formats/ref/props_peptides.json @@ -0,0 +1,45 @@ +[ + { + "grossFormula": "C19 N5 O8 S Se H33", + "mass": 569.5190227031708, + "pKa": 4.0066667, + "extinctionCoefficient": 125, + "hydrophobicity": [ + 0.616, + 0.68, + 0.028, + 0.943 + ], + "monomerCount": { + "peptides": { + "A": 1, + "C": 1, + "D": 1, + "I": 1, + "Other": 1 + }, + "nucleotides": {} + } + }, + { + "grossFormula": "C23 N8 O7 H36", + "mass": 535.5813446044922, + "pKa": 3.5150001, + "extinctionCoefficient": 0, + "hydrophobicity": [ + 0.236, + 1.0, + 0.0, + 0.45 + ], + "monomerCount": { + "peptides": { + "F": 1, + "N": 1, + "R": 1, + "T": 1 + }, + "nucleotides": {} + } + } +] \ No newline at end of file diff --git a/api/tests/integration/tests/formats/ref/props_peptides_micro.json b/api/tests/integration/tests/formats/ref/props_peptides_micro.json new file mode 100644 index 0000000000..257abc3d0f --- /dev/null +++ b/api/tests/integration/tests/formats/ref/props_peptides_micro.json @@ -0,0 +1,45 @@ +[ + { + "grossFormula": "C25 N5 O8 S Se H39", + "mass": 647.6308643817902, + "pKa": 4.0066667, + "extinctionCoefficient": 125, + "hydrophobicity": [ + 0.616, + 0.68, + 0.028, + 0.943 + ], + "monomerCount": { + "peptides": { + "A": 1, + "C": 1, + "D": 1, + "I": 1, + "Other": 1 + }, + "nucleotides": {} + } + }, + { + "grossFormula": "C26 N8 O7 H42", + "mass": 577.6610856056213, + "pKa": 3.5150001, + "extinctionCoefficient": 0, + "hydrophobicity": [ + 0.236, + 1.0, + 0.0, + 0.45 + ], + "monomerCount": { + "peptides": { + "F": 1, + "N": 1, + "R": 1, + "T": 1 + }, + "nucleotides": {} + } + } +] \ No newline at end of file diff --git a/api/wasm/indigo-ketcher/indigo-ketcher.cpp b/api/wasm/indigo-ketcher/indigo-ketcher.cpp index 0d1cc3e936..a8bd71d84f 100644 --- a/api/wasm/indigo-ketcher/indigo-ketcher.cpp +++ b/api/wasm/indigo-ketcher/indigo-ketcher.cpp @@ -933,6 +933,22 @@ namespace indigo return buffer.GetString(); } + std::string calculateMacroProperties(const std::string& data, const std::map& options) + { + const IndigoSession session; + indigoSetOptions(options); + auto iko = indigoLoadKetDocumentFromString(data.c_str()); + rapidjson::Document result; + auto& allocator = result.GetAllocator(); + result.SetObject(); + std::string props{indigoMacroProperties(iko)}; + result.AddMember("properties", props, allocator); + rapidjson::StringBuffer buffer; + rapidjson::Writer writer(buffer); + result.Accept(writer); + return buffer.GetString(); + } + std::string render(const std::string& data, const std::map& options) { #ifndef INDIGO_NO_RENDER @@ -1030,6 +1046,7 @@ namespace indigo emscripten::function("check", &check); emscripten::function("calculateCip", &calculateCip); emscripten::function("calculate", &calculate); + emscripten::function("calculateMacroProperties", &calculateMacroProperties); emscripten::function("render", &render); emscripten::function("reactionComponents", &reactionComponents); diff --git a/api/wasm/indigo-ketcher/test/props_double_dna.json b/api/wasm/indigo-ketcher/test/props_double_dna.json new file mode 100644 index 0000000000..137657ac60 --- /dev/null +++ b/api/wasm/indigo-ketcher/test/props_double_dna.json @@ -0,0 +1,36 @@ +[ + { + "grossFormula": "C20 N7 O12 P H26", + "mass": 586.4339051246643, + "monomerCount": { + "peptides": {}, + "nucleotides": { + "A": 1, + "T": 1 + } + } + }, + { + "grossFormula": "C58 N26 O36 P4 H74", + "mass": 1834.2558131217957, + "Tm": 7.666666666666667, + "monomerCount": { + "peptides": {}, + "nucleotides": { + "A": 2, + "C": 2, + "G": 2 + } + } + }, + { + "grossFormula": "C9 N2 O9 P H13", + "mass": 323.1812837123871, + "monomerCount": { + "peptides": {}, + "nucleotides": { + "U": 1 + } + } + } +] \ No newline at end of file diff --git a/api/wasm/indigo-ketcher/test/props_double_dna.ket b/api/wasm/indigo-ketcher/test/props_double_dna.ket new file mode 100644 index 0000000000..e63769bf04 --- /dev/null +++ b/api/wasm/indigo-ketcher/test/props_double_dna.ket @@ -0,0 +1,1836 @@ +{ + "root": { + "nodes": [ + { + "$ref": "monomer0" + }, + { + "$ref": "monomer1" + }, + { + "$ref": "monomer2" + }, + { + "$ref": "monomer3" + }, + { + "$ref": "monomer4" + }, + { + "$ref": "monomer5" + }, + { + "$ref": "monomer6" + }, + { + "$ref": "monomer7" + }, + { + "$ref": "monomer8" + }, + { + "$ref": "monomer9" + }, + { + "$ref": "monomer10" + }, + { + "$ref": "monomer11" + }, + { + "$ref": "monomer12" + }, + { + "$ref": "monomer13" + }, + { + "$ref": "monomer14" + }, + { + "$ref": "monomer15" + }, + { + "$ref": "monomer16" + }, + { + "$ref": "monomer17" + }, + { + "$ref": "monomer18" + }, + { + "$ref": "monomer19" + }, + { + "$ref": "monomer20" + }, + { + "$ref": "monomer21" + }, + { + "$ref": "monomer22" + }, + { + "$ref": "monomer23" + } + ], + "connections": [ + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer0", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer1", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer1", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer2", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer3", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer4", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer4", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer5", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer6", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer7", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer2", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer4", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer5", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer7", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer8", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer9", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer9", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer10", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer11", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer12", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer12", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer13", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer14", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer15", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer10", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer12", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer13", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer15", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "hydrogen", + "endpoint1": { + "monomerId": "monomer14" + }, + "endpoint2": { + "monomerId": "monomer0" + } + }, + { + "connectionType": "hydrogen", + "endpoint1": { + "monomerId": "monomer11" + }, + "endpoint2": { + "monomerId": "monomer3" + } + }, + { + "connectionType": "hydrogen", + "endpoint1": { + "monomerId": "monomer8" + }, + "endpoint2": { + "monomerId": "monomer6" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer16", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer17", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer17", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer18", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer19", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer20", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer21", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer22", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer22", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer23", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer18", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer20", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "hydrogen", + "endpoint1": { + "monomerId": "monomer21" + }, + "endpoint2": { + "monomerId": "monomer16" + } + } + ], + "templates": [ + { + "$ref": "monomerTemplate-A___Adenine" + }, + { + "$ref": "monomerTemplate-R___Ribose" + }, + { + "$ref": "monomerTemplate-P___Phosphate" + }, + { + "$ref": "monomerTemplate-C___Cytosine" + }, + { + "$ref": "monomerTemplate-G___Guanine" + }, + { + "$ref": "monomerTemplate-T___Thymine" + }, + { + "$ref": "monomerTemplate-U___Uracil" + } + ] + }, + "monomer0": { + "type": "monomer", + "id": "0", + "position": { + "x": 1.25, + "y": -2.75 + }, + "alias": "A", + "templateId": "A___Adenine" + }, + "monomerTemplate-A___Adenine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.0354, + 0.2498, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.0792, + -0.754, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.5057, + -0.2906, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.8177, + 1.1766, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.7031, + 2.1804, + 0 + ] + }, + { + "label": "N", + "location": [ + 0.7235, + 1.717, + 0 + ] + }, + { + "label": "N", + "location": [ + -2.3871, + -1.5034, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.5053, + -2.7168, + 0 + ] + }, + { + "label": "N", + "location": [ + -0.0787, + -2.2532, + 0 + ] + }, + { + "label": "N", + "location": [ + 2.1768, + -0.1209, + 0 + ] + }, + { + "label": "H", + "location": [ + -3.5871, + -1.5034, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 9 + ] + }, + { + "type": 2, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 10 + ] + }, + { + "type": 2, + "atoms": [ + 7, + 8 + ] + } + ], + "class": "Base", + "classHELM": "RNA", + "id": "A___Adenine", + "fullName": "Adenine", + "alias": "A", + "attachmentPoints": [ + { + "attachmentAtom": 6, + "leavingGroup": { + "atoms": [ + 10 + ] + }, + "type": "left" + } + ], + "naturalAnalogShort": "A" + }, + "monomer1": { + "type": "monomer", + "id": "1", + "position": { + "x": 1.25, + "y": -1.25 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomerTemplate-R___Ribose": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "O", + "location": [ + -1.1017, + -1.0663, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.5897, + 0.3436, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 0.0809, + -1.9889, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 0.9095, + 0.2924, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 1.3239, + -1.1493, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "O", + "location": [ + 1.8285, + 1.4755, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.4518, + -1.5589, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.431, + 1.5834, + 0 + ] + }, + { + "label": "O", + "location": [ + 0.0399, + -3.1881, + 0 + ] + }, + { + "label": "O", + "location": [ + -2.9279, + 1.4755, + 0 + ] + }, + { + "label": "H", + "location": [ + -3.6017, + 2.4684, + 0 + ] + }, + { + "label": "H", + "location": [ + 3.0174, + 1.3125, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 7 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 2, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 8 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 5 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 4, + 6 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 10 + ] + } + ], + "class": "Sugar", + "classHELM": "RNA", + "id": "R___Ribose", + "fullName": "Ribose", + "alias": "R", + "attachmentPoints": [ + { + "attachmentAtom": 9, + "leavingGroup": { + "atoms": [ + 10 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 5, + "leavingGroup": { + "atoms": [ + 11 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 2, + "leavingGroup": { + "atoms": [ + 8 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "R" + }, + "monomer2": { + "type": "monomer", + "id": "2", + "position": { + "x": 2.75, + "y": -1.25 + }, + "alias": "P", + "templateId": "P___Phosphate" + }, + "monomerTemplate-P___Phosphate": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "P", + "location": [ + -0.2399, + 0, + 0 + ] + }, + { + "label": "O", + "location": [ + -1.4399, + 0, + 0 + ] + }, + { + "label": "O", + "location": [ + 0.3598, + -1.0394, + 0 + ] + }, + { + "label": "O", + "location": [ + 0.9601, + 0, + 0 + ] + }, + { + "label": "O", + "location": [ + 0.3598, + 1.0394, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 4 + ] + } + ], + "class": "Phosphate", + "classHELM": "RNA", + "id": "P___Phosphate", + "fullName": "Phosphate", + "alias": "P", + "attachmentPoints": [ + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 1 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 3 + ] + }, + "type": "right" + } + ], + "idtAliases": { + "base": "Phos", + "modifications": { + "endpoint3": "3Phos", + "endpoint5": "5Phos" + } + }, + "naturalAnalogShort": "P" + }, + "monomer3": { + "type": "monomer", + "id": "3", + "position": { + "x": 4.25, + "y": -2.75 + }, + "alias": "C", + "templateId": "C___Cytosine" + }, + "monomerTemplate-C___Cytosine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.8617, + 1.3499, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.1117, + 2.6489, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.3882, + 2.649, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.1382, + 1.35, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.3883, + 0.0509, + 0 + ] + }, + { + "label": "N", + "location": [ + 1.1117, + 0.0509, + 0 + ] + }, + { + "label": "N", + "location": [ + 3.0618, + 1.3499, + 0 + ] + }, + { + "label": "O", + "location": [ + -0.9884, + -0.9883, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.3383, + 1.35, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 6 + ] + }, + { + "type": 2, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 2, + "atoms": [ + 4, + 7 + ] + } + ], + "class": "Base", + "classHELM": "RNA", + "id": "C___Cytosine", + "fullName": "Cytosine", + "alias": "C", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 8 + ] + }, + "type": "left" + } + ], + "naturalAnalogShort": "C" + }, + "monomer4": { + "type": "monomer", + "id": "4", + "position": { + "x": 4.25, + "y": -1.25 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomer5": { + "type": "monomer", + "id": "5", + "position": { + "x": 5.75, + "y": -1.25 + }, + "alias": "P", + "templateId": "P___Phosphate" + }, + "monomer6": { + "type": "monomer", + "id": "6", + "position": { + "x": 7.25, + "y": -2.75 + }, + "alias": "G", + "templateId": "G___Guanine" + }, + "monomerTemplate-G___Guanine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.0354, + 0.2498, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.0792, + -0.754, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.5057, + -0.2906, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.8177, + 1.1766, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.7031, + 2.1804, + 0 + ] + }, + { + "label": "N", + "location": [ + 0.7235, + 1.717, + 0 + ] + }, + { + "label": "N", + "location": [ + -2.3871, + -1.5034, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.5053, + -2.7168, + 0 + ] + }, + { + "label": "N", + "location": [ + -0.0787, + -2.2532, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.1768, + -0.1209, + 0 + ] + }, + { + "label": "N", + "location": [ + -0.9527, + 3.3542, + 0 + ] + }, + { + "label": "H", + "location": [ + -3.5871, + -1.5034, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 0, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 11 + ] + }, + { + "type": 2, + "atoms": [ + 7, + 8 + ] + } + ], + "class": "Base", + "classHELM": "RNA", + "id": "G___Guanine", + "fullName": "Guanine", + "alias": "G", + "attachmentPoints": [ + { + "attachmentAtom": 6, + "leavingGroup": { + "atoms": [ + 11 + ] + }, + "type": "left" + } + ], + "naturalAnalogShort": "G" + }, + "monomer7": { + "type": "monomer", + "id": "7", + "position": { + "x": 7.25, + "y": -1.25 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomer8": { + "type": "monomer", + "id": "8", + "position": { + "x": 7.224153240619644, + "y": -4.221560530130507 + }, + "alias": "A", + "templateId": "A___Adenine" + }, + "monomer9": { + "type": "monomer", + "id": "9", + "position": { + "x": 7.235035122660845, + "y": -5.518204214719301 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomer10": { + "type": "monomer", + "id": "10", + "position": { + "x": 5.764281325412832, + "y": -5.4746766865544965 + }, + "alias": "P", + "templateId": "P___Phosphate" + }, + "monomer11": { + "type": "monomer", + "id": "11", + "position": { + "x": 4.260881882041198, + "y": -4.112741709718486 + }, + "alias": "C", + "templateId": "C___Cytosine" + }, + "monomer12": { + "type": "monomer", + "id": "12", + "position": { + "x": 4.249999999999999, + "y": -5.463794804513293 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomer13": { + "type": "monomer", + "id": "13", + "position": { + "x": 2.8445374949991837, + "y": -5.452912922472095 + }, + "alias": "P", + "templateId": "P___Phosphate" + }, + "monomer14": { + "type": "monomer", + "id": "14", + "position": { + "x": 1.2758467593803484, + "y": -4.101859827677283 + }, + "alias": "G", + "templateId": "G___Guanine" + }, + "monomer15": { + "type": "monomer", + "id": "15", + "position": { + "x": 1.297610523462752, + "y": -5.518204214719299 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomer16": { + "type": "monomer", + "id": "16", + "position": { + "x": 10.408597899308097, + "y": -4.352488767416278 + }, + "alias": "A", + "templateId": "A___Adenine" + }, + "monomer17": { + "type": "monomer", + "id": "17", + "position": { + "x": 10.408597899308097, + "y": -2.8524887674162787 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomer18": { + "type": "monomer", + "id": "18", + "position": { + "x": 11.908597899308097, + "y": -2.8524887674162787 + }, + "alias": "P", + "templateId": "P___Phosphate" + }, + "monomer19": { + "type": "monomer", + "id": "19", + "position": { + "x": 13.422879224720925, + "y": -4.406898177622286 + }, + "alias": "T", + "templateId": "T___Thymine" + }, + "monomerTemplate-T___Thymine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.8617, + 1.3499, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.1117, + 0.0509, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.3883, + 0.0509, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.1382, + 1.35, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.3882, + 2.649, + 0 + ] + }, + { + "label": "N", + "location": [ + 1.1117, + 2.6489, + 0 + ] + }, + { + "label": "O", + "location": [ + 3.0618, + 1.3499, + 0 + ] + }, + { + "label": "O", + "location": [ + -0.9882, + 3.6882, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.3383, + 1.35, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.7117, + -0.9884, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 0, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 8 + ] + }, + { + "type": 2, + "atoms": [ + 4, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 9 + ] + } + ], + "class": "Base", + "classHELM": "RNA", + "id": "T___Thymine", + "fullName": "Thymine", + "alias": "T", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 8 + ] + }, + "type": "left" + } + ], + "naturalAnalogShort": "T" + }, + "monomer20": { + "type": "monomer", + "id": "20", + "position": { + "x": 13.422879224720925, + "y": -2.906898177622286 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomer21": { + "type": "monomer", + "id": "21", + "position": { + "x": 10.365070371143299, + "y": -5.854188489102093 + }, + "alias": "U", + "templateId": "U___Uracil" + }, + "monomerTemplate-U___Uracil": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.8617, + 1.3499, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.1117, + 0.0509, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.3883, + 0.0509, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.1382, + 1.35, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.3882, + 2.649, + 0 + ] + }, + { + "label": "N", + "location": [ + 1.1117, + 2.6489, + 0 + ] + }, + { + "label": "O", + "location": [ + 3.0618, + 1.3499, + 0 + ] + }, + { + "label": "O", + "location": [ + -0.9882, + 3.6882, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.3383, + 1.35, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 0, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 8 + ] + }, + { + "type": 2, + "atoms": [ + 4, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + } + ], + "class": "Base", + "classHELM": "RNA", + "id": "U___Uracil", + "fullName": "Uracil", + "alias": "U", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 8 + ] + }, + "type": "left" + } + ], + "naturalAnalogShort": "U" + }, + "monomer22": { + "type": "monomer", + "id": "22", + "position": { + "x": 10.35418848910209, + "y": -7.3575879324737175 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomer23": { + "type": "monomer", + "id": "23", + "position": { + "x": 11.85418848910209, + "y": -7.3575879324737175 + }, + "alias": "P", + "templateId": "P___Phosphate" + } +} \ No newline at end of file diff --git a/api/wasm/indigo-ketcher/test/props_peptides.json b/api/wasm/indigo-ketcher/test/props_peptides.json new file mode 100644 index 0000000000..427bb56acf --- /dev/null +++ b/api/wasm/indigo-ketcher/test/props_peptides.json @@ -0,0 +1,45 @@ +[ + { + "grossFormula": "C19 N5 O8 S Se H33", + "mass": 569.5190227031708, + "pKa": 4.0066667, + "extinctionCoefficient": 125, + "hydrophobicity": [ + 0.616, + 0.68, + 0.028, + 0.943 + ], + "monomerCount": { + "peptides": { + "A": 1, + "C": 1, + "D": 1, + "I": 1, + "Other": 1 + }, + "nucleotides": {} + } + }, + { + "grossFormula": "C23 N8 O7 H36", + "mass": 535.5813446044922, + "pKa": 3.5150001, + "extinctionCoefficient": 0, + "hydrophobicity": [ + 0.236, + 1.0, + 0.0, + 0.45 + ], + "monomerCount": { + "peptides": { + "F": 1, + "N": 1, + "R": 1, + "T": 1 + }, + "nucleotides": {} + } + } +] \ No newline at end of file diff --git a/api/wasm/indigo-ketcher/test/props_peptides.ket b/api/wasm/indigo-ketcher/test/props_peptides.ket new file mode 100644 index 0000000000..a53455db78 --- /dev/null +++ b/api/wasm/indigo-ketcher/test/props_peptides.ket @@ -0,0 +1,1958 @@ +{ + "root": { + "nodes": [ + { + "$ref": "monomer0" + }, + { + "$ref": "monomer1" + }, + { + "$ref": "monomer2" + }, + { + "$ref": "monomer3" + }, + { + "$ref": "monomer4" + }, + { + "$ref": "monomer5" + }, + { + "$ref": "monomer6" + }, + { + "$ref": "monomer7" + }, + { + "$ref": "monomer8" + } + ], + "connections": [ + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer0", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer1", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer1", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer2", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer2", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer3", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer3", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer4", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer5", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer6", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer6", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer7", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer7", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer8", + "attachmentPointId": "R1" + } + } + ], + "templates": [ + { + "$ref": "monomerTemplate-A___Alanine" + }, + { + "$ref": "monomerTemplate-C___Cysteine" + }, + { + "$ref": "monomerTemplate-D___Aspartic acid" + }, + { + "$ref": "monomerTemplate-I___Isoleucine" + }, + { + "$ref": "monomerTemplate-U___Selenocysteine" + }, + { + "$ref": "monomerTemplate-N___Asparagine" + }, + { + "$ref": "monomerTemplate-F___Phenylalanine" + }, + { + "$ref": "monomerTemplate-R___Arginine" + }, + { + "$ref": "monomerTemplate-T___Threonine" + } + ] + }, + "monomer0": { + "type": "monomer", + "id": "0", + "position": { + "x": 1.25, + "y": -1.25 + }, + "alias": "A", + "templateId": "A___Alanine" + }, + "monomerTemplate-A___Alanine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "N", + "location": [ + -1.2549, + -0.392, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.272, + 0.2633, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + -0.3103, + 1.7393, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.0523, + -0.392, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.0829, + -1.5722, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.0353, + 0.2633, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.3334, + 0.0905, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 1, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 1, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 6 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "A___Alanine", + "fullName": "Alanine", + "alias": "A", + "attachmentPoints": [ + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 6 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 5 + ] + }, + "type": "right" + } + ], + "naturalAnalogShort": "A" + }, + "monomer1": { + "type": "monomer", + "id": "1", + "position": { + "x": 2.75, + "y": -1.25 + }, + "alias": "C", + "templateId": "C___Cysteine" + }, + "monomerTemplate-C___Cysteine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.4457, + -1.1333, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.1453, + -0.384, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 0.143, + 1.1168, + 0 + ] + }, + { + "label": "S", + "location": [ + -1.1573, + 1.8661, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.1551, + -1.1333, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.4475, + -2.3333, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.4842, + -0.532, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.1942, + -0.5331, + 0 + ] + }, + { + "label": "H", + "location": [ + -1.1591, + 3.0661, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 5, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 8 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "C___Cysteine", + "fullName": "Cysteine", + "alias": "C", + "attachmentPoints": [ + { + "attachmentAtom": 4, + "leavingGroup": { + "atoms": [ + 7 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 6 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 8 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "C" + }, + "monomer2": { + "type": "monomer", + "id": "2", + "position": { + "x": 4.25, + "y": -1.25 + }, + "alias": "D", + "templateId": "D___Aspartic acid" + }, + "monomerTemplate-D___Aspartic acid": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.631, + -1.5578, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.6327, + -2.7392, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.3507, + -0.8201, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "N", + "location": [ + -0.9295, + -1.5578, + 0 + ] + }, + { + "label": "H", + "location": [ + -1.9525, + -0.9669, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.3485, + 0.6575, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.9317, + 1.3952, + 0 + ] + }, + { + "label": "O", + "location": [ + -1.9542, + 0.8032, + 0 + ] + }, + { + "label": "O", + "location": [ + -0.9335, + 2.5766, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.6534, + -0.9658, + 0 + ] + }, + { + "label": "H", + "location": [ + 0.0851, + 3.1751, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 1, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 5 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 2, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 10 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "D___Aspartic acid", + "fullName": "Aspartic acid", + "alias": "D", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 4 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 9 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 8, + "leavingGroup": { + "atoms": [ + 10 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "D" + }, + "monomer3": { + "type": "monomer", + "id": "3", + "position": { + "x": 5.75, + "y": -1.25 + }, + "alias": "I", + "templateId": "I___Isoleucine" + }, + "monomerTemplate-I___Isoleucine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + -1.2557, + 1.6681, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.0245, + 0.9304, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 0.0268, + -0.5472, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "N", + "location": [ + -1.2536, + -1.2849, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.2766, + -0.694, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.3069, + -1.2849, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.3086, + -2.4664, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.3294, + -0.693, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.047, + 1.5223, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.2574, + 2.8495, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 1 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 5 + ] + }, + { + "type": 2, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 8 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 0, + 9 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "I___Isoleucine", + "fullName": "Isoleucine", + "alias": "I", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 4 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 5, + "leavingGroup": { + "atoms": [ + 7 + ] + }, + "type": "right" + } + ], + "naturalAnalogShort": "I" + }, + "monomer4": { + "type": "monomer", + "id": "4", + "position": { + "x": 7.25, + "y": -1.25 + }, + "alias": "U", + "templateId": "U___Selenocysteine" + }, + "monomerTemplate-U___Selenocysteine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "N", + "location": [ + -0.4339745962155608, + -1.0000000000000009, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.4320508075688785, + -0.5000000000000009, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 1.298076211353316, + -1.0000000000000027, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.1641016151377572, + -0.5000000000000027, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.298076211353316, + -2.0000000000000027, + 0 + ] + }, + { + "label": "H", + "location": [ + -1.3, + -0.5000000000000009, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.4320508075688785, + 0.4999999999999991, + 0 + ] + }, + { + "label": "Se", + "location": [ + -0.433974596215559, + 1.0000000000000009, + 0 + ] + }, + { + "label": "H", + "location": [ + -0.433974596215559, + 2, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 2, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 6 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "U___Selenocysteine", + "fullName": "Selenocysteine", + "alias": "U", + "attachmentPoints": [ + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 5 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 2, + "leavingGroup": { + "atoms": [ + 3 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 7, + "leavingGroup": { + "atoms": [ + 8 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "U" + }, + "monomer5": { + "type": "monomer", + "id": "5", + "position": { + "x": 1.25, + "y": -2.75 + }, + "alias": "N", + "templateId": "N___Asparagine" + }, + "monomerTemplate-N___Asparagine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.8929, + -1.4175, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.8947, + -2.5989, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.6127, + -0.6799, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "N", + "location": [ + -0.6676, + -1.4175, + 0 + ] + }, + { + "label": "H", + "location": [ + -1.6907, + -0.8266, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.6104, + 0.7978, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.6698, + 1.5354, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.6922, + 0.9434, + 0 + ] + }, + { + "label": "O", + "location": [ + -0.6716, + 2.7168, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.9153, + -0.8255, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.5341, + 1.7724, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 1, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 5 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 2, + "atoms": [ + 6, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 10 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "N___Asparagine", + "fullName": "Asparagine", + "alias": "N", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 4 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 9 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 7, + "leavingGroup": { + "atoms": [ + 10 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "N" + }, + "monomer6": { + "type": "monomer", + "id": "6", + "position": { + "x": 2.75, + "y": -2.75 + }, + "alias": "F", + "templateId": "F___Phenylalanine" + }, + "monomerTemplate-F___Phenylalanine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + -0.2052, + 2.5398, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.5064, + 3.286, + 0 + ] + }, + { + "label": "C", + "location": [ + -2.8032, + 2.5322, + 0 + ] + }, + { + "label": "C", + "location": [ + -2.7988, + 1.0322, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.4976, + 0.2861, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.2008, + 1.0398, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.0995, + 0.2905, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.1018, + -1.2103, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "N", + "location": [ + -0.1986, + -1.9596, + 0 + ] + }, + { + "label": "C", + "location": [ + 2.4022, + -1.9596, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.404, + -3.1596, + 0 + ] + }, + { + "label": "O", + "location": [ + 3.4407, + -1.3583, + 0 + ] + }, + { + "label": "H", + "location": [ + -1.2376, + -1.3593, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 2, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 6 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 9 + ] + }, + { + "type": 2, + "atoms": [ + 9, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 12 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "F___Phenylalanine", + "fullName": "Phenylalanine", + "alias": "F", + "attachmentPoints": [ + { + "attachmentAtom": 8, + "leavingGroup": { + "atoms": [ + 12 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 9, + "leavingGroup": { + "atoms": [ + 11 + ] + }, + "type": "right" + } + ], + "naturalAnalogShort": "F" + }, + "monomer7": { + "type": "monomer", + "id": "7", + "position": { + "x": 4.25, + "y": -2.75 + }, + "alias": "R", + "templateId": "R___Arginine" + }, + "monomerTemplate-R___Arginine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.7718, + -2.5891, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.7732, + -3.5337, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.7483, + -1.9994, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "N", + "location": [ + -0.2752, + -2.5891, + 0 + ] + }, + { + "label": "H", + "location": [ + -1.0932, + -2.1168, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.7464, + -0.8182, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.2771, + -0.2284, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.2789, + 0.9529, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.3024, + 1.5426, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.3042, + 2.7238, + 0 + ] + }, + { + "label": "N", + "location": [ + -0.4868, + 3.1971, + 0 + ] + }, + { + "label": "N", + "location": [ + -2.1227, + 3.1955, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.5892, + -2.1159, + 0 + ] + }, + { + "label": "H", + "location": [ + -0.4883, + 4.3786, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 1, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 5 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 10 + ] + }, + { + "type": 2, + "atoms": [ + 9, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 12 + ] + }, + { + "type": 1, + "atoms": [ + 10, + 13 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "R___Arginine", + "fullName": "Arginine", + "alias": "R", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 4 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 12 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 10, + "leavingGroup": { + "atoms": [ + 13 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "R" + }, + "monomer8": { + "type": "monomer", + "id": "8", + "position": { + "x": 5.75, + "y": -2.75 + }, + "alias": "T", + "templateId": "T___Threonine" + }, + "monomerTemplate-T___Threonine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.0488, + -1.2558, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.0481, + -2.4369, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.2297, + -0.5156, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "N", + "location": [ + -1.5081, + -1.2558, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.5321, + -0.6672, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.2289, + 0.9614, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "O", + "location": [ + 0.7944, + 1.551, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.251, + 1.5531, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.072, + -0.6661, + 0 + ] + }, + { + "label": "H", + "location": [ + 0.7866, + 2.7318, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 1, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 5 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 9 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "T___Threonine", + "fullName": "Threonine", + "alias": "T", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 4 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 8 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 6, + "leavingGroup": { + "atoms": [ + 9 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "T" + } +} \ No newline at end of file diff --git a/api/wasm/indigo-ketcher/test/props_peptides_micro.json b/api/wasm/indigo-ketcher/test/props_peptides_micro.json new file mode 100644 index 0000000000..257abc3d0f --- /dev/null +++ b/api/wasm/indigo-ketcher/test/props_peptides_micro.json @@ -0,0 +1,45 @@ +[ + { + "grossFormula": "C25 N5 O8 S Se H39", + "mass": 647.6308643817902, + "pKa": 4.0066667, + "extinctionCoefficient": 125, + "hydrophobicity": [ + 0.616, + 0.68, + 0.028, + 0.943 + ], + "monomerCount": { + "peptides": { + "A": 1, + "C": 1, + "D": 1, + "I": 1, + "Other": 1 + }, + "nucleotides": {} + } + }, + { + "grossFormula": "C26 N8 O7 H42", + "mass": 577.6610856056213, + "pKa": 3.5150001, + "extinctionCoefficient": 0, + "hydrophobicity": [ + 0.236, + 1.0, + 0.0, + 0.45 + ], + "monomerCount": { + "peptides": { + "F": 1, + "N": 1, + "R": 1, + "T": 1 + }, + "nucleotides": {} + } + } +] \ No newline at end of file diff --git a/api/wasm/indigo-ketcher/test/props_peptides_micro.ket b/api/wasm/indigo-ketcher/test/props_peptides_micro.ket new file mode 100644 index 0000000000..0373291c07 --- /dev/null +++ b/api/wasm/indigo-ketcher/test/props_peptides_micro.ket @@ -0,0 +1,2135 @@ +{ + "root": { + "nodes": [ + { + "$ref": "monomer0" + }, + { + "$ref": "monomer1" + }, + { + "$ref": "monomer2" + }, + { + "$ref": "monomer3" + }, + { + "$ref": "monomer4" + }, + { + "$ref": "monomer5" + }, + { + "$ref": "monomer6" + }, + { + "$ref": "monomer7" + }, + { + "$ref": "monomer8" + }, + { + "$ref": "mol0" + }, + { + "$ref": "mol1" + } + ], + "connections": [ + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer0", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer1", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer1", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer2", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer2", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer3", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer3", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer4", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer5", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer6", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer6", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer7", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer7", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer8", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer4", + "attachmentPointId": "R2" + }, + "endpoint2": { + "moleculeId": "mol1", + "atomId": "4" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer8", + "attachmentPointId": "R2" + }, + "endpoint2": { + "moleculeId": "mol0", + "atomId": "2" + } + } + ], + "templates": [ + { + "$ref": "monomerTemplate-A___Alanine" + }, + { + "$ref": "monomerTemplate-C___Cysteine" + }, + { + "$ref": "monomerTemplate-D___Aspartic acid" + }, + { + "$ref": "monomerTemplate-I___Isoleucine" + }, + { + "$ref": "monomerTemplate-U___Selenocysteine" + }, + { + "$ref": "monomerTemplate-N___Asparagine" + }, + { + "$ref": "monomerTemplate-F___Phenylalanine" + }, + { + "$ref": "monomerTemplate-R___Arginine" + }, + { + "$ref": "monomerTemplate-T___Threonine" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 7.14937421436393, + -3.5324704155214057, + 0 + ] + }, + { + "label": "C", + "location": [ + 8.15062578563607, + -3.5324704155214057, + 0 + ] + }, + { + "label": "C", + "location": [ + 7.650050188048686, + -2.667529584478595, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 0 + ] + } + ] + }, + "mol1": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 8.759849152128567, + -0.625074417174607, + 0 + ] + }, + { + "label": "C", + "location": [ + 10.490150847871433, + -0.6245892291772028, + 0 + ] + }, + { + "label": "C", + "location": [ + 9.626637509491239, + -0.12496688885018736, + 0 + ] + }, + { + "label": "C", + "location": [ + 10.490150847871433, + -1.6255320678221479, + 0 + ] + }, + { + "label": "C", + "location": [ + 8.759849152128567, + -1.630020056798137, + 0 + ] + }, + { + "label": "C", + "location": [ + 9.628820855479558, + -2.125033111149812, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 2, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 4 + ] + }, + { + "type": 2, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 3, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + } + ] + }, + "monomer0": { + "type": "monomer", + "id": "0", + "position": { + "x": 1.25, + "y": -1.25 + }, + "alias": "A", + "templateId": "A___Alanine" + }, + "monomerTemplate-A___Alanine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "N", + "location": [ + -1.2549, + -0.392, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.272, + 0.2633, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + -0.3103, + 1.7393, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.0523, + -0.392, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.0829, + -1.5722, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.0353, + 0.2633, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.3334, + 0.0905, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 1, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 1, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 6 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "A___Alanine", + "fullName": "Alanine", + "alias": "A", + "attachmentPoints": [ + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 6 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 5 + ] + }, + "type": "right" + } + ], + "naturalAnalogShort": "A" + }, + "monomer1": { + "type": "monomer", + "id": "1", + "position": { + "x": 2.75, + "y": -1.25 + }, + "alias": "C", + "templateId": "C___Cysteine" + }, + "monomerTemplate-C___Cysteine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.4457, + -1.1333, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.1453, + -0.384, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 0.143, + 1.1168, + 0 + ] + }, + { + "label": "S", + "location": [ + -1.1573, + 1.8661, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.1551, + -1.1333, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.4475, + -2.3333, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.4842, + -0.532, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.1942, + -0.5331, + 0 + ] + }, + { + "label": "H", + "location": [ + -1.1591, + 3.0661, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 5, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 8 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "C___Cysteine", + "fullName": "Cysteine", + "alias": "C", + "attachmentPoints": [ + { + "attachmentAtom": 4, + "leavingGroup": { + "atoms": [ + 7 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 6 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 8 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "C" + }, + "monomer2": { + "type": "monomer", + "id": "2", + "position": { + "x": 4.25, + "y": -1.25 + }, + "alias": "D", + "templateId": "D___Aspartic acid" + }, + "monomerTemplate-D___Aspartic acid": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.631, + -1.5578, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.6327, + -2.7392, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.3507, + -0.8201, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "N", + "location": [ + -0.9295, + -1.5578, + 0 + ] + }, + { + "label": "H", + "location": [ + -1.9525, + -0.9669, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.3485, + 0.6575, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.9317, + 1.3952, + 0 + ] + }, + { + "label": "O", + "location": [ + -1.9542, + 0.8032, + 0 + ] + }, + { + "label": "O", + "location": [ + -0.9335, + 2.5766, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.6534, + -0.9658, + 0 + ] + }, + { + "label": "H", + "location": [ + 0.0851, + 3.1751, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 1, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 5 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 2, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 10 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "D___Aspartic acid", + "fullName": "Aspartic acid", + "alias": "D", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 4 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 9 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 8, + "leavingGroup": { + "atoms": [ + 10 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "D" + }, + "monomer3": { + "type": "monomer", + "id": "3", + "position": { + "x": 5.75, + "y": -1.25 + }, + "alias": "I", + "templateId": "I___Isoleucine" + }, + "monomerTemplate-I___Isoleucine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + -1.2557, + 1.6681, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.0245, + 0.9304, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 0.0268, + -0.5472, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "N", + "location": [ + -1.2536, + -1.2849, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.2766, + -0.694, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.3069, + -1.2849, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.3086, + -2.4664, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.3294, + -0.693, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.047, + 1.5223, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.2574, + 2.8495, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 1 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 5 + ] + }, + { + "type": 2, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 8 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 0, + 9 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "I___Isoleucine", + "fullName": "Isoleucine", + "alias": "I", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 4 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 5, + "leavingGroup": { + "atoms": [ + 7 + ] + }, + "type": "right" + } + ], + "naturalAnalogShort": "I" + }, + "monomer4": { + "type": "monomer", + "id": "4", + "position": { + "x": 7.25, + "y": -1.25 + }, + "alias": "U", + "templateId": "U___Selenocysteine" + }, + "monomerTemplate-U___Selenocysteine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "N", + "location": [ + -0.4339745962155608, + -1.0000000000000009, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.4320508075688785, + -0.5000000000000009, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 1.298076211353316, + -1.0000000000000027, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.1641016151377572, + -0.5000000000000027, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.298076211353316, + -2.0000000000000027, + 0 + ] + }, + { + "label": "H", + "location": [ + -1.3, + -0.5000000000000009, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.4320508075688785, + 0.4999999999999991, + 0 + ] + }, + { + "label": "Se", + "location": [ + -0.433974596215559, + 1.0000000000000009, + 0 + ] + }, + { + "label": "H", + "location": [ + -0.433974596215559, + 2, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 2, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 6 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "U___Selenocysteine", + "fullName": "Selenocysteine", + "alias": "U", + "attachmentPoints": [ + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 5 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 2, + "leavingGroup": { + "atoms": [ + 3 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 7, + "leavingGroup": { + "atoms": [ + 8 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "U" + }, + "monomer5": { + "type": "monomer", + "id": "5", + "position": { + "x": 1.25, + "y": -2.75 + }, + "alias": "N", + "templateId": "N___Asparagine" + }, + "monomerTemplate-N___Asparagine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.8929, + -1.4175, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.8947, + -2.5989, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.6127, + -0.6799, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "N", + "location": [ + -0.6676, + -1.4175, + 0 + ] + }, + { + "label": "H", + "location": [ + -1.6907, + -0.8266, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.6104, + 0.7978, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.6698, + 1.5354, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.6922, + 0.9434, + 0 + ] + }, + { + "label": "O", + "location": [ + -0.6716, + 2.7168, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.9153, + -0.8255, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.5341, + 1.7724, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 1, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 5 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 2, + "atoms": [ + 6, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 10 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "N___Asparagine", + "fullName": "Asparagine", + "alias": "N", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 4 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 9 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 7, + "leavingGroup": { + "atoms": [ + 10 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "N" + }, + "monomer6": { + "type": "monomer", + "id": "6", + "position": { + "x": 2.75, + "y": -2.75 + }, + "alias": "F", + "templateId": "F___Phenylalanine" + }, + "monomerTemplate-F___Phenylalanine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + -0.2052, + 2.5398, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.5064, + 3.286, + 0 + ] + }, + { + "label": "C", + "location": [ + -2.8032, + 2.5322, + 0 + ] + }, + { + "label": "C", + "location": [ + -2.7988, + 1.0322, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.4976, + 0.2861, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.2008, + 1.0398, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.0995, + 0.2905, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.1018, + -1.2103, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "N", + "location": [ + -0.1986, + -1.9596, + 0 + ] + }, + { + "label": "C", + "location": [ + 2.4022, + -1.9596, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.404, + -3.1596, + 0 + ] + }, + { + "label": "O", + "location": [ + 3.4407, + -1.3583, + 0 + ] + }, + { + "label": "H", + "location": [ + -1.2376, + -1.3593, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 2, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 6 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 9 + ] + }, + { + "type": 2, + "atoms": [ + 9, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 12 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "F___Phenylalanine", + "fullName": "Phenylalanine", + "alias": "F", + "attachmentPoints": [ + { + "attachmentAtom": 8, + "leavingGroup": { + "atoms": [ + 12 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 9, + "leavingGroup": { + "atoms": [ + 11 + ] + }, + "type": "right" + } + ], + "naturalAnalogShort": "F" + }, + "monomer7": { + "type": "monomer", + "id": "7", + "position": { + "x": 4.25, + "y": -2.75 + }, + "alias": "R", + "templateId": "R___Arginine" + }, + "monomerTemplate-R___Arginine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.7718, + -2.5891, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.7732, + -3.5337, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.7483, + -1.9994, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "N", + "location": [ + -0.2752, + -2.5891, + 0 + ] + }, + { + "label": "H", + "location": [ + -1.0932, + -2.1168, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.7464, + -0.8182, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.2771, + -0.2284, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.2789, + 0.9529, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.3024, + 1.5426, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.3042, + 2.7238, + 0 + ] + }, + { + "label": "N", + "location": [ + -0.4868, + 3.1971, + 0 + ] + }, + { + "label": "N", + "location": [ + -2.1227, + 3.1955, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.5892, + -2.1159, + 0 + ] + }, + { + "label": "H", + "location": [ + -0.4883, + 4.3786, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 1, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 5 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 10 + ] + }, + { + "type": 2, + "atoms": [ + 9, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 12 + ] + }, + { + "type": 1, + "atoms": [ + 10, + 13 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "R___Arginine", + "fullName": "Arginine", + "alias": "R", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 4 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 12 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 10, + "leavingGroup": { + "atoms": [ + 13 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "R" + }, + "monomer8": { + "type": "monomer", + "id": "8", + "position": { + "x": 5.75, + "y": -2.75 + }, + "alias": "T", + "templateId": "T___Threonine" + }, + "monomerTemplate-T___Threonine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.0488, + -1.2558, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.0481, + -2.4369, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.2297, + -0.5156, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "N", + "location": [ + -1.5081, + -1.2558, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.5321, + -0.6672, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.2289, + 0.9614, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "O", + "location": [ + 0.7944, + 1.551, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.251, + 1.5531, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.072, + -0.6661, + 0 + ] + }, + { + "label": "H", + "location": [ + 0.7866, + 2.7318, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 1, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 5 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 9 + ] + } + ], + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "id": "T___Threonine", + "fullName": "Threonine", + "alias": "T", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 4 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 8 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 6, + "leavingGroup": { + "atoms": [ + 9 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "T" + } +} \ No newline at end of file diff --git a/api/wasm/indigo-ketcher/test/test.js b/api/wasm/indigo-ketcher/test/test.js index d1da8712ff..1bfa11bc0d 100644 --- a/api/wasm/indigo-ketcher/test/test.js +++ b/api/wasm/indigo-ketcher/test/test.js @@ -1063,6 +1063,51 @@ M END }); } + { + test("macroprops", "double_dna", () => { + var fs = require('fs'); + const double_dna = fs.readFileSync("props_double_dna.ket"); + let options = new indigo.MapStringString(); + options.set('json-saving-pretty', 'true'); + let json = JSON.parse(indigo.calculateMacroProperties(double_dna, options)).properties; + // fs.writeFileSync("props_double_dna.json", json); + const json_ref = fs.readFileSync("props_double_dna.json"); + assert.equal(json, json_ref.toString().trim()); + options.delete(); + assert(true); + }); + } + + { + test("macroprops", "peptides_micro", () => { + var fs = require('fs'); + const peptides_micro = fs.readFileSync("props_peptides_micro.ket"); + let options = new indigo.MapStringString(); + options.set('json-saving-pretty', 'true'); + let json = JSON.parse(indigo.calculateMacroProperties(peptides_micro, options)).properties; + // fs.writeFileSync("props_peptides_micro.json", json); + const json_ref = fs.readFileSync("props_peptides_micro.json"); + assert.equal(json, json_ref.toString().trim()); + options.delete(); + assert(true); + }); + } + + { + test("macroprops", "peptides", () => { + var fs = require('fs'); + const peptides = fs.readFileSync("props_peptides.ket"); + let options = new indigo.MapStringString(); + options.set('json-saving-pretty', 'true'); + let json = JSON.parse(indigo.calculateMacroProperties(peptides, options)).properties; + // fs.writeFileSync("props_peptides.json", json); + const json_ref = fs.readFileSync("props_peptides.json"); + assert.equal(json, json_ref.toString().trim()); + options.delete(); + assert(true); + }); + } + // Run tests run(); }); diff --git a/core/indigo-core/molecule/ket_document.h b/core/indigo-core/molecule/ket_document.h index a59b07d4e3..b99fb30549 100644 --- a/core/indigo-core/molecule/ket_document.h +++ b/core/indigo-core/molecule/ket_document.h @@ -35,6 +35,7 @@ namespace indigo { class BaseMolecule; + class Output; class DLLEXPORT KetDocument : public MonomerTemplateLibrary { @@ -159,7 +160,7 @@ namespace indigo void addRGroup(const rapidjson::Value& node); - void addMolecule(const rapidjson::Value& node); + void addMolecule(const rapidjson::Value& node, std::string& ref); const rapidjson::Value& metaObjects() const { @@ -198,6 +199,8 @@ namespace indigo return _monomer_shapes; } + void CalculateMacroProps(Output& output, bool pretty_json = false); + protected: void collect_sequence_side(const std::string& monomer_id, bool left_side, std::set& monomers, std::set& used_monomers, std::deque& sequence, std::map, const KetConnection&>& ap_to_connection); @@ -218,6 +221,7 @@ namespace indigo rapidjson::Value _meta_objects; rapidjson::Value _r_groups; rapidjson::Value _json_molecules; + std::map _mol_ref_to_idx; rapidjson::Document _json_document; std::vector _fasta_properties; std::vector _monomer_shapes; diff --git a/core/indigo-core/molecule/ket_objects.h b/core/indigo-core/molecule/ket_objects.h index 66a3688222..e8bd7d9c73 100644 --- a/core/indigo-core/molecule/ket_objects.h +++ b/core/indigo-core/molecule/ket_objects.h @@ -32,6 +32,7 @@ #include "common/math/algebra.h" #include "molecule/idt_alias.h" #include "molecule/monomers_defs.h" +#include #ifdef _WIN32 #pragma warning(push) @@ -729,6 +730,16 @@ namespace indigo return _alias; }; + void addHydrogenConnection(const std::string& monomer_ref) + { + _hydrogen_connections.insert(monomer_ref); + }; + + const std::set& hydrogenConnections() const + { + return _hydrogen_connections; + }; + protected: MonomerType _monomer_type; std::string _id; @@ -738,6 +749,7 @@ namespace indigo std::map _attachment_points; ket_connections_type _connections; std::string _ref; + std::set _hydrogen_connections; }; class DLLEXPORT KetMonomer : public KetBaseMonomer @@ -794,7 +806,7 @@ namespace indigo KetConnection(TYPE conn_type, KetConnectionEndPoint ep1, KetConnectionEndPoint ep2); - KetConnection(KetConnectionEndPoint ep1, KetConnectionEndPoint ep2) : _connection_type("single"), _ep1(ep1), _ep2(ep2){}; + KetConnection(KetConnectionEndPoint ep1, KetConnectionEndPoint ep2) : _connection_type(KetConnectionSingle), _ep1(ep1), _ep2(ep2){}; const std::map& getStringPropStrToIdx() const override; diff --git a/core/indigo-core/molecule/monomers_template_library.h b/core/indigo-core/molecule/monomers_template_library.h index fd0275b434..1e740936eb 100644 --- a/core/indigo-core/molecule/monomers_template_library.h +++ b/core/indigo-core/molecule/monomers_template_library.h @@ -222,7 +222,8 @@ namespace indigo public: DECL_ERROR; - MonomerTemplateLibrary(){}; + MonomerTemplateLibrary() = default; + virtual ~MonomerTemplateLibrary() = default; MonomerTemplateLibrary(const MonomerTemplateLibrary&) = delete; MonomerTemplateLibrary(MonomerTemplateLibrary&&) = delete; diff --git a/core/indigo-core/molecule/src/base_molecule.cpp b/core/indigo-core/molecule/src/base_molecule.cpp index 3e52f0d8e8..77d5a4db9d 100644 --- a/core/indigo-core/molecule/src/base_molecule.cpp +++ b/core/indigo-core/molecule/src/base_molecule.cpp @@ -5023,9 +5023,9 @@ std::string BaseMolecule::getAtomDescription(int idx) KetDocument& BaseMolecule::getKetDocument() { // static thread_local std::optional> document; // Temporary until direct conversion to document supported - if (_document || _edit_revision != _document_revision) + if (_document == nullptr || _edit_revision != _document_revision) { - if (_edit_revision != _document_revision) + if (_document != nullptr) { delete _document; _document = nullptr; diff --git a/core/indigo-core/molecule/src/ket_document.cpp b/core/indigo-core/molecule/src/ket_document.cpp index e064b4bda4..2bc3c8ecc9 100644 --- a/core/indigo-core/molecule/src/ket_document.cpp +++ b/core/indigo-core/molecule/src/ket_document.cpp @@ -18,9 +18,13 @@ #include "molecule/ket_document.h" #include "base_cpp/exception.h" +#include "molecule/crippen.h" #include "molecule/ket_document_json_saver.h" #include "molecule/molecule.h" +#include "molecule/molecule_gross_formula.h" #include "molecule/molecule_json_loader.h" +#include "molecule/molecule_mass.h" +#include "molecule/monomer_commons.h" #ifdef _MSC_VER #pragma warning(push, 4) @@ -166,8 +170,7 @@ KetConnection& KetDocument::addConnection(const std::string& conn_type, KetConne KetConnection& KetDocument::addConnection(KetConnectionEndPoint ep1, KetConnectionEndPoint ep2) { - _connections.emplace_back(ep1, ep2); - return *_connections.rbegin(); + return addConnection(KetConnectionSingle, ep1, ep2); } KetConnection& KetDocument::addConnection(const std::string& mon1, const std::string& ap1, const std::string& mon2, const std::string& ap2) @@ -197,11 +200,7 @@ KetConnection& KetDocument::addConnection(const std::string& mon1, const std::st void KetDocument::connectMonomerTo(const std::string& mon1, const std::string& ap1, const std::string& mon2, const std::string& ap2) { - std::string mon1_id = _monomer_ref_to_id.at(mon1); - auto it = _monomers.find(mon1_id); - if (it == _monomers.end()) - throw Error("Unknown monomer '%s'", mon1.c_str()); - it->second->connectAttachmentPointTo(ap1, mon2, ap2); + getMonomerById(_monomer_ref_to_id.at(mon1))->connectAttachmentPointTo(ap1, mon2, ap2); } void KetDocument::processAmbiguousMonomerTemplates() @@ -319,7 +318,7 @@ void KetDocument::collect_sequence_side(const std::string& start_monomer_id, boo const ket_connections_type& connections = _monomers.at(monomer_id)->connections(); - if (auto side_it = connections.find(left_side ? "R1" : "R2"); side_it == connections.end()) + if (auto side_it = connections.find(left_side ? kAttachmentPointR1 : kAttachmentPointR2); side_it == connections.end()) has_monomer_id = false; else { @@ -374,8 +373,9 @@ void KetDocument::addRGroup(const rapidjson::Value& node) _r_groups.PushBack(_json_document.CopyFrom(node, _json_document.GetAllocator()), _json_document.GetAllocator()); } -void KetDocument::addMolecule(const rapidjson::Value& node) +void KetDocument::addMolecule(const rapidjson::Value& node, std::string& ref) { + _mol_ref_to_idx.emplace(ref, _json_molecules.Size()); _json_molecules.PushBack(_json_document.CopyFrom(node, _json_document.GetAllocator()), _json_document.GetAllocator()); } @@ -517,6 +517,554 @@ const std::string& KetDocument::monomerIdByRef(const std::string& ref) return it->second; } +void KetDocument::CalculateMacroProps(Output& output, bool pretty_json) +{ + auto is_base = [&](MonomerClass monomer_class) -> bool { + return monomer_class == MonomerClass::Base || monomer_class == MonomerClass::DNA || monomer_class == MonomerClass::RNA; + }; + auto move_to_next_base = [&](auto& it, const auto& end) { + while (it != end) + { + it++; + if (it != end && is_base(getMonomerClass(*it))) + return; + } + }; + struct chain + { + std::deque sequence, secondary_sequence; + chain(std::deque& seq) : sequence(seq), secondary_sequence(){}; + chain(std::deque& seq, std::deque& secondary_seq) : sequence(seq), secondary_sequence(secondary_seq){}; + }; + std::vector> sequences; + std::vector joined_sequences; + std::map> monomer_to_molecule; + parseSimplePolymers(sequences, false); + for (auto connection : _non_sequence_connections) + { + auto& ep1 = connection.ep1(); + auto& ep2 = connection.ep2(); + if (ep1.hasStringProp("monomerId") && ep2.hasStringProp("monomerId")) + { + auto& left_monomer = _monomers.at(_monomer_ref_to_id.at(ep1.getStringProp("monomerId"))); + auto& right_monomer = _monomers.at(_monomer_ref_to_id.at(ep2.getStringProp("monomerId"))); + if (connection.connectionType() == KetConnectionHydro) + { + left_monomer->addHydrogenConnection(right_monomer->ref()); + right_monomer->addHydrogenConnection(left_monomer->ref()); + } + else if (connection.connectionType() == KetConnectionSingle) + { + auto& ap_left = ep1.getStringProp("attachmentPointId"); + auto& ap_right = ep2.getStringProp("attachmentPointId"); + left_monomer->connectAttachmentPointTo(ap_left, right_monomer->ref(), ap_right); + right_monomer->connectAttachmentPointTo(ap_right, left_monomer->ref(), ap_left); + } + } + else if ((ep1.hasStringProp("monomerId") && ep2.hasStringProp("moleculeId")) || (ep1.hasStringProp("moleculeId") && ep2.hasStringProp("monomerId"))) + { + auto monomer_id = + ep1.hasStringProp("monomerId") ? _monomer_ref_to_id.at(ep1.getStringProp("monomerId")) : _monomer_ref_to_id.at(ep2.getStringProp("monomerId")); + auto molecule_id = ep1.hasStringProp("moleculeId") ? ep1.getStringProp("moleculeId") : ep2.getStringProp("moleculeId"); + auto monomer_ap = ep1.hasStringProp("monomerId") ? ep1.getStringProp("attachmentPointId") : ep2.getStringProp("attachmentPointId"); + if (monomer_ap == kAttachmentPointR1 || monomer_ap == kAttachmentPointR2) + monomer_to_molecule.emplace(monomer_id, std::make_pair(molecule_id, monomer_ap)); + } + } + std::map five_prime_monomers, three_prime_monomers; + for (size_t i = 0; i < sequences.size(); i++) + { + five_prime_monomers.emplace(sequences[i].front(), i); + three_prime_monomers.emplace(sequences[i].back(), i); + } + std::set used_sequences; + std::set possible_double_chains; + std::map> bases_count_to_variants; + while (five_prime_monomers.size() > 0) + { + auto idx = five_prime_monomers.begin()->second; + auto cur_monomer_id = five_prime_monomers.begin()->first; + five_prime_monomers.erase(five_prime_monomers.begin()); + used_sequences.emplace(idx); + // If no chains connected to 5' and 3' ends of DNA/RNA chain - add it to possible double chain + if (_monomers.at(sequences[idx].front())->connections().count(kAttachmentPointR1) == 0 && + _monomers.at(sequences[idx].back())->connections().count(kAttachmentPointR2) == 0) + { + auto& first_monomer = _monomers.at(sequences[idx].front()); + auto first_monomer_class = getMonomerClass(*first_monomer); + switch (first_monomer_class) + { + case MonomerClass::DNA: + case MonomerClass::RNA: + case MonomerClass::Sugar: + case MonomerClass::Phosphate: + case MonomerClass::Base: { + bool found_no_hydrogen = false; + size_t bases_count = 0; + // check that all bases have hydrogen connections + for (auto& monomer_id : sequences[idx]) + { + auto& monomer = _monomers.at(monomer_id); + if (is_base(getMonomerClass(*monomer))) + { + if (monomer->hydrogenConnections().size() == 0) // no hydrogen connections + { + found_no_hydrogen = true; + break; + } + bases_count++; + } + } + if (found_no_hydrogen == false) + { + possible_double_chains.emplace(idx); + if (bases_count_to_variants.count(bases_count) == 0) + bases_count_to_variants.emplace(bases_count, std::set()); + bases_count_to_variants.at(bases_count).emplace(idx); + continue; + } + } + default: + break; + } + } + auto& sequence = joined_sequences.emplace_back(sequences[idx]).sequence; + while (true) + { + auto& front_connections = _monomers.at(sequence.front())->connections(); + if (front_connections.count(kAttachmentPointR1) > 0) + { + auto& connection = front_connections.at(kAttachmentPointR1); + if (connection.second == kAttachmentPointR2) + { + auto& monomer_id = _monomer_ref_to_id.at(connection.first); + auto it = three_prime_monomers.find(monomer_id); + if (it == three_prime_monomers.end()) + throw Error("Internal error. Connection to monomer %s not found", monomer_id.c_str()); + auto letf_idx = it->second; + if (used_sequences.count(letf_idx) == 0) + { + sequence.insert(sequence.begin(), sequences[letf_idx].begin(), sequences[letf_idx].end()); + five_prime_monomers.erase(sequences[letf_idx].front()); // remove from 5' monomers + used_sequences.emplace(letf_idx); + continue; + } + } + } + auto& back_connections = _monomers.at(sequence.back())->connections(); + if (back_connections.count(kAttachmentPointR2) > 0) + { + auto& connection = back_connections.at(kAttachmentPointR2); + if (connection.second == kAttachmentPointR1) + { + auto& monomer_id = _monomer_ref_to_id.at(connection.first); + if (monomer_id != cur_monomer_id) // avoid cycle + { + auto it = five_prime_monomers.find(monomer_id); + if (it == five_prime_monomers.end()) + throw Error("Internal error. Connection to monomer %s not found", monomer_id.c_str()); + auto right_idx = it->second; + if (used_sequences.count(right_idx) == 0) + { + sequence.insert(sequence.end(), sequences[right_idx].begin(), sequences[right_idx].end()); + five_prime_monomers.erase(sequences[right_idx].front()); // remove from 5' monomers + used_sequences.emplace(right_idx); + continue; + } + } + } + } + break; + } + } + std::set verified_options; + for (auto idx : possible_double_chains) + { + if (verified_options.count(idx) > 0) + continue; + auto& sequence = sequences[idx]; + verified_options.emplace(idx); + size_t bases_count = 0; + for (auto it = sequence.begin(); it != sequence.end(); it++) + { + if (is_base(getMonomerClass(*it))) + bases_count++; + } + bases_count_to_variants.at(bases_count).erase(idx); + bool pair_found = false; + for (auto& variant_idx : bases_count_to_variants.at(bases_count)) + { + auto& variant = sequences[variant_idx]; + auto variant_it = variant.rbegin(); + auto sequence_it = sequence.begin(); + if (!is_base(getMonomerClass(*variant_it))) + move_to_next_base(variant_it, variant.rend()); + if (!is_base(getMonomerClass(*sequence_it))) + move_to_next_base(sequence_it, sequence.end()); + while (sequence_it != sequence.end() && variant_it != variant.rend()) + { + auto& base = _monomers.at(*sequence_it); + auto& variant_base = _monomers.at(*variant_it); + if (base->hydrogenConnections().count(variant_base->ref()) == 0) + break; + move_to_next_base(variant_it, variant.rend()); + move_to_next_base(sequence_it, sequence.end()); + } + if (sequence_it == sequence.end() && variant_it == variant.rend()) + { + pair_found = true; + verified_options.emplace(variant_idx); + bases_count_to_variants.at(bases_count).erase(variant_idx); + joined_sequences.emplace_back(sequence, variant); + break; + } + } + if (!pair_found) + { + joined_sequences.emplace_back(sequence); + } + } + // Sequences generated. Calculate macro properties + rapidjson::StringBuffer s; + JsonWriter writer(pretty_json); + writer.Reset(s); + writer.StartArray(); + for (auto& sequence_arr : joined_sequences) + { + writer.StartObject(); + std::deque sequence{sequence_arr.sequence}; + sequence.insert(sequence.begin(), sequence_arr.secondary_sequence.begin(), sequence_arr.secondary_sequence.end()); + std::vector pKa_values; + // in kDa(1000g/mol) (all chains) + double mass_sum = -1; + std::map atoms_count; + GROSS_UNITS gross_units; + gross_units.resize(1); + auto merge_gross_data = [&gross_units](const GROSS_UNITS& gross) { + for (int i = 0; i < gross.size(); i++) + { + for (auto it : gross.at(i).isotopes) + { + if (gross_units[0].isotopes.count(it.first) == 0) + gross_units[0].isotopes[it.first] = it.second; + else + gross_units[0].isotopes[it.first] += it.second; + } + } + }; + for (auto& monomer_id : sequence) + { + auto& monomer = _monomers.at(monomer_id); + if (monomer->monomerType() == KetBaseMonomer::MonomerType::AmbiguousMonomer) + { + mass_sum = -1; + atoms_count.clear(); + break; + } + auto& monomer_template = _templates.at(monomer->templateId()); + if (monomer_template.unresolved()) + { + mass_sum = -1; + atoms_count.clear(); + break; + } + std::vector leaved_atoms; + auto& connections = monomer->connections(); + auto& att_points = monomer->attachmentPoints(); + for (auto& conn : connections) + { + auto it = att_points.find(conn.first); + if (it == att_points.end()) + throw Error("Internal error. Attachment point %s not found in monomer %s", conn.first.c_str(), monomer_id.c_str()); + auto& leaving_group = it->second.leavingGroup(); + if (!leaving_group.has_value()) + continue; + auto& leaved = leaving_group.value(); + leaved_atoms.insert(leaved_atoms.end(), leaved.begin(), leaved.end()); + } + std::sort(leaved_atoms.rbegin(), leaved_atoms.rend()); + auto tgroup = monomer_template.getTGroup(); + auto* pmol = static_cast(tgroup->fragment.get()); + Array atom_filt; + atom_filt.expandFill(pmol->vertexCount(), 1); + for (auto& idx : leaved_atoms) + atom_filt[idx] = 0; + Filter atom_filter(atom_filt.ptr(), Filter::EQ, 1); + pmol->selectAtoms(atom_filter); + MoleculeMass mass; + mass.mass_options.skip_error_on_pseudoatoms = true; + mass_sum += mass.molecularWeight(*pmol); + if (getMonomerClass(*monomer) == MonomerClass::AminoAcid) + { + pKa_values.emplace_back(Crippen::pKa(*pmol)); + } + auto gross = MoleculeGrossFormula::collect(*pmol, true); + merge_gross_data(*gross); + } + std::vector sequence_ends; + sequence_ends.emplace_back(sequence.front()); + if (sequence.back() != sequence.front()) + sequence_ends.emplace_back(sequence.back()); + for (auto& monomer_id : sequence_ends) + { + if (monomer_to_molecule.count(monomer_id) > 0) + { + auto& molecule_id = monomer_to_molecule.at(monomer_id).first; + auto& mol_json = _json_molecules[_mol_ref_to_idx[molecule_id]]; + rapidjson::Value marr(rapidjson::kArrayType); + marr.PushBack(_json_document.CopyFrom(mol_json, _json_document.GetAllocator()), _json_document.GetAllocator()); + MoleculeJsonLoader loader(marr); + BaseMolecule* pbmol; + Molecule mol; + QueryMolecule qmol; + try + { + loader.loadMolecule(mol); + pbmol = &mol; + MoleculeMass mass; + mass.mass_options.skip_error_on_pseudoatoms = true; + mass_sum += mass.molecularWeight(mol); + auto gross = MoleculeGrossFormula::collect(*pbmol, true); + merge_gross_data(*gross); + } + catch (...) + { + // query molecule just skipped + } + } + } + Array gross_str; + MoleculeGrossFormula::toString(gross_units, gross_str); + writer.Key("grossFormula"); + writer.String(gross_str.ptr()); + if (mass_sum > 0) + { + writer.Key("mass"); + writer.Double(mass_sum); + } + + // pKa (only peptides) + auto pka_count = pKa_values.size(); + if (pka_count > 0) + { + double pKa; + if (pka_count > 1) + { + std::sort(pKa_values.begin(), pKa_values.end()); + if (pka_count & 1) // odd + { + pKa = pKa_values[pka_count / 2]; + } + else // even - get average + { + pKa = (pKa_values[pka_count / 2 - 1] + pKa_values[pka_count / 2]) / 2; + } + } + else // only one value + { + pKa = pKa_values[0]; + } + writer.Key("pKa"); + writer.Double(pKa); + } + + // Melting temperature (only double stranded DNA) + if (sequence_arr.secondary_sequence.size() > 0) + { + std::deque bases; + auto it = sequence_arr.sequence.begin(); + if (!is_base(getMonomerClass(*it))) + move_to_next_base(it, sequence_arr.sequence.end()); + while (it != sequence_arr.sequence.end()) + { + auto& monomer = _monomers.at(*it); + if (monomer->monomerType() == KetBaseMonomer::MonomerType::AmbiguousMonomer) + continue; + auto& monomer_template = _templates.at(monomer->templateId()); + if (monomer_template.hasStringProp("naturalAnalogShort")) + { + bases.emplace_back(monomer_template.getStringProp("naturalAnalogShort")); + } + move_to_next_base(it, sequence_arr.sequence.end()); + } + if (bases.size() > 0) + { + std::string left = bases.front(); + bases.pop_front(); + if (left == "U") + left = "T"; + size_t base_count = 1; + size_t total_strength = 0; + static const std::map, size_t> STRENGTH_PARAMS{ + {{"C", "G"}, 13}, {{"C", "C"}, 11}, {{"G", "G"}, 11}, {{"C", "G"}, 10}, {{"A", "C"}, 10}, {{"T", "C"}, 8}, + {{"A", "G"}, 8}, {{"T", "G"}, 7}, {{"G", "T"}, 10}, {{"C", "T"}, 8}, {{"G", "A"}, 8}, {{"C", "A"}, 7}, + {{"A", "T"}, 7}, {{"T", "T"}, 5}, {{"A", "A"}, 5}, {{"T", "A"}, 4}}; + while (bases.size() > 0) + { + auto right = bases.front(); + bases.pop_front(); + if (right == "U") + right = "T"; + auto str_it = STRENGTH_PARAMS.find({left, right}); + if (str_it == STRENGTH_PARAMS.end()) + throw Error("Internal error. No strength params for %s and %s", left.c_str(), right.c_str()); + total_strength += str_it->second; + base_count++; + left = right; + } + writer.Key("Tm"); + writer.Double(static_cast(total_strength) / base_count); + } + } + + // Extinction coefficient (only peptides) + { + static const std::map extinction_coefficients{{"C", 125}, {"W", 5500}, {"Y", 1490}}; + std::map extinction_counts; + for (auto& it : extinction_coefficients) + extinction_counts.emplace(it.first, 0); + size_t peptides_count = 0; + for (auto monomer_id : sequence) + { + auto& monomer = _monomers.at(monomer_id); + if (getMonomerClass(*monomer) != MonomerClass::AminoAcid) + continue; + peptides_count++; + if (monomer->monomerType() == KetBaseMonomer::MonomerType::AmbiguousMonomer) + continue; + auto& monomer_template = _templates.at(monomer->templateId()); + if (monomer_template.hasStringProp("naturalAnalogShort")) + { + auto it = extinction_counts.find(monomer_template.getStringProp("naturalAnalogShort")); + if (it != extinction_counts.end()) + { + it->second++; + } + } + } + if (peptides_count > 0) + { + size_t e_calc = 0; + for (auto& it : extinction_counts) + { + e_calc += it.second * extinction_coefficients.at(it.first); + } + writer.Key("extinctionCoefficient"); + writer.Uint64(e_calc); + } + } + + // Hydrophobicity (only peptides) + std::vector hydrophobicity; + static const std::map hydrophobicity_coefficients{ + {"A", 0.616}, {"G", 0.501}, {"M", 0.738}, {"S", 0.359}, {"C", 0.680}, {"H", 0.165}, {"N", 0.236}, {"T", 0.450}, {"D", 0.028}, {"I", 0.943}, + {"P", 0.711}, {"V", 0.825}, {"E", 0.043}, {"K", 0.283}, {"Q", 0.251}, {"W", 0.878}, {"F", 1.000}, {"L", 0.943}, {"R", 0.000}, {"Y", 0.880}}; + for (auto& monomer_id : sequence) + { + if (getMonomerClass(monomer_id) != MonomerClass::AminoAcid) + continue; + auto& monomer = _monomers.at(monomer_id); + if (monomer->monomerType() == KetBaseMonomer::MonomerType::AmbiguousMonomer) + continue; + auto& monomer_template = _templates.at(monomer->templateId()); + if (monomer_template.hasStringProp("naturalAnalogShort")) + { + + auto it = hydrophobicity_coefficients.find(monomer_template.getStringProp("naturalAnalogShort")); + if (it != hydrophobicity_coefficients.end()) + hydrophobicity.emplace_back(it->second); + } + } + if (hydrophobicity.size() > 0) + { + writer.Key("hydrophobicity"); + writer.StartArray(); + for (auto value : hydrophobicity) + writer.Double(value); + writer.EndArray(); + } + + // Monomer count + static const std::string peptides = "ACDEFGHIKLMNPQRSTVWY"; + static const std::string nucleotides = "ACGTU"; + std::map peptides_count; + std::map nucleotides_count; + for (auto ch : peptides) + peptides_count.emplace(std::string(1, ch), 0); + for (auto ch : nucleotides) + nucleotides_count.emplace(std::string(1, ch), 0); + static const std::string OTHER = "Other"; + peptides_count.emplace(OTHER, 0); + nucleotides_count.emplace(OTHER, 0); + for (auto& monomer_id : sequence) + { + auto& monomer = _monomers.at(monomer_id); + auto monomer_class = getMonomerClass(*monomer); + if (monomer->monomerType() == KetBaseMonomer::MonomerType::AmbiguousMonomer) + { + if (monomer_class == MonomerClass::AminoAcid) + peptides_count[OTHER]++; + else if (monomer_class == MonomerClass::DNA || monomer_class == MonomerClass::RNA || monomer_class == MonomerClass::Sugar || + monomer_class == MonomerClass::Phosphate || monomer_class == MonomerClass::Base) + nucleotides_count[OTHER]++; + continue; + } + std::string natural_analog = ""; + auto& monomer_template = _templates.at(monomer->templateId()); + if (monomer_template.monomerClass() == MonomerClass::AminoAcid) + { + if (monomer_template.hasStringProp("naturalAnalogShort")) + natural_analog = monomer_template.getStringProp("naturalAnalogShort"); + auto it = peptides_count.find(natural_analog); + if (it == peptides_count.end()) + peptides_count[OTHER]++; + else + it->second++; + } + else if (is_base(monomer_template.monomerClass())) + { + if (monomer_template.hasStringProp("naturalAnalogShort")) + natural_analog = monomer_template.getStringProp("naturalAnalogShort"); + auto it = nucleotides_count.find(natural_analog); + if (it == nucleotides_count.end()) + nucleotides_count[OTHER]++; + else + it->second++; + } + } + writer.Key("monomerCount"); + writer.StartObject(); + writer.Key("peptides"); + writer.StartObject(); + for (const auto& it : peptides_count) + { + if (it.second > 0) + { + writer.Key(it.first); + writer.Uint64(it.second); + } + } + writer.EndObject(); // peptides + writer.Key("nucleotides"); + writer.StartObject(); + for (const auto& it : nucleotides_count) + { + if (it.second > 0) + { + writer.Key(it.first); + writer.Uint64(it.second); + } + } + writer.EndObject(); // nucleotides + writer.EndObject(); // monomerCount + writer.EndObject(); + } + writer.EndArray(); + std::stringstream result; + result << s.GetString(); + output.printf("%s", result.str().c_str()); +} + #ifdef _MSC_VER #pragma warning(pop) #endif diff --git a/core/indigo-core/molecule/src/ket_document_json_loader.cpp b/core/indigo-core/molecule/src/ket_document_json_loader.cpp index 8ba91fa4f7..8ad3130f73 100644 --- a/core/indigo-core/molecule/src/ket_document_json_loader.cpp +++ b/core/indigo-core/molecule/src/ket_document_json_loader.cpp @@ -80,7 +80,7 @@ void KetDocumentJsonLoader::parseJson(const std::string& json_str, KetDocument& if (node_type == "molecule") { // parseKetMolecule(ref, node, document); - document.addMolecule(node); + document.addMolecule(node, ref); } else if (node_type == "rgroup") { diff --git a/core/indigo-core/reaction/base_reaction.h b/core/indigo-core/reaction/base_reaction.h index e803e5954e..8904f32eb3 100644 --- a/core/indigo-core/reaction/base_reaction.h +++ b/core/indigo-core/reaction/base_reaction.h @@ -37,6 +37,7 @@ namespace indigo class QueryReaction; class BaseReaction; class PathwayReaction; + class KetDocument; struct SpecialCondition { @@ -372,6 +373,8 @@ namespace indigo isRetrosynthetic = true; }; + KetDocument& getKetDocument(); + DECL_ERROR; protected: @@ -400,6 +403,8 @@ namespace indigo virtual void _clone(BaseReaction& other, int index, int i, ObjArray>* mol_mappings); virtual void _cloneSub(BaseReaction& other); + + KetDocument* _document; }; } // namespace indigo diff --git a/core/indigo-core/reaction/src/base_reaction.cpp b/core/indigo-core/reaction/src/base_reaction.cpp index 2c3f59c56a..d147fe6556 100644 --- a/core/indigo-core/reaction/src/base_reaction.cpp +++ b/core/indigo-core/reaction/src/base_reaction.cpp @@ -17,9 +17,13 @@ ***************************************************************************/ #include "reaction/base_reaction.h" +#include "base_cpp/output.h" #include "base_cpp/tlscont.h" +#include "molecule/ket_document.h" +#include "molecule/ket_document_json_loader.h" #include "molecule/meta_commons.h" #include "molecule/molecule_dearom.h" +#include "reaction/reaction_json_saver.h" using namespace indigo; @@ -94,7 +98,7 @@ SideIter SideAuto::end() BaseReaction::BaseReaction() : reactants(*this, REACTANT), catalysts(*this, CATALYST), products(*this, PRODUCT), intermediates(*this, INTERMEDIATE), undefined(*this, UNDEFINED), - original_format(BaseMolecule::UNKNOWN) + original_format(BaseMolecule::UNKNOWN), _document(nullptr) { clear(); } @@ -113,6 +117,11 @@ void BaseReaction::clear() _allMolecules.clear(); _types.clear(); name.clear(); + if (_document != nullptr) + { + delete _document; + _document = nullptr; + } } int BaseReaction::getAAM(int index, int atom) @@ -519,3 +528,22 @@ int BaseReaction::multitaleCount() const { return _meta.getMetaCount(ReactionMultitailArrowObject::CID); } + +KetDocument& BaseReaction::getKetDocument() +{ + if (_document == nullptr) + { + // save to ket + std::string json; + StringOutput out(json); + ReactionJsonSaver saver(out); + saver.saveReaction(*this); + // load document from ket + rapidjson::Document data; + std::ignore = data.Parse(json.c_str()); + _document = new KetDocument; + KetDocumentJsonLoader loader{}; + loader.parseJson(json, *_document); + } + return *_document; +} \ No newline at end of file diff --git a/utils/indigo-service/backend/service/tests/api/indigo_test.py b/utils/indigo-service/backend/service/tests/api/indigo_test.py index 26c1abb143..530ac20498 100644 --- a/utils/indigo-service/backend/service/tests/api/indigo_test.py +++ b/utils/indigo-service/backend/service/tests/api/indigo_test.py @@ -3656,6 +3656,39 @@ def test_convert_helm(self): result_helm = json.loads(result.text)["struct"] self.assertEqual(helm_struct, result_helm) + def test_macro_props(self): + structs_path = joinPathPy("structures/", __file__) + file_path = os.path.join(structs_path, "props_double_dna.ket") + with open(file_path, "r") as file: + double_dna = file.read() + + headers, data = self.get_headers( + { + "struct": double_dna, + "options": {"json-saving-pretty": True}, + "input_format": "chemical/x-indigo-ket", + } + ) + + result = requests.post( + self.url_prefix + "/calculateMacroProperties", + headers=headers, + data=data, + ) + result_json = json.loads(result.text)["properties"] + + file_name = os.path.join( + joinPathPy("ref/", __file__), "props_double_dna.json" + ) + # write references + # with open(file_name, "w") as file: + # file.write(result_json) + + # check + with open(file_name, "r") as file: + ref_json = file.read() + self.assertEqual(result_json, ref_json) + if __name__ == "__main__": unittest.main(verbosity=2, warnings="ignore") diff --git a/utils/indigo-service/backend/service/tests/api/ref/props_double_dna.json b/utils/indigo-service/backend/service/tests/api/ref/props_double_dna.json new file mode 100644 index 0000000000..137657ac60 --- /dev/null +++ b/utils/indigo-service/backend/service/tests/api/ref/props_double_dna.json @@ -0,0 +1,36 @@ +[ + { + "grossFormula": "C20 N7 O12 P H26", + "mass": 586.4339051246643, + "monomerCount": { + "peptides": {}, + "nucleotides": { + "A": 1, + "T": 1 + } + } + }, + { + "grossFormula": "C58 N26 O36 P4 H74", + "mass": 1834.2558131217957, + "Tm": 7.666666666666667, + "monomerCount": { + "peptides": {}, + "nucleotides": { + "A": 2, + "C": 2, + "G": 2 + } + } + }, + { + "grossFormula": "C9 N2 O9 P H13", + "mass": 323.1812837123871, + "monomerCount": { + "peptides": {}, + "nucleotides": { + "U": 1 + } + } + } +] \ No newline at end of file diff --git a/utils/indigo-service/backend/service/tests/api/structures/props_double_dna.ket b/utils/indigo-service/backend/service/tests/api/structures/props_double_dna.ket new file mode 100644 index 0000000000..e63769bf04 --- /dev/null +++ b/utils/indigo-service/backend/service/tests/api/structures/props_double_dna.ket @@ -0,0 +1,1836 @@ +{ + "root": { + "nodes": [ + { + "$ref": "monomer0" + }, + { + "$ref": "monomer1" + }, + { + "$ref": "monomer2" + }, + { + "$ref": "monomer3" + }, + { + "$ref": "monomer4" + }, + { + "$ref": "monomer5" + }, + { + "$ref": "monomer6" + }, + { + "$ref": "monomer7" + }, + { + "$ref": "monomer8" + }, + { + "$ref": "monomer9" + }, + { + "$ref": "monomer10" + }, + { + "$ref": "monomer11" + }, + { + "$ref": "monomer12" + }, + { + "$ref": "monomer13" + }, + { + "$ref": "monomer14" + }, + { + "$ref": "monomer15" + }, + { + "$ref": "monomer16" + }, + { + "$ref": "monomer17" + }, + { + "$ref": "monomer18" + }, + { + "$ref": "monomer19" + }, + { + "$ref": "monomer20" + }, + { + "$ref": "monomer21" + }, + { + "$ref": "monomer22" + }, + { + "$ref": "monomer23" + } + ], + "connections": [ + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer0", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer1", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer1", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer2", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer3", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer4", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer4", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer5", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer6", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer7", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer2", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer4", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer5", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer7", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer8", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer9", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer9", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer10", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer11", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer12", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer12", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer13", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer14", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer15", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer10", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer12", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer13", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer15", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "hydrogen", + "endpoint1": { + "monomerId": "monomer14" + }, + "endpoint2": { + "monomerId": "monomer0" + } + }, + { + "connectionType": "hydrogen", + "endpoint1": { + "monomerId": "monomer11" + }, + "endpoint2": { + "monomerId": "monomer3" + } + }, + { + "connectionType": "hydrogen", + "endpoint1": { + "monomerId": "monomer8" + }, + "endpoint2": { + "monomerId": "monomer6" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer16", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer17", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer17", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer18", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer19", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer20", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer21", + "attachmentPointId": "R1" + }, + "endpoint2": { + "monomerId": "monomer22", + "attachmentPointId": "R3" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer22", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer23", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "single", + "endpoint1": { + "monomerId": "monomer18", + "attachmentPointId": "R2" + }, + "endpoint2": { + "monomerId": "monomer20", + "attachmentPointId": "R1" + } + }, + { + "connectionType": "hydrogen", + "endpoint1": { + "monomerId": "monomer21" + }, + "endpoint2": { + "monomerId": "monomer16" + } + } + ], + "templates": [ + { + "$ref": "monomerTemplate-A___Adenine" + }, + { + "$ref": "monomerTemplate-R___Ribose" + }, + { + "$ref": "monomerTemplate-P___Phosphate" + }, + { + "$ref": "monomerTemplate-C___Cytosine" + }, + { + "$ref": "monomerTemplate-G___Guanine" + }, + { + "$ref": "monomerTemplate-T___Thymine" + }, + { + "$ref": "monomerTemplate-U___Uracil" + } + ] + }, + "monomer0": { + "type": "monomer", + "id": "0", + "position": { + "x": 1.25, + "y": -2.75 + }, + "alias": "A", + "templateId": "A___Adenine" + }, + "monomerTemplate-A___Adenine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.0354, + 0.2498, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.0792, + -0.754, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.5057, + -0.2906, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.8177, + 1.1766, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.7031, + 2.1804, + 0 + ] + }, + { + "label": "N", + "location": [ + 0.7235, + 1.717, + 0 + ] + }, + { + "label": "N", + "location": [ + -2.3871, + -1.5034, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.5053, + -2.7168, + 0 + ] + }, + { + "label": "N", + "location": [ + -0.0787, + -2.2532, + 0 + ] + }, + { + "label": "N", + "location": [ + 2.1768, + -0.1209, + 0 + ] + }, + { + "label": "H", + "location": [ + -3.5871, + -1.5034, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 9 + ] + }, + { + "type": 2, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 10 + ] + }, + { + "type": 2, + "atoms": [ + 7, + 8 + ] + } + ], + "class": "Base", + "classHELM": "RNA", + "id": "A___Adenine", + "fullName": "Adenine", + "alias": "A", + "attachmentPoints": [ + { + "attachmentAtom": 6, + "leavingGroup": { + "atoms": [ + 10 + ] + }, + "type": "left" + } + ], + "naturalAnalogShort": "A" + }, + "monomer1": { + "type": "monomer", + "id": "1", + "position": { + "x": 1.25, + "y": -1.25 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomerTemplate-R___Ribose": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "O", + "location": [ + -1.1017, + -1.0663, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.5897, + 0.3436, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 0.0809, + -1.9889, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 0.9095, + 0.2924, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 1.3239, + -1.1493, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "O", + "location": [ + 1.8285, + 1.4755, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.4518, + -1.5589, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.431, + 1.5834, + 0 + ] + }, + { + "label": "O", + "location": [ + 0.0399, + -3.1881, + 0 + ] + }, + { + "label": "O", + "location": [ + -2.9279, + 1.4755, + 0 + ] + }, + { + "label": "H", + "location": [ + -3.6017, + 2.4684, + 0 + ] + }, + { + "label": "H", + "location": [ + 3.0174, + 1.3125, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 7 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 2, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 8 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 5 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 4, + 6 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 10 + ] + } + ], + "class": "Sugar", + "classHELM": "RNA", + "id": "R___Ribose", + "fullName": "Ribose", + "alias": "R", + "attachmentPoints": [ + { + "attachmentAtom": 9, + "leavingGroup": { + "atoms": [ + 10 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 5, + "leavingGroup": { + "atoms": [ + 11 + ] + }, + "type": "right" + }, + { + "attachmentAtom": 2, + "leavingGroup": { + "atoms": [ + 8 + ] + }, + "type": "side" + } + ], + "naturalAnalogShort": "R" + }, + "monomer2": { + "type": "monomer", + "id": "2", + "position": { + "x": 2.75, + "y": -1.25 + }, + "alias": "P", + "templateId": "P___Phosphate" + }, + "monomerTemplate-P___Phosphate": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "P", + "location": [ + -0.2399, + 0, + 0 + ] + }, + { + "label": "O", + "location": [ + -1.4399, + 0, + 0 + ] + }, + { + "label": "O", + "location": [ + 0.3598, + -1.0394, + 0 + ] + }, + { + "label": "O", + "location": [ + 0.9601, + 0, + 0 + ] + }, + { + "label": "O", + "location": [ + 0.3598, + 1.0394, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 4 + ] + } + ], + "class": "Phosphate", + "classHELM": "RNA", + "id": "P___Phosphate", + "fullName": "Phosphate", + "alias": "P", + "attachmentPoints": [ + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 1 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 3 + ] + }, + "type": "right" + } + ], + "idtAliases": { + "base": "Phos", + "modifications": { + "endpoint3": "3Phos", + "endpoint5": "5Phos" + } + }, + "naturalAnalogShort": "P" + }, + "monomer3": { + "type": "monomer", + "id": "3", + "position": { + "x": 4.25, + "y": -2.75 + }, + "alias": "C", + "templateId": "C___Cytosine" + }, + "monomerTemplate-C___Cytosine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.8617, + 1.3499, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.1117, + 2.6489, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.3882, + 2.649, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.1382, + 1.35, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.3883, + 0.0509, + 0 + ] + }, + { + "label": "N", + "location": [ + 1.1117, + 0.0509, + 0 + ] + }, + { + "label": "N", + "location": [ + 3.0618, + 1.3499, + 0 + ] + }, + { + "label": "O", + "location": [ + -0.9884, + -0.9883, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.3383, + 1.35, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 6 + ] + }, + { + "type": 2, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 2, + "atoms": [ + 4, + 7 + ] + } + ], + "class": "Base", + "classHELM": "RNA", + "id": "C___Cytosine", + "fullName": "Cytosine", + "alias": "C", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 8 + ] + }, + "type": "left" + } + ], + "naturalAnalogShort": "C" + }, + "monomer4": { + "type": "monomer", + "id": "4", + "position": { + "x": 4.25, + "y": -1.25 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomer5": { + "type": "monomer", + "id": "5", + "position": { + "x": 5.75, + "y": -1.25 + }, + "alias": "P", + "templateId": "P___Phosphate" + }, + "monomer6": { + "type": "monomer", + "id": "6", + "position": { + "x": 7.25, + "y": -2.75 + }, + "alias": "G", + "templateId": "G___Guanine" + }, + "monomerTemplate-G___Guanine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.0354, + 0.2498, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.0792, + -0.754, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.5057, + -0.2906, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.8177, + 1.1766, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.7031, + 2.1804, + 0 + ] + }, + { + "label": "N", + "location": [ + 0.7235, + 1.717, + 0 + ] + }, + { + "label": "N", + "location": [ + -2.3871, + -1.5034, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.5053, + -2.7168, + 0 + ] + }, + { + "label": "N", + "location": [ + -0.0787, + -2.2532, + 0 + ] + }, + { + "label": "O", + "location": [ + 2.1768, + -0.1209, + 0 + ] + }, + { + "label": "N", + "location": [ + -0.9527, + 3.3542, + 0 + ] + }, + { + "label": "H", + "location": [ + -3.5871, + -1.5034, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 0, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 11 + ] + }, + { + "type": 2, + "atoms": [ + 7, + 8 + ] + } + ], + "class": "Base", + "classHELM": "RNA", + "id": "G___Guanine", + "fullName": "Guanine", + "alias": "G", + "attachmentPoints": [ + { + "attachmentAtom": 6, + "leavingGroup": { + "atoms": [ + 11 + ] + }, + "type": "left" + } + ], + "naturalAnalogShort": "G" + }, + "monomer7": { + "type": "monomer", + "id": "7", + "position": { + "x": 7.25, + "y": -1.25 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomer8": { + "type": "monomer", + "id": "8", + "position": { + "x": 7.224153240619644, + "y": -4.221560530130507 + }, + "alias": "A", + "templateId": "A___Adenine" + }, + "monomer9": { + "type": "monomer", + "id": "9", + "position": { + "x": 7.235035122660845, + "y": -5.518204214719301 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomer10": { + "type": "monomer", + "id": "10", + "position": { + "x": 5.764281325412832, + "y": -5.4746766865544965 + }, + "alias": "P", + "templateId": "P___Phosphate" + }, + "monomer11": { + "type": "monomer", + "id": "11", + "position": { + "x": 4.260881882041198, + "y": -4.112741709718486 + }, + "alias": "C", + "templateId": "C___Cytosine" + }, + "monomer12": { + "type": "monomer", + "id": "12", + "position": { + "x": 4.249999999999999, + "y": -5.463794804513293 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomer13": { + "type": "monomer", + "id": "13", + "position": { + "x": 2.8445374949991837, + "y": -5.452912922472095 + }, + "alias": "P", + "templateId": "P___Phosphate" + }, + "monomer14": { + "type": "monomer", + "id": "14", + "position": { + "x": 1.2758467593803484, + "y": -4.101859827677283 + }, + "alias": "G", + "templateId": "G___Guanine" + }, + "monomer15": { + "type": "monomer", + "id": "15", + "position": { + "x": 1.297610523462752, + "y": -5.518204214719299 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomer16": { + "type": "monomer", + "id": "16", + "position": { + "x": 10.408597899308097, + "y": -4.352488767416278 + }, + "alias": "A", + "templateId": "A___Adenine" + }, + "monomer17": { + "type": "monomer", + "id": "17", + "position": { + "x": 10.408597899308097, + "y": -2.8524887674162787 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomer18": { + "type": "monomer", + "id": "18", + "position": { + "x": 11.908597899308097, + "y": -2.8524887674162787 + }, + "alias": "P", + "templateId": "P___Phosphate" + }, + "monomer19": { + "type": "monomer", + "id": "19", + "position": { + "x": 13.422879224720925, + "y": -4.406898177622286 + }, + "alias": "T", + "templateId": "T___Thymine" + }, + "monomerTemplate-T___Thymine": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.8617, + 1.3499, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.1117, + 0.0509, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.3883, + 0.0509, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.1382, + 1.35, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.3882, + 2.649, + 0 + ] + }, + { + "label": "N", + "location": [ + 1.1117, + 2.6489, + 0 + ] + }, + { + "label": "O", + "location": [ + 3.0618, + 1.3499, + 0 + ] + }, + { + "label": "O", + "location": [ + -0.9882, + 3.6882, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.3383, + 1.35, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.7117, + -0.9884, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 0, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 8 + ] + }, + { + "type": 2, + "atoms": [ + 4, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 9 + ] + } + ], + "class": "Base", + "classHELM": "RNA", + "id": "T___Thymine", + "fullName": "Thymine", + "alias": "T", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 8 + ] + }, + "type": "left" + } + ], + "naturalAnalogShort": "T" + }, + "monomer20": { + "type": "monomer", + "id": "20", + "position": { + "x": 13.422879224720925, + "y": -2.906898177622286 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomer21": { + "type": "monomer", + "id": "21", + "position": { + "x": 10.365070371143299, + "y": -5.854188489102093 + }, + "alias": "U", + "templateId": "U___Uracil" + }, + "monomerTemplate-U___Uracil": { + "type": "monomerTemplate", + "atoms": [ + { + "label": "C", + "location": [ + 1.8617, + 1.3499, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.1117, + 0.0509, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.3883, + 0.0509, + 0 + ] + }, + { + "label": "N", + "location": [ + -1.1382, + 1.35, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.3882, + 2.649, + 0 + ] + }, + { + "label": "N", + "location": [ + 1.1117, + 2.6489, + 0 + ] + }, + { + "label": "O", + "location": [ + 3.0618, + 1.3499, + 0 + ] + }, + { + "label": "O", + "location": [ + -0.9882, + 3.6882, + 0 + ] + }, + { + "label": "H", + "location": [ + -2.3383, + 1.35, + 0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 0, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 8 + ] + }, + { + "type": 2, + "atoms": [ + 4, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + } + ], + "class": "Base", + "classHELM": "RNA", + "id": "U___Uracil", + "fullName": "Uracil", + "alias": "U", + "attachmentPoints": [ + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 8 + ] + }, + "type": "left" + } + ], + "naturalAnalogShort": "U" + }, + "monomer22": { + "type": "monomer", + "id": "22", + "position": { + "x": 10.35418848910209, + "y": -7.3575879324737175 + }, + "alias": "R", + "templateId": "R___Ribose" + }, + "monomer23": { + "type": "monomer", + "id": "23", + "position": { + "x": 11.85418848910209, + "y": -7.3575879324737175 + }, + "alias": "P", + "templateId": "P___Phosphate" + } +} \ No newline at end of file diff --git a/utils/indigo-service/backend/service/v2/indigo_api.py b/utils/indigo-service/backend/service/v2/indigo_api.py index 2cd89f7585..c174a7da9e 100644 --- a/utils/indigo-service/backend/service/v2/indigo_api.py +++ b/utils/indigo-service/backend/service/v2/indigo_api.py @@ -1782,3 +1782,103 @@ def render(): ) ) return result, 200, {"Content-Type": content_type} + + +@indigo_api.route("/calculateMacroProperties", methods=["POST"]) +@check_exceptions +def calculateMacroProperties(): + """ + Calculate macromulecule properties + --- + tags: + - indigo + parameters: + - name: json_request + in: body + required: true + schema: + id: IndigoRequest + required: + - struct + properties: + struct: + type: string + required: true + examples: C1=CC=CC=C1 + output_format: + type: string + default: chemical/x-mdl-molfile + examples: chemical/x-daylight-smiles + enum: + - chemical/x-mdl-rxnfile + - chemical/x-mdl-molfile + - chemical/x-indigo-ket + - chemical/x-daylight-smiles + - chemical/x-chemaxon-cxsmiles + - chemical/x-cml + - chemical/x-inchi + - chemical/x-iupac + - chemical/x-daylight-smarts + - chemical/x-inchi-aux + example: + struct: C1=CC=CC=C1 + output_format: chemical/x-daylight-smiles + responses: + 200: + description: Aromatized chemical structure + schema: + id: IndigoResponse + required: + - struct + - format + properties: + struct: + type: string + format: + type: string + default: chemical/x-mdl-molfile + 400: + description: 'A problem with supplied client data' + schema: + id: ClientError + required: + - error + properties: + error: + type: string + 500: + description: 'A problem on server side' + schema: + id: ServerError + required: + - error + properties: + error: + type: string + """ + + request_data = get_request_data(request) + indigo_api_logger.info("[RAW REQUEST] {}".format(request_data)) + + data = IndigoRequestSchema().load(request_data) + + LOG_DATA( + "[REQUEST] /calculateMacroProperties", + data["input_format"], + data["output_format"], + data["struct"], + data["options"], + ) + indigo = indigo_init(data["options"]) + + md = load_moldata( + data["struct"], + mime_type=data["input_format"], + options=data["options"], + indigo=indigo, + try_document=True, + ) + + result = {"properties": md.struct.macroProperties()} + + return jsonify(result), 200, {"Content-Type": "application/json"}