diff --git a/api/tests/integration/ref/basic/ketfile_stereo_desc.py.out b/api/tests/integration/ref/basic/ketfile_stereo_desc.py.out new file mode 100644 index 0000000000..118bfdad0b --- /dev/null +++ b/api/tests/integration/ref/basic/ketfile_stereo_desc.py.out @@ -0,0 +1,41 @@ +1910.mol:SUCCEED +C14_R_iso.mol:SUCCEED +C14_R_iso_2.mol:SUCCEED +CIP_issue.mol:SUCCEED +P-9.5.2.2_ex3.mol:SUCCEED +P-92.5.1.mol:SUCCEED +P-92.5.3.mol:SUCCEED +P-92.6.mol:SUCCEED +P-92.6_2.mol:SUCCEED +P-92.6_ex2.mol:SUCCEED +P-92_2_1_1_3_ex1.mol:SUCCEED +P-92_2_1_1_3_ex2.mol:SUCCEED +P-92_2_1_2_1_ex1.mol:SUCCEED +P-92_2_1_2_1_ex2.mol:SUCCEED +P-92_2_1_2_1_ex3.mol:SUCCEED +P-92_2_1_3_ex1.mol:SUCCEED +P-92_2_1_3_ex2.mol:SUCCEED +RS-symmetrical-structure.mol:SUCCEED +RS.mol:SUCCEED +RS_for_incorrect_valence.mol:SUCCEED +S-R diff.mol:SUCCEED +StereochemComplexTester_AllAbs.mol:SUCCEED +all-trans-inositol.mol:SUCCEED +atom_any.mol:SUCCEED +cis.mol:SUCCEED +different stereo 2.mol:SUCCEED +different stereo 3.mol:SUCCEED +different stereo 4.mol:SUCCEED +different stereo 5.mol:SUCCEED +different stereo.mol:SUCCEED +ketcher.mol:SUCCEED +stereo-different-ketcher-marvin.mol:SUCCEED +stereo-different-ketcher-marvin2.mol:SUCCEED +t4_R.mol:SUCCEED +t4_R_iso.mol:SUCCEED +t4_S.mol:SUCCEED +t4_S_iso.mol:SUCCEED +trans.mol:SUCCEED +without_stereo_label.mol:SUCCEED +crazystereo.rxn:SUCCEED + diff --git a/api/tests/integration/tests/basic/ketfile_stereo_desc.py b/api/tests/integration/tests/basic/ketfile_stereo_desc.py new file mode 100644 index 0000000000..dac7cd19c7 --- /dev/null +++ b/api/tests/integration/tests/basic/ketfile_stereo_desc.py @@ -0,0 +1,99 @@ +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 * + +threading.stack_size(2 * 1024 * 1024) + + +def stereo_desc_test(py_file, out_queue): + str_res = "" + ref_path = joinPathPy("ref/", __file__) + root = joinPathPy("molecules/CIP/", __file__) + + indigo = Indigo() + indigo.setOption("json-saving-pretty", True) + + for filename in sorted(os.listdir(root)): + ketfile = joinPathPy( + os.path.join(ref_path, filename[:-4] + ".ket"), __file__ + ) + mol = indigo.loadMoleculeFromFile(os.path.join(root, filename)) + with open(ketfile, "r") as file: + ket_ref = file.read() + mol_json_no_cip = mol.json() + indigo.setOption("json-saving-add-stereo-desc", True) + mol_json_cip = mol.json() + diff = find_diff(ket_ref, mol_json_cip) + if not diff: + diff = find_diff(mol_json_no_cip, mol_json_cip) + indigo.setOption("json-saving-add-stereo-desc", False) + mol = indigo.loadMoleculeFromFile( + os.path.join(root, filename) + ) # reload to reset CIP + if diff: + diff = find_diff(mol.json(), mol_json_no_cip) + if diff: + str_res += ( + "mismatch: json-saving-add-stereo-desc = false:\n" + ) + else: + # check conversion + indigo.setOption("molfile-saving-add-stereo-desc", True) + mol_cip = indigo.loadMolecule( + mol.molfile() + ) # mol_cip should contain CIP as properties of atoms and bonds + diff = find_diff( + mol_cip.json(), mol_json_cip + ) # check if molecule has CIP + if diff: + str_res += "mismatch: molfile loader doesn't convert CIP SGroups:\n" + else: + str_res += filename + ":SUCCEED\n" + continue + str_res += filename + ":FAILED\n" + str_res += diff + "\n" + + indigo.setOption("ignore-stereochemistry-errors", "true") + filename = "crazystereo.rxn" + + rxn = indigo.loadReactionFromFile( + os.path.join(joinPathPy("reactions/", __file__), filename) + ) + + ketfile = joinPathPy(os.path.join(ref_path, "crazystereo.ket"), __file__) + with open(ketfile, "r") as file: + ket_ref = file.read() + diff = find_diff(ket_ref, rxn.json()) + if not diff: + str_res += filename + ":SUCCEED\n" + else: + str_res += filename + ":FAILED\n" + str_res += diff + "\n" + out_queue.put(str_res) + + +if isJython(): + from Queue import Queue +else: + from queue import Queue + +th_queue = Queue() +test_thread = threading.Thread( + target=stereo_desc_test, args=(os.path.abspath(__file__), th_queue) +) +test_thread.start() +test_thread.join() +print(th_queue.get()) diff --git a/api/tests/integration/tests/basic/ref/1910.ket b/api/tests/integration/tests/basic/ref/1910.ket new file mode 100644 index 0000000000..715878a3a5 --- /dev/null +++ b/api/tests/integration/tests/basic/ref/1910.ket @@ -0,0 +1,346 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 0.02590000070631504, + -1.5098999738693238, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -1.4842000007629395, + -2.2553000450134279, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 1.4775999784469605, + -2.2358999252319338, + 0.0 + ] + }, + { + "label": "O", + "location": [ + -0.8166000247001648, + -5.165200233459473, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -1.8598999977111817, + -3.907900094985962, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.02590000070631504, + 0.18150000274181367, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 1.8730000257492066, + -3.8691000938415529, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.868399977684021, + -5.165200233459473, + 0.0 + ] + }, + { + "label": "N", + "location": [ + -3.2404000759124758, + 3.8756000995635988, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -1.8210999965667725, + 1.3027000427246094, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 2.72189998626709, + -1.0952999591827393, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -2.7284998893737795, + -1.114799976348877, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -1.8210999965667725, + 3.032900094985962, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -3.434799909591675, + -4.4004998207092289, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 3.4867000579833986, + -4.361700057983398, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -4.731100082397461, + 2.987600088119507, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -3.2404000759124758, + 5.58650016784668, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 4.32919979095459, + -1.5683000087738038, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -4.296800136566162, + -1.6655000448226929, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -4.692200183868408, + -3.2987000942230226, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 4.7245001792907719, + -3.2014999389648439, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 1, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 5, + 0 + ], + "cip": "Z" + }, + { + "type": 1, + "atoms": [ + 6, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 12 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 5 + ] + }, + { + "type": 2, + "atoms": [ + 10, + 2 + ] + }, + { + "type": 2, + "atoms": [ + 11, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 12, + 9 + ] + }, + { + "type": 2, + "atoms": [ + 13, + 4 + ] + }, + { + "type": 2, + "atoms": [ + 14, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 15, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 16, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 17, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 18, + 11 + ] + }, + { + "type": 2, + "atoms": [ + 19, + 18 + ] + }, + { + "type": 1, + "atoms": [ + 19, + 13 + ] + }, + { + "type": 2, + "atoms": [ + 20, + 17 + ] + }, + { + "type": 1, + "atoms": [ + 20, + 14 + ] + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/C14_R_iso.ket b/api/tests/integration/tests/basic/ref/C14_R_iso.ket new file mode 100644 index 0000000000..0a945128be --- /dev/null +++ b/api/tests/integration/tests/basic/ref/C14_R_iso.ket @@ -0,0 +1,133 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + -6.7052998542785648, + -0.23980000615119935, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + -6.7052998542785648, + -1.0648000240325928, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -7.5524001121521, + -0.5271000266075134, + 0.0 + ] + }, + { + "label": "H", + "location": [ + -6.756899833679199, + 0.9991000294685364, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -5.665299892425537, + -0.519599974155426, + 0.0 + ], + "isotope": 14 + }, + { + "label": "C", + "location": [ + -7.942699909210205, + -1.4980000257492066, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -5.4959001541137699, + -1.167799949645996, + 0.0 + ] + }, + { + "label": "O", + "location": [ + -6.714099884033203, + -2.1342999935150148, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 2, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 7 + ] + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/C14_R_iso_2.ket b/api/tests/integration/tests/basic/ref/C14_R_iso_2.ket new file mode 100644 index 0000000000..b0b6b41cf9 --- /dev/null +++ b/api/tests/integration/tests/basic/ref/C14_R_iso_2.ket @@ -0,0 +1,133 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + -6.7052998542785648, + -0.23980000615119935, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + -6.7052998542785648, + -1.0648000240325928, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -7.5524001121521, + -0.5271000266075134, + 0.0 + ] + }, + { + "label": "H", + "location": [ + -6.756899833679199, + 0.9991000294685364, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -5.665299892425537, + -0.519599974155426, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -7.942699909210205, + -1.4980000257492066, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -5.4959001541137699, + -1.167799949645996, + 0.0 + ], + "isotope": 14 + }, + { + "label": "O", + "location": [ + -6.714099884033203, + -2.1342999935150148, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 2, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 7 + ] + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/CIP_issue.ket b/api/tests/integration/tests/basic/ref/CIP_issue.ket new file mode 100644 index 0000000000..785e980314 --- /dev/null +++ b/api/tests/integration/tests/basic/ref/CIP_issue.ket @@ -0,0 +1,266 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 1.7237000465393067, + 3.40310001373291, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 1.7237000465393067, + 4.228099822998047, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 2.4381000995635988, + 4.640600204467773, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 1.0091999769210816, + 4.640600204467773, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 1.0091999769210816, + 5.46560001373291, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.2946999967098236, + 4.228099822998047, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 1.1403000354766846, + 2.8197999000549318, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 2.4381000995635988, + 2.990600109100342, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 3.234999895095825, + 3.204200029373169, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 3.6475000381469728, + 2.4897000789642336, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 2.850600004196167, + 2.27620005607605, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.42579999566078188, + 2.4072999954223635, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.42579999566078188, + 1.582200050354004, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 1.1403000354766846, + 1.169700026512146, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 1.8547999858856202, + 1.582200050354004, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 1.8547999858856202, + 2.4072999954223635, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 10, + 7 + ] + }, + { + "type": 2, + "atoms": [ + 11, + 12 + ] + }, + { + "type": 1, + "atoms": [ + 12, + 13 + ] + }, + { + "type": 2, + "atoms": [ + 13, + 14 + ] + }, + { + "type": 1, + "atoms": [ + 14, + 15 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 11 + ] + }, + { + "type": 2, + "atoms": [ + 6, + 15 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ], + "stereo": 1 + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/P-9.5.2.2_ex3.ket b/api/tests/integration/tests/basic/ref/P-9.5.2.2_ex3.ket new file mode 100644 index 0000000000..1e4e53080b --- /dev/null +++ b/api/tests/integration/tests/basic/ref/P-9.5.2.2_ex3.ket @@ -0,0 +1,214 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 7.999599933624268, + 11.65310001373291, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 7.285099983215332, + 11.240599632263184, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 7.285099983215332, + 10.415599822998047, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 7.999599933624268, + 10.003100395202637, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 8.71399974822998, + 10.415599822998047, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 8.71399974822998, + 11.240599632263184, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "Cl", + "location": [ + 7.999599933624268, + 12.478099822998047, + 0.0 + ] + }, + { + "label": "Cl", + "location": [ + 6.5706000328063969, + 11.65310001373291, + 0.0 + ] + }, + { + "label": "Cl", + "location": [ + 6.5706000328063969, + 10.003100395202637, + 0.0 + ] + }, + { + "label": "Cl", + "location": [ + 7.999599933624268, + 9.178099632263184, + 0.0 + ] + }, + { + "label": "Cl", + "location": [ + 9.428500175476075, + 10.003100395202637, + 0.0 + ] + }, + { + "label": "Cl", + "location": [ + 9.428500175476075, + 11.65310001373291, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 6 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 1, + 7 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 2, + 8 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 3, + 9 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 4, + 10 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 11 + ], + "stereo": 6 + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/P-92.5.1.ket b/api/tests/integration/tests/basic/ref/P-92.5.1.ket new file mode 100644 index 0000000000..311dcdbe38 --- /dev/null +++ b/api/tests/integration/tests/basic/ref/P-92.5.1.ket @@ -0,0 +1,362 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 4.507999897003174, + 5.598199844360352, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 5.222499847412109, + 5.185699939727783, + 0.0 + ], + "stereoLabel": "&1", + "cip": "s" + }, + { + "label": "C", + "location": [ + 5.936999797821045, + 5.598199844360352, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 6.651400089263916, + 5.185699939727783, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 7.365900039672852, + 5.598199844360352, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 8.080400466918946, + 5.185699939727783, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 3.793600082397461, + 5.185699939727783, + 0.0 + ] + }, + { + "label": "Cl", + "location": [ + 3.9247000217437746, + 6.181600093841553, + 0.0 + ] + }, + { + "label": "Cl", + "location": [ + 7.77839994430542, + 6.312699794769287, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 5.222499847412109, + 4.3607001304626469, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 6.651400089263916, + 4.3607001304626469, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "Cl", + "location": [ + 4.5005998611450199, + 4.0808000564575199, + 0.0 + ] + }, + { + "label": "Cl", + "location": [ + 6.437900066375732, + 3.563800096511841, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 5.526000022888184, + 3.600600004196167, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 7.448299884796143, + 4.147200107574463, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 5.598100185394287, + 6.4085001945495609, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 6.953400135040283, + 6.312699794769287, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 6.3495001792907719, + 6.312699794769287, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 4.507999897003174, + 4.773200035095215, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 4.920499801635742, + 6.312699794769287, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 5.008999824523926, + 3.563800096511841, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 5.826399803161621, + 4.3607001304626469, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 13 + ] + }, + { + "type": 1, + "atoms": [ + 10, + 14 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 7 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 2, + 15 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 4, + 8 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 10, + 12 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 9, + 11 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 4, + 16 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 2, + 17 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 1, + 18 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 0, + 19 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 9, + 20 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 10, + 21 + ], + "stereo": 6 + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/P-92.5.3.ket b/api/tests/integration/tests/basic/ref/P-92.5.3.ket new file mode 100644 index 0000000000..3a9dc68e3e --- /dev/null +++ b/api/tests/integration/tests/basic/ref/P-92.5.3.ket @@ -0,0 +1,380 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + -4.596399784088135, + 4.454999923706055, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + -4.0131001472473148, + 3.8715999126434328, + 0.0 + ], + "stereoLabel": "&1", + "cip": "s" + }, + { + "label": "C", + "location": [ + -4.425600051879883, + 3.1572000980377199, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + -3.2985999584198, + 4.28410005569458, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + -2.5841000080108644, + 3.8715999126434328, + 0.0 + ], + "stereoLabel": "&1", + "cip": "r" + }, + { + "label": "C", + "location": [ + -1.8696999549865723, + 4.28410005569458, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + -2.171600103378296, + 3.1572000980377199, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + -5.3109002113342289, + 4.042500019073486, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -4.195700168609619, + 2.455899953842163, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -2.401400089263916, + 2.473599910736084, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -1.1552000045776368, + 3.8715999126434328, + 0.0 + ] + }, + { + "label": "H", + "location": [ + -3.7111001014709474, + 4.998600006103516, + 0.0 + ] + }, + { + "label": "H", + "location": [ + -1.6561000347137452, + 5.080999851226807, + 0.0 + ] + }, + { + "label": "H", + "location": [ + -1.4394999742507935, + 2.3557000160217287, + 0.0 + ] + }, + { + "label": "H", + "location": [ + -2.9965999126434328, + 3.1572000980377199, + 0.0 + ] + }, + { + "label": "H", + "location": [ + -3.600600004196167, + 3.1572000980377199, + 0.0 + ] + }, + { + "label": "H", + "location": [ + -5.415599822998047, + 3.38700008392334, + 0.0 + ] + }, + { + "label": "H", + "location": [ + -5.008900165557861, + 5.16949987411499, + 0.0 + ] + }, + { + "label": "O", + "location": [ + -2.8861000537872316, + 4.998600006103516, + 0.0 + ] + }, + { + "label": "Cl", + "location": [ + -5.3933000564575199, + 4.668499946594238, + 0.0 + ] + }, + { + "label": "Cl", + "location": [ + -1.0728000402450562, + 4.497700214385986, + 0.0 + ] + }, + { + "label": "Cl", + "location": [ + -1.4187999963760377, + 3.4872000217437746, + 0.0 + ] + }, + { + "label": "Cl", + "location": [ + -5.104700088500977, + 2.4972000122070314, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 18 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 3, + 11 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 5, + 12 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 0, + 19 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 4, + 14 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 1, + 15 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 6, + 21 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 2, + 16 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 0, + 17 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 5, + 20 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 6, + 13 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 2, + 22 + ], + "stereo": 6 + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/P-92.6.ket b/api/tests/integration/tests/basic/ref/P-92.6.ket new file mode 100644 index 0000000000..8f114f6519 --- /dev/null +++ b/api/tests/integration/tests/basic/ref/P-92.6.ket @@ -0,0 +1,186 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + -2.165600061416626, + 5.848700046539307, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -1.6574000120162964, + 5.450900077819824, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "S", + "location": [ + -2.0699000358581545, + 4.6996002197265629, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -0.8604999780654907, + 5.664400100708008, + 0.0 + ], + "stereoLabel": "&1", + "cip": "r" + }, + { + "label": "C", + "location": [ + -0.06360000371932984, + 5.450900077819824, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 0.4828000068664551, + 5.796999931335449, + 0.0 + ] + }, + { + "label": "S", + "location": [ + 0.31349998712539675, + 4.661300182342529, + 0.0 + ] + }, + { + "label": "S", + "location": [ + -0.8604999780654907, + 6.4893999099731449, + 0.0 + ] + }, + { + "label": "H", + "location": [ + -1.0740000009536744, + 4.867499828338623, + 0.0 + ] + }, + { + "label": "H", + "location": [ + -0.6470000147819519, + 4.867499828338623, + 0.0 + ] + }, + { + "label": "H", + "location": [ + -0.27720001339912417, + 6.247799873352051, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 4, + 6 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 3, + 7 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 4, + 9 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 1, + 8 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 3, + 10 + ], + "stereo": 6 + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/P-92.6_2.ket b/api/tests/integration/tests/basic/ref/P-92.6_2.ket new file mode 100644 index 0000000000..38396d91b0 --- /dev/null +++ b/api/tests/integration/tests/basic/ref/P-92.6_2.ket @@ -0,0 +1,138 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 1.6912000179290772, + 2.408400058746338, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 2.2878000736236574, + 2.084199905395508, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "S", + "location": [ + 1.8753000497817994, + 1.332900047302246, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 3.084700107574463, + 2.2976999282836916, + 0.0 + ], + "stereoLabel": "&1", + "cip": "r" + }, + { + "label": "C", + "location": [ + 3.8815999031066896, + 2.084199905395508, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 4.427999973297119, + 2.430299997329712, + 0.0 + ] + }, + { + "label": "S", + "location": [ + 4.258699893951416, + 1.294600009918213, + 0.0 + ] + }, + { + "label": "S", + "location": [ + 3.084700107574463, + 3.1226999759674074, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 4, + 6 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 3, + 7 + ], + "stereo": 1 + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/P-92.6_ex2.ket b/api/tests/integration/tests/basic/ref/P-92.6_ex2.ket new file mode 100644 index 0000000000..e47258b158 --- /dev/null +++ b/api/tests/integration/tests/basic/ref/P-92.6_ex2.ket @@ -0,0 +1,112 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 6.275899887084961, + 7.439700126647949, + 0.0 + ], + "stereoLabel": "&1", + "cip": "r" + }, + { + "label": "C", + "location": [ + 6.9903998374938969, + 7.852200031280518, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 6.9903998374938969, + 7.027200222015381, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 7.704800128936768, + 7.439700126647949, + 0.0 + ], + "stereoLabel": "&1", + "cip": "r" + }, + { + "label": "O", + "location": [ + 8.117300033569336, + 8.154199600219727, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 5.863399982452393, + 6.725299835205078, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 0, + 5 + ], + "stereo": 6 + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/P-92_2_1_1_3_ex1.ket b/api/tests/integration/tests/basic/ref/P-92_2_1_1_3_ex1.ket new file mode 100644 index 0000000000..c2ac724d30 --- /dev/null +++ b/api/tests/integration/tests/basic/ref/P-92_2_1_1_3_ex1.ket @@ -0,0 +1,294 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 3.3368000984191896, + 3.0938000679016115, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "O", + "location": [ + 3.3368000984191896, + 3.918800115585327, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 4.051300048828125, + 2.681299924850464, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 2.6224000453948976, + 2.681299924850464, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 4.7657999992370609, + 3.0938000679016115, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 5.480199813842773, + 2.681299924850464, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 1.9078999757766724, + 3.0938000679016115, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 1.1934000253677369, + 2.681299924850464, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 2.6224000453948976, + 1.8562999963760377, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 4.051300048828125, + 1.8562999963760377, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 1.9078999757766724, + 1.4437999725341797, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 4.7657999992370609, + 1.4437999725341797, + 0.0 + ] + }, + { + "label": "F", + "location": [ + 4.7657999992370609, + 3.918800115585327, + 0.0 + ] + }, + { + "label": "F", + "location": [ + 1.9078999757766724, + 3.918800115585327, + 0.0 + ] + }, + { + "label": "F", + "location": [ + 0.4788999855518341, + 3.0938000679016115, + 0.0 + ] + }, + { + "label": "Cl", + "location": [ + 6.194699764251709, + 3.0938000679016115, + 0.0 + ] + }, + { + "label": "Br", + "location": [ + 4.7657999992370609, + 0.6187999844551086, + 0.0 + ] + }, + { + "label": "I", + "location": [ + 1.9078999757766724, + 0.6187999844551086, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 14 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 15 + ] + }, + { + "type": 1, + "atoms": [ + 11, + 16 + ] + }, + { + "type": 1, + "atoms": [ + 10, + 17 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 13 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 4, + 12 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 3, + 8 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 2, + 9 + ], + "stereo": 1 + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/P-92_2_1_1_3_ex2.ket b/api/tests/integration/tests/basic/ref/P-92_2_1_1_3_ex2.ket new file mode 100644 index 0000000000..12ecfe7b33 --- /dev/null +++ b/api/tests/integration/tests/basic/ref/P-92_2_1_1_3_ex2.ket @@ -0,0 +1,294 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 3.3368000984191896, + 3.0938000679016115, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "O", + "location": [ + 3.3368000984191896, + 3.918800115585327, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 4.051300048828125, + 2.681299924850464, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 2.6224000453948976, + 2.681299924850464, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 4.7657999992370609, + 3.0938000679016115, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 5.480199813842773, + 2.681299924850464, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 1.9078999757766724, + 3.0938000679016115, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 1.1934000253677369, + 2.681299924850464, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 2.6224000453948976, + 1.8562999963760377, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 4.051300048828125, + 1.8562999963760377, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 1.9078999757766724, + 1.4437999725341797, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 4.7657999992370609, + 1.4437999725341797, + 0.0 + ] + }, + { + "label": "F", + "location": [ + 4.7657999992370609, + 3.918800115585327, + 0.0 + ] + }, + { + "label": "F", + "location": [ + 1.9078999757766724, + 3.918800115585327, + 0.0 + ] + }, + { + "label": "F", + "location": [ + 0.4788999855518341, + 3.0938000679016115, + 0.0 + ] + }, + { + "label": "F", + "location": [ + 6.194699764251709, + 3.0938000679016115, + 0.0 + ] + }, + { + "label": "Br", + "location": [ + 4.7657999992370609, + 0.6187999844551086, + 0.0 + ] + }, + { + "label": "I", + "location": [ + 1.9078999757766724, + 0.6187999844551086, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 14 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 15 + ] + }, + { + "type": 1, + "atoms": [ + 11, + 16 + ] + }, + { + "type": 1, + "atoms": [ + 10, + 17 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 13 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 4, + 12 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 3, + 8 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 2, + 9 + ], + "stereo": 1 + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/P-92_2_1_2_1_ex1.ket b/api/tests/integration/tests/basic/ref/P-92_2_1_2_1_ex1.ket new file mode 100644 index 0000000000..6caf9f11eb --- /dev/null +++ b/api/tests/integration/tests/basic/ref/P-92_2_1_2_1_ex1.ket @@ -0,0 +1,102 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 10.297800064086914, + 6.960899829864502, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "O", + "location": [ + 10.297800064086914, + 7.785900115966797, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 9.58329963684082, + 6.548399925231934, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 11.012200355529786, + 6.548399925231934, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 11.837200164794922, + 6.548399925231934, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 9.58329963684082, + 5.723400115966797, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 5 + ] + }, + { + "type": 2, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ], + "stereo": 1 + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/P-92_2_1_2_1_ex2.ket b/api/tests/integration/tests/basic/ref/P-92_2_1_2_1_ex2.ket new file mode 100644 index 0000000000..464c18079c --- /dev/null +++ b/api/tests/integration/tests/basic/ref/P-92_2_1_2_1_ex2.ket @@ -0,0 +1,102 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 10.297800064086914, + 6.960899829864502, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "O", + "location": [ + 10.297800064086914, + 7.785900115966797, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 9.58329963684082, + 6.548399925231934, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 11.012200355529786, + 6.548399925231934, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 11.837200164794922, + 6.548399925231934, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 9.58329963684082, + 5.723400115966797, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 2, + "atoms": [ + 2, + 5 + ] + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/P-92_2_1_2_1_ex3.ket b/api/tests/integration/tests/basic/ref/P-92_2_1_2_1_ex3.ket new file mode 100644 index 0000000000..ef59e7593b --- /dev/null +++ b/api/tests/integration/tests/basic/ref/P-92_2_1_2_1_ex3.ket @@ -0,0 +1,102 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 10.297800064086914, + 6.960899829864502, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "O", + "location": [ + 10.297800064086914, + 7.785900115966797, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 9.58329963684082, + 6.548399925231934, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 11.012200355529786, + 6.548399925231934, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 11.837200164794922, + 6.548399925231934, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 9.58329963684082, + 5.723400115966797, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 3, + "atoms": [ + 2, + 5 + ] + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/P-92_2_1_3_ex1.ket b/api/tests/integration/tests/basic/ref/P-92_2_1_3_ex1.ket new file mode 100644 index 0000000000..58bec1b694 --- /dev/null +++ b/api/tests/integration/tests/basic/ref/P-92_2_1_3_ex1.ket @@ -0,0 +1,243 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 1.7348999977111817, + -2.5481998920440676, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 1.020400047302246, + -1.3107000589370728, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.9761999845504761, + -0.5519999861717224, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.3059000074863434, + -1.7231999635696412, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 1.107300043106079, + -3.1315999031066896, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 2.4493000507354738, + -2.960700035095215, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 3.2462000846862795, + -2.7472000122070314, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 3.6586999893188478, + -3.461699962615967, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 2.861799955368042, + -3.6751999855041506, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.3416999876499176, + -2.9493000507354738, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -0.24169999361038209, + -3.5327000617980959, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -0.028200000524520875, + -4.329599857330322, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.7687000036239624, + -4.543099880218506, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 1.2896000146865845, + -3.990999937057495, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 11, + 12 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 10, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 12, + 13 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 13 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 4 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/P-92_2_1_3_ex2.ket b/api/tests/integration/tests/basic/ref/P-92_2_1_3_ex2.ket new file mode 100644 index 0000000000..52a56fd157 --- /dev/null +++ b/api/tests/integration/tests/basic/ref/P-92_2_1_3_ex2.ket @@ -0,0 +1,243 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 1.7237000465393067, + 3.40310001373291, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "N", + "location": [ + 1.0091999769210816, + 4.640600204467773, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.9649999737739563, + 5.3993000984191898, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.2946999967098236, + 4.228099822998047, + 0.0 + ] + }, + { + "label": "N", + "location": [ + 1.0960999727249146, + 2.8197999000549318, + 0.0 + ] + }, + { + "label": "N", + "location": [ + 2.4381000995635988, + 2.990600109100342, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 3.234999895095825, + 3.204200029373169, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 3.6475000381469728, + 2.4897000789642336, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 2.850600004196167, + 2.27620005607605, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.3305000066757202, + 3.002000093460083, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -0.25290000438690188, + 2.418600082397461, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -0.039400000125169757, + 1.6217999458312989, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.7574999928474426, + 1.4082000255584717, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 1.27839994430542, + 1.9603999853134156, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 11, + 12 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 10, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 12, + 13 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 13 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 4 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/RS-symmetrical-structure.ket b/api/tests/integration/tests/basic/ref/RS-symmetrical-structure.ket new file mode 100644 index 0000000000..6e29d1c544 --- /dev/null +++ b/api/tests/integration/tests/basic/ref/RS-symmetrical-structure.ket @@ -0,0 +1,257 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + -3.2177999019622804, + 8.700499534606934, + 0.0 + ], + "stereoLabel": "&1", + "cip": "s" + }, + { + "label": "C", + "location": [ + -2.5032999515533449, + 8.288000106811524, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -2.5032999515533449, + 7.4629998207092289, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -3.2177999019622804, + 7.05049991607666, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + -3.9321999549865724, + 7.4629998207092289, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -3.9321999549865724, + 8.288000106811524, + 0.0 + ] + }, + { + "label": "O", + "location": [ + -3.2177999019622804, + 6.225900173187256, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -3.8850998878479006, + 9.185400009155274, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -2.55049991607666, + 9.185400009155274, + 0.0 + ] + }, + { + "label": "O", + "location": [ + -4.669400215148926, + 8.930500030517579, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -2.805299997329712, + 9.969799995422364, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "N", + "location": [ + -3.630199909210205, + 9.969799995422364, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -2.3206000328063967, + 10.63700008392334, + 0.0 + ] + }, + { + "label": "O", + "location": [ + -1.500499963760376, + 10.550800323486329, + 0.0 + ] + }, + { + "label": "O", + "location": [ + -2.656100034713745, + 11.39050006866455, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 2, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 6 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 0, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 8 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 7, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 11, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 10, + 12 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 12, + 13 + ] + }, + { + "type": 2, + "atoms": [ + 12, + 14 + ] + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/RS.ket b/api/tests/integration/tests/basic/ref/RS.ket new file mode 100644 index 0000000000..e39a402f36 --- /dev/null +++ b/api/tests/integration/tests/basic/ref/RS.ket @@ -0,0 +1,324 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "N", + "location": [ + 3.539299964904785, + 3.05649995803833, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 3.0476999282836916, + 3.7181999683380129, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 4.310999870300293, + 4.145999908447266, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 4.3206000328063969, + 3.321000099182129, + 0.0 + ] + }, + { + "label": "N", + "location": [ + 5.039100170135498, + 2.9193999767303469, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 5.749800205230713, + 3.3385000228881838, + 0.0 + ] + }, + { + "label": "N", + "location": [ + 5.739299774169922, + 4.162600040435791, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 5.019899845123291, + 4.565899848937988, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 5.026899814605713, + 5.3368000984191898, + 0.0 + ] + }, + { + "label": "N", + "location": [ + 3.524399995803833, + 4.391300201416016, + 0.0 + ] + }, + { + "label": "N", + "location": [ + 6.593100070953369, + 2.8993000984191896, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 3.2816998958587648, + 2.2418999671936037, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 2.3965001106262209, + 1.6971999406814576, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 2.9421000480651857, + 0.8137000203132629, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 3.8264999389648439, + 1.3583999872207642, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 4.55810022354126, + 1.1969000101089478, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 5.205900192260742, + 1.595900058746338, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 2.715100049972534, + 0.19990000128746034, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 2.06820011138916, + 0.0, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 2, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 2, + "atoms": [ + 7, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 1, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 11, + 12 + ] + }, + { + "type": 1, + "atoms": [ + 12, + 13 + ] + }, + { + "type": 1, + "atoms": [ + 13, + 14 + ] + }, + { + "type": 1, + "atoms": [ + 15, + 16 + ] + }, + { + "type": 2, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 11, + 14 + ] + }, + { + "type": 1, + "atoms": [ + 17, + 18 + ] + }, + { + "type": 1, + "atoms": [ + 11, + 0 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 13, + 17 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 14, + 15 + ], + "stereo": 6 + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/RS_for_incorrect_valence.ket b/api/tests/integration/tests/basic/ref/RS_for_incorrect_valence.ket new file mode 100644 index 0000000000..17faa8b3cc --- /dev/null +++ b/api/tests/integration/tests/basic/ref/RS_for_incorrect_valence.ket @@ -0,0 +1,177 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + -5.196100234985352, + 0.0, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -4.330100059509277, + 0.5, + 0.0 + ] + }, + { + "label": "K", + "location": [ + -3.464099884033203, + 0.0, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -2.598099946975708, + 0.5, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -1.732100009918213, + 0.0, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -0.8659999966621399, + 0.5, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.0, + 0.0, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 0.8659999966621399, + 0.5, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 1.732100009918213, + 0.0, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 2.598099946975708, + 0.5, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.0, + -1.0, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 10 + ], + "stereo": 6 + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/S-R diff.ket b/api/tests/integration/tests/basic/ref/S-R diff.ket new file mode 100644 index 0000000000..10d7a4bf72 --- /dev/null +++ b/api/tests/integration/tests/basic/ref/S-R diff.ket @@ -0,0 +1,278 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 0.824999988079071, + 0.7696999907493591, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 1.649999976158142, + 0.7696999907493591, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 2.0625, + 0.05530000105500221, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 1.649999976158142, + -0.6592000126838684, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.824999988079071, + -0.6592000126838684, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.4124999940395355, + 0.05530000105500221, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 0.0, + -0.6592000126838684, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -0.824999988079071, + -0.6592000126838684, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -1.2374999523162842, + 0.05530000105500221, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -0.824999988079071, + 0.7696999907493591, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.0, + 0.7696999907493591, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -2.0625, + 0.05530000105500221, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.824999988079071, + -1.4842000007629395, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.11050000041723252, + -1.0716999769210816, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.4124999940395355, + 1.4842000007629395, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 2, + "atoms": [ + 7, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 0 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 12 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 13 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 14 + ] + } + ], + "sgroups": [ + { + "type": "DAT", + "atoms": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14 + ], + "fieldName": "MDLBG_FRAGMENT_STEREO", + "fieldData": "abs", + "x": 2.509000062942505, + "y": -2.3745999336242677, + "placement": true + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/StereochemComplexTester_AllAbs.ket b/api/tests/integration/tests/basic/ref/StereochemComplexTester_AllAbs.ket new file mode 100644 index 0000000000..72cecafccb --- /dev/null +++ b/api/tests/integration/tests/basic/ref/StereochemComplexTester_AllAbs.ket @@ -0,0 +1,714 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 8.885600090026856, + -5.886099815368652, + 0.0 + ], + "stereoLabel": "abs", + "cip": "R" + }, + { + "label": "C", + "location": [ + 8.885600090026856, + -6.866099834442139, + 0.0 + ], + "stereoLabel": "abs", + "cip": "R" + }, + { + "label": "C", + "location": [ + 9.435600280761719, + -7.596099853515625, + 0.0 + ], + "stereoLabel": "abs", + "cip": "S" + }, + { + "label": "C", + "location": [ + 10.285599708557129, + -7.966100215911865, + 0.0 + ], + "stereoLabel": "abs", + "cip": "R" + }, + { + "label": "O", + "location": [ + 9.655599594116211, + -8.626099586486817, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 10.675600051879883, + -8.896100044250489, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 11.285599708557129, + -7.856100082397461, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 11.96560001373291, + -7.256100177764893, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 12.3056001663208, + -6.286099910736084, + 0.0 + ], + "stereoLabel": "abs", + "cip": "S" + }, + { + "label": "C", + "location": [ + 11.925600051879883, + -5.326099872589111, + 0.0 + ], + "stereoLabel": "abs", + "cip": "R" + }, + { + "label": "C", + "location": [ + 11.165599822998047, + -4.746099948883057, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 10.315600395202637, + -5.196100234985352, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 9.365599632263184, + -5.076099872589111, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 8.925600051879883, + -4.186100006103516, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 10.595600128173829, + -6.136099815368652, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 12.935600280761719, + -5.54610013961792, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 13.815600395202637, + -5.956099987030029, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 13.645600318908692, + -4.916100025177002, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 12.12559986114502, + -4.42609977722168, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 12.865599632263184, + -6.946100234985352, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 8.815600395202637, + -8.336099624633789, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 9.195599555969239, + -9.206100463867188, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 8.595600128173829, + -9.986100196838379, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 10.145600318908692, + -9.356100082397461, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 8.135600090026856, + -7.226099967956543, + 0.0 + ], + "stereoLabel": "abs", + "cip": "S" + }, + { + "label": "O", + "location": [ + 8.135600090026856, + -8.066100120544434, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 7.3155999183654789, + -8.51609992980957, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 7.3155999183654789, + -9.466099739074707, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 6.475599765777588, + -8.066100120544434, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 5.665599822998047, + -8.51609992980957, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 5.665599822998047, + -9.466099739074707, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 4.855599880218506, + -9.946100234985352, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 4.015600204467773, + -9.496100425720215, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 4.015600204467773, + -8.546099662780762, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 4.855599880218506, + -8.066100120544434, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 7.345600128173828, + -6.836100101470947, + 0.0 + ], + "stereoLabel": "abs", + "cip": "S" + }, + { + "label": "C", + "location": [ + 7.345600128173828, + -5.886099815368652, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 6.545599937438965, + -7.186100006103516, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 8.675600051879883, + -7.736100196838379, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 8.485600471496582, + -4.986100196838379, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 7.545599937438965, + -4.866099834442139, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 7.1356000900268559, + -3.966099977493286, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 6.96560001373291, + -5.616099834442139, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 1, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 10 + ] + }, + { + "type": 2, + "atoms": [ + 10, + 11 + ], + "cip": "E" + }, + { + "type": 1, + "atoms": [ + 11, + 12 + ] + }, + { + "type": 1, + "atoms": [ + 12, + 0 + ] + }, + { + "type": 2, + "atoms": [ + 13, + 12 + ] + }, + { + "type": 1, + "atoms": [ + 14, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 15, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 16, + 15 + ] + }, + { + "type": 1, + "atoms": [ + 17, + 15 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 15 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 18 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 8, + 19 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 2, + 20 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 21, + 20 + ] + }, + { + "type": 2, + "atoms": [ + 22, + 21 + ] + }, + { + "type": 1, + "atoms": [ + 23, + 21 + ] + }, + { + "type": 1, + "atoms": [ + 24, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 24, + 25 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 26, + 25 + ] + }, + { + "type": 2, + "atoms": [ + 27, + 26 + ] + }, + { + "type": 1, + "atoms": [ + 28, + 26 + ] + }, + { + "type": 1, + "atoms": [ + 29, + 28 + ] + }, + { + "type": 2, + "atoms": [ + 30, + 29 + ] + }, + { + "type": 1, + "atoms": [ + 31, + 30 + ] + }, + { + "type": 2, + "atoms": [ + 32, + 31 + ] + }, + { + "type": 1, + "atoms": [ + 32, + 33 + ] + }, + { + "type": 2, + "atoms": [ + 33, + 34 + ] + }, + { + "type": 1, + "atoms": [ + 34, + 29 + ] + }, + { + "type": 1, + "atoms": [ + 24, + 35 + ] + }, + { + "type": 1, + "atoms": [ + 35, + 36 + ] + }, + { + "type": 1, + "atoms": [ + 36, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 35, + 37 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 1, + 38 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 0, + 39 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 40, + 39 + ] + }, + { + "type": 2, + "atoms": [ + 41, + 40 + ] + }, + { + "type": 1, + "atoms": [ + 42, + 40 + ] + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/all-trans-inositol.ket b/api/tests/integration/tests/basic/ref/all-trans-inositol.ket new file mode 100644 index 0000000000..ad28d863f6 --- /dev/null +++ b/api/tests/integration/tests/basic/ref/all-trans-inositol.ket @@ -0,0 +1,214 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 10.495200157165528, + 9.3572998046875, + 0.0 + ], + "stereoLabel": "&1", + "cip": "r" + }, + { + "label": "C", + "location": [ + 10.498499870300293, + 8.532600402832032, + 0.0 + ], + "stereoLabel": "&1", + "cip": "r" + }, + { + "label": "O", + "location": [ + 11.213500022888184, + 8.123200416564942, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 11.207500457763672, + 9.772000312805176, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 9.065500259399414, + 9.352100372314454, + 0.0 + ], + "stereoLabel": "&1", + "cip": "r" + }, + { + "label": "C", + "location": [ + 9.77929973602295, + 9.76669979095459, + 0.0 + ], + "stereoLabel": "&1", + "cip": "r" + }, + { + "label": "O", + "location": [ + 9.777999877929688, + 10.592000007629395, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 8.349900245666504, + 9.763999938964844, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 9.06879997253418, + 8.527999877929688, + 0.0 + ], + "stereoLabel": "&1", + "cip": "r" + }, + { + "label": "O", + "location": [ + 8.35509967803955, + 8.111300468444825, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 9.789199829101563, + 7.291900157928467, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 9.785300254821778, + 8.117899894714356, + 0.0 + ], + "stereoLabel": "&1", + "cip": "r" + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 11, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 9 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 4, + 7 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 11, + 10 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 0, + 3 + ], + "stereo": 6 + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/atom_any.ket b/api/tests/integration/tests/basic/ref/atom_any.ket new file mode 100644 index 0000000000..e6a40c8f9c --- /dev/null +++ b/api/tests/integration/tests/basic/ref/atom_any.ket @@ -0,0 +1,136 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 6.94290018081665, + -5.849999904632568, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 7.808899879455566, + -6.349999904632568, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 8.675100326538086, + -5.849999904632568, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 9.541099548339844, + -6.349999904632568, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 10.407099723815918, + -5.849999904632568, + 0.0 + ] + }, + { + "label": "Br", + "location": [ + 8.675100326538086, + -4.849999904632568, + 0.0 + ] + }, + { + "label": "F", + "location": [ + 7.808899879455566, + -7.349999904632568, + 0.0 + ] + }, + { + "label": "Cl", + "location": [ + 9.541099548339844, + -7.349999904632568, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 5 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 1, + 6 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 3, + 7 + ], + "stereo": 4 + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/cis.ket b/api/tests/integration/tests/basic/ref/cis.ket new file mode 100644 index 0000000000..7c07a2ec6e --- /dev/null +++ b/api/tests/integration/tests/basic/ref/cis.ket @@ -0,0 +1,100 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + -4.729000091552734, + 0.17679999768733979, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -3.9040000438690187, + 0.17679999768733979, + 0.0 + ] + }, + { + "label": "F", + "location": [ + -5.312399864196777, + 0.7601000070571899, + 0.0 + ] + }, + { + "label": "Br", + "location": [ + -3.4974000453948976, + 0.7601000070571899, + 0.0 + ] + }, + { + "label": "Cl", + "location": [ + -3.32069993019104, + -0.4065999984741211, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -5.312399864196777, + -0.4065999984741211, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 0, + 1 + ], + "cip": "Z" + }, + { + "type": 1, + "atoms": [ + 2, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 5 + ] + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/crazystereo.ket b/api/tests/integration/tests/basic/ref/crazystereo.ket new file mode 100644 index 0000000000..b195e89a3e --- /dev/null +++ b/api/tests/integration/tests/basic/ref/crazystereo.ket @@ -0,0 +1,445 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + }, + { + "$ref": "mol1" + }, + { + "type": "arrow", + "data": { + "mode": "open-angle", + "pos": [ + { + "x": -5.338500022888184, + "y": 0.5597999691963196, + "z": 0.0 + }, + { + "x": -4.31089973449707, + "y": 0.8544500470161438, + "z": 0.0 + } + ] + } + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + -8.308899879455567, + 0.9722999930381776, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -9.02340030670166, + 1.3847999572753909, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -9.737899780273438, + 0.9722999930381776, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -9.737899780273438, + 0.14730000495910645, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -9.02340030670166, + -0.2651999890804291, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -8.308899879455567, + 0.14730000495910645, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -7.594500064849854, + -0.2651999890804291, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -6.879899978637695, + 0.14730000495910645, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -6.879899978637695, + 0.9722999930381776, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -7.594500064849854, + 1.3847999572753909, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 2, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ] + }, + { + "type": 2, + "atoms": [ + 8, + 9 + ] + }, + { + "type": 2, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ] + } + ] + }, + "mol1": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 0.08839999884366989, + 2.710700035095215, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -0.6261000037193298, + 2.2981998920440676, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -0.6261000037193298, + 1.4731999635696412, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.08839999884366989, + 1.0607000589370728, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.8029000163078308, + 1.4731999635696412, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.8029000163078308, + 2.2981998920440676, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -1.340499997138977, + 1.0607000589370728, + 0.0 + ], + "stereoLabel": "&1" + }, + { + "label": "C", + "location": [ + -2.055000066757202, + 1.4731999635696412, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -2.769500017166138, + 1.0607000589370728, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -2.769500017166138, + 0.23569999635219578, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -2.055000066757202, + -0.1767999976873398, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -1.340499997138977, + 0.23569999635219578, + 0.0 + ] + }, + { + "label": "P", + "location": [ + -0.6261000037193298, + -0.1767999976873398, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.1988999992609024, + -0.1767999976873398, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -0.6261000037193298, + -1.0017999410629273, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 0, + 5 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 2, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 6 + ], + "stereo": 4 + }, + { + "type": 1, + "atoms": [ + 4, + 3 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 11, + 6 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 8, + 9 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 9, + 10 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 11, + 10 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 11, + 12 + ] + }, + { + "type": 2, + "atoms": [ + 12, + 13 + ] + }, + { + "type": 1, + "atoms": [ + 12, + 14 + ] + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/different stereo 2.ket b/api/tests/integration/tests/basic/ref/different stereo 2.ket new file mode 100644 index 0000000000..7d804c6f5b --- /dev/null +++ b/api/tests/integration/tests/basic/ref/different stereo 2.ket @@ -0,0 +1,447 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "O", + "location": [ + 7.592800140380859, + 2.9460999965667726, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 7.5833001136779789, + 4.492300033569336, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 6.736000061035156, + 4.984899997711182, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 6.73960018157959, + 5.9653000831604, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 7.590400218963623, + 6.452000141143799, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 8.435400009155274, + 5.9583001136779789, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 8.43179988861084, + 4.980100154876709, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 5.808599948883057, + 6.270500183105469, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 5.230000019073486, + 5.479800224304199, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 5.802700042724609, + 4.685500144958496, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 5.496300220489502, + 3.754499912261963, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 4.517000198364258, + 3.754499912261963, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 6.73960018157959, + 6.9446001052856449, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 6.736000061035156, + 4.0055999755859379, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 5.509300231933594, + 7.20389986038208, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 5.894599914550781, + 2.9391000270843508, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 5.04610013961792, + 2.4428999423980715, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 5.053199768066406, + 1.462499976158142, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 5.906400203704834, + 0.9804999828338623, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 6.750199794769287, + 1.4753999710083008, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 6.74429988861084, + 2.455899953842163, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "O", + "location": [ + 5.906400203704834, + 0.0, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 4.1975998878479, + 2.931999921798706, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 3.3480000495910646, + 2.441800117492676, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 4.204699993133545, + 0.9733999967575073, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 7.599800109863281, + 0.9851999878883362, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 20, + 0 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 20, + 19 + ] + }, + { + "type": 1, + "atoms": [ + 19, + 25 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 1, + 0 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 2, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 10, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 13 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 3, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ] + }, + { + "type": 2, + "atoms": [ + 8, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 12 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 7, + 14 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 15, + 16 + ] + }, + { + "type": 1, + "atoms": [ + 16, + 17 + ] + }, + { + "type": 1, + "atoms": [ + 17, + 18 + ] + }, + { + "type": 1, + "atoms": [ + 18, + 19 + ] + }, + { + "type": 1, + "atoms": [ + 15, + 20 + ] + }, + { + "type": 1, + "atoms": [ + 16, + 22 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 22, + 23 + ] + }, + { + "type": 1, + "atoms": [ + 17, + 24 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 18, + 21 + ], + "stereo": 1 + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/different stereo 3.ket b/api/tests/integration/tests/basic/ref/different stereo 3.ket new file mode 100644 index 0000000000..c7e4a6c22e --- /dev/null +++ b/api/tests/integration/tests/basic/ref/different stereo 3.ket @@ -0,0 +1,214 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 3.0834999084472658, + 3.085099935531616, + 0.0 + ], + "stereoLabel": "&1", + "cip": "s" + }, + { + "label": "C", + "location": [ + 3.0875000953674318, + 2.0855000019073488, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "O", + "location": [ + 3.9540998935699465, + 1.5893000364303589, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 3.946899890899658, + 3.587599992752075, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 1.3508000373840333, + 3.078700065612793, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 2.21589994430542, + 3.581199884414673, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "O", + "location": [ + 2.2142999172210695, + 4.581500053405762, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 0.48339998722076418, + 3.578000068664551, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 1.3547999858856202, + 2.079900026321411, + 0.0 + ], + "stereoLabel": "&1", + "cip": "r" + }, + { + "label": "O", + "location": [ + 0.48980000615119936, + 1.5749000310897828, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 2.2279000282287599, + 0.5817999839782715, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 2.223099946975708, + 1.582900047302246, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 11, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 9 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 0, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 3 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 4, + 7 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 11, + 10 + ], + "stereo": 6 + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/different stereo 4.ket b/api/tests/integration/tests/basic/ref/different stereo 4.ket new file mode 100644 index 0000000000..7d804c6f5b --- /dev/null +++ b/api/tests/integration/tests/basic/ref/different stereo 4.ket @@ -0,0 +1,447 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "O", + "location": [ + 7.592800140380859, + 2.9460999965667726, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 7.5833001136779789, + 4.492300033569336, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 6.736000061035156, + 4.984899997711182, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 6.73960018157959, + 5.9653000831604, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 7.590400218963623, + 6.452000141143799, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 8.435400009155274, + 5.9583001136779789, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 8.43179988861084, + 4.980100154876709, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 5.808599948883057, + 6.270500183105469, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 5.230000019073486, + 5.479800224304199, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 5.802700042724609, + 4.685500144958496, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 5.496300220489502, + 3.754499912261963, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 4.517000198364258, + 3.754499912261963, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 6.73960018157959, + 6.9446001052856449, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 6.736000061035156, + 4.0055999755859379, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 5.509300231933594, + 7.20389986038208, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 5.894599914550781, + 2.9391000270843508, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 5.04610013961792, + 2.4428999423980715, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 5.053199768066406, + 1.462499976158142, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 5.906400203704834, + 0.9804999828338623, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 6.750199794769287, + 1.4753999710083008, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 6.74429988861084, + 2.455899953842163, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "O", + "location": [ + 5.906400203704834, + 0.0, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 4.1975998878479, + 2.931999921798706, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 3.3480000495910646, + 2.441800117492676, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 4.204699993133545, + 0.9733999967575073, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 7.599800109863281, + 0.9851999878883362, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 20, + 0 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 20, + 19 + ] + }, + { + "type": 1, + "atoms": [ + 19, + 25 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 1, + 0 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 2, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 10, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 13 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 3, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ] + }, + { + "type": 2, + "atoms": [ + 8, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 12 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 7, + 14 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 15, + 16 + ] + }, + { + "type": 1, + "atoms": [ + 16, + 17 + ] + }, + { + "type": 1, + "atoms": [ + 17, + 18 + ] + }, + { + "type": 1, + "atoms": [ + 18, + 19 + ] + }, + { + "type": 1, + "atoms": [ + 15, + 20 + ] + }, + { + "type": 1, + "atoms": [ + 16, + 22 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 22, + 23 + ] + }, + { + "type": 1, + "atoms": [ + 17, + 24 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 18, + 21 + ], + "stereo": 1 + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/different stereo 5.ket b/api/tests/integration/tests/basic/ref/different stereo 5.ket new file mode 100644 index 0000000000..88012507d7 --- /dev/null +++ b/api/tests/integration/tests/basic/ref/different stereo 5.ket @@ -0,0 +1,305 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 3.0550999641418459, + 3.014899969100952, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 3.7083001136779787, + 2.1010000705718996, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 4.790999889373779, + 3.563699960708618, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 4.780600070953369, + 2.43969988822937, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 6.5142998695373539, + 2.9839000701904299, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 5.862199783325195, + 3.898900032043457, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 7.584400177001953, + 2.1194000244140627, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 5.84499979019165, + 2.0826001167297365, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "O", + "location": [ + 6.295100212097168, + 1.3398000001907349, + 0.0 + ] + }, + { + "label": "N", + "location": [ + 7.165299892425537, + 1.358199954032898, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 7.638299942016602, + 0.661300003528595, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 3.7232000827789308, + 3.919600009918213, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "O", + "location": [ + 3.2834999561309816, + 4.656599998474121, + 0.0 + ] + }, + { + "label": "N", + "location": [ + 2.4270999431610109, + 4.645199775695801, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 2.0069000720977785, + 3.8966000080108644, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 1.9436999559402466, + 5.389100074768066, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 4.76800012588501, + 4.553299903869629, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 4.790999889373779, + 1.4535000324249268, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 11, + 12 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 12, + 13 + ] + }, + { + "type": 2, + "atoms": [ + 13, + 15 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 17 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 2, + 16 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 2, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 8, + 9 + ] + }, + { + "type": 2, + "atoms": [ + 9, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 7 + ] + }, + { + "type": 2, + "atoms": [ + 9, + 10 + ] + }, + { + "type": 2, + "atoms": [ + 13, + 14 + ] + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/different stereo.ket b/api/tests/integration/tests/basic/ref/different stereo.ket new file mode 100644 index 0000000000..70a28d6dad --- /dev/null +++ b/api/tests/integration/tests/basic/ref/different stereo.ket @@ -0,0 +1,600 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + }, + { + "$ref": "mol1" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 5.170100212097168, + 4.723100185394287, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 4.516600131988525, + 5.639699935913086, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 3.4458000659942629, + 5.301599979400635, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "N", + "location": [ + 3.4358999729156496, + 4.179900169372559, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 4.499599933624268, + 3.822000026702881, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 2.1826000213623049, + 5.317200183868408, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 2.1642000675201418, + 4.162899971008301, + 0.0 + ] + }, + { + "label": "S", + "location": [ + 6.154600143432617, + 4.706099987030029, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 4.902699947357178, + 2.853100061416626, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 5.815100193023682, + 2.5985000133514406, + 0.0 + ], + "charge": -1 + }, + { + "label": "O", + "location": [ + 4.203999996185303, + 2.2760000228881838, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 1.413100004196167, + 3.6522998809814455, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 1.3776999711990357, + 5.844799995422363, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 0.5544999837875366, + 5.403500080108643, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 1.3776999711990357, + 6.7104997634887699, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 2.2009999752044679, + 6.218299865722656, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 3.452899932861328, + 6.286200046539307, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 4.81220006942749, + 6.591700077056885, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 8.545100212097168, + 3.4895999431610109, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 7.895899772644043, + 4.3582000732421879, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 6.868899822235107, + 4.008800029754639, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 6.884500026702881, + 2.9267001152038576, + 0.0 + ] + }, + { + "label": "N", + "location": [ + 7.919899940490723, + 2.605600118637085, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 9.539600372314454, + 3.295799970626831, + 0.0 + ] + }, + { + "label": "N", + "location": [ + 10.272299766540528, + 3.754199981689453, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 9.789899826049805, + 2.44569993019104, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 12.61620044708252, + 2.4442999362945558, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 12.61620044708252, + 3.3636999130249025, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 11.821200370788575, + 3.822000026702881, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 11.02340030670166, + 3.362299919128418, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 11.024800300598145, + 2.4442999362945558, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 11.821200370788575, + 1.9845999479293824, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 13.3927001953125, + 3.906899929046631, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 14.143799781799317, + 3.4147000312805177, + 0.0 + ], + "charge": -1 + }, + { + "label": "O", + "location": [ + 13.374300003051758, + 4.77400016784668, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 6 + ] + }, + { + "type": 2, + "atoms": [ + 6, + 11 + ] + }, + { + "type": 2, + "atoms": [ + 0, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 8 + ] + }, + { + "type": 2, + "atoms": [ + 8, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 20, + 7 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 20, + 21 + ] + }, + { + "type": 1, + "atoms": [ + 21, + 22 + ] + }, + { + "type": 1, + "atoms": [ + 22, + 18 + ] + }, + { + "type": 1, + "atoms": [ + 18, + 19 + ] + }, + { + "type": 1, + "atoms": [ + 19, + 20 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 17 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 2, + 16 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 2, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 15 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 12 + ] + }, + { + "type": 1, + "atoms": [ + 12, + 14 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 12, + 13 + ] + }, + { + "type": 1, + "atoms": [ + 18, + 23 + ], + "stereo": 1 + }, + { + "type": 2, + "atoms": [ + 23, + 25 + ] + }, + { + "type": 1, + "atoms": [ + 23, + 24 + ] + }, + { + "type": 1, + "atoms": [ + 24, + 29 + ] + }, + { + "type": 2, + "atoms": [ + 29, + 30 + ] + }, + { + "type": 1, + "atoms": [ + 30, + 31 + ] + }, + { + "type": 2, + "atoms": [ + 31, + 26 + ] + }, + { + "type": 1, + "atoms": [ + 26, + 27 + ] + }, + { + "type": 2, + "atoms": [ + 27, + 28 + ] + }, + { + "type": 1, + "atoms": [ + 28, + 29 + ] + }, + { + "type": 1, + "atoms": [ + 27, + 32 + ] + }, + { + "type": 2, + "atoms": [ + 32, + 34 + ] + }, + { + "type": 1, + "atoms": [ + 32, + 33 + ] + } + ] + }, + "mol1": { + "type": "molecule", + "atoms": [ + { + "label": "Na", + "location": [ + 8.497099876403809, + 1.1401000022888184, + 0.0 + ], + "charge": 1 + } + ], + "bonds": [] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/ketcher.ket b/api/tests/integration/tests/basic/ref/ketcher.ket new file mode 100644 index 0000000000..1cb149fcfb --- /dev/null +++ b/api/tests/integration/tests/basic/ref/ketcher.ket @@ -0,0 +1,598 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 7.800000190734863, + -7.025000095367432, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 8.666000366210938, + -7.525000095367432, + 0.0 + ], + "stereoLabel": "&1" + }, + { + "label": "C", + "location": [ + 9.532099723815918, + -7.025000095367432, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 10.398099899291993, + -7.525000095367432, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 11.264100074768067, + -7.025000095367432, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 12.13010025024414, + -7.525000095367432, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 12.996199607849121, + -8.024999618530274, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 13.862199783325196, + -7.525000095367432, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 14.72819995880127, + -8.024999618530274, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 15.594200134277344, + -7.525000095367432, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 16.46030044555664, + -8.024999618530274, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 17.326400756835939, + -8.524999618530274, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 18.192399978637697, + -8.024999618530274, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 19.058399200439454, + -8.524999618530274, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 19.92449951171875, + -8.024999618530274, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 20.79050064086914, + -8.524999618530274, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 8.666000366210938, + -8.524999618530274, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 9.532099723815918, + -6.025000095367432, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 10.398099899291993, + -8.524999618530274, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 11.264100074768067, + -6.025000095367432, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 12.996199607849121, + -9.024999618530274, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 13.862199783325196, + -6.525000095367432, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 14.72819995880127, + -9.024999618530274, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 15.594200134277344, + -6.525000095367432, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 17.326400756835939, + -9.524999618530274, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 18.192399978637697, + -7.025000095367432, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 19.058399200439454, + -9.524999618530274, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 21.497600555419923, + -9.232099533081055, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 22.463499069213868, + -8.973299980163575, + 0.0 + ], + "stereoLabel": "&1" + }, + { + "label": "C", + "location": [ + 23.17060089111328, + -9.680399894714356, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 19.92449951171875, + -7.025000095367432, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 22.722299575805665, + -8.007399559020996, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 21.238800048828126, + -10.197999954223633, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 21.29050064086914, + -7.658999919891357, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 12.63010025024414, + -6.658999919891357, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 16.96030044555664, + -7.158999919891357, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "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": 1, + "atoms": [ + 10, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 11, + 12 + ] + }, + { + "type": 1, + "atoms": [ + 12, + 13 + ] + }, + { + "type": 1, + "atoms": [ + 13, + 14 + ] + }, + { + "type": 1, + "atoms": [ + 14, + 15 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 16 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 2, + 17 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 3, + 18 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 4, + 19 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 6, + 20 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 7, + 21 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 8, + 22 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 9, + 23 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 11, + 24 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 12, + 25 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 13, + 26 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 15, + 27 + ] + }, + { + "type": 1, + "atoms": [ + 27, + 28 + ] + }, + { + "type": 1, + "atoms": [ + 28, + 29 + ] + }, + { + "type": 1, + "atoms": [ + 14, + 30 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 28, + 31 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 27, + 32 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 15, + 33 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 34 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 10, + 35 + ], + "stereo": 1 + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/stereo-different-ketcher-marvin.ket b/api/tests/integration/tests/basic/ref/stereo-different-ketcher-marvin.ket new file mode 100644 index 0000000000..e337a14958 --- /dev/null +++ b/api/tests/integration/tests/basic/ref/stereo-different-ketcher-marvin.ket @@ -0,0 +1,680 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 9.306300163269043, + 5.999000072479248, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 9.306300163269043, + 5.001200199127197, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 10.17199993133545, + 4.502399921417236, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 11.036299705505371, + 5.001200199127197, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 11.036299705505371, + 5.999000072479248, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 10.17199993133545, + 6.497799873352051, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 10.17199993133545, + 3.5046000480651857, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 10.17199993133545, + 7.497000217437744, + 0.0 + ] + }, + { + "label": "F", + "location": [ + 11.169699668884278, + 7.497000217437744, + 0.0 + ] + }, + { + "label": "F", + "location": [ + 9.172900199890137, + 7.497000217437744, + 0.0 + ] + }, + { + "label": "F", + "location": [ + 10.17199993133545, + 8.49470043182373, + 0.0 + ] + }, + { + "label": "F", + "location": [ + 11.169699668884278, + 3.5046000480651857, + 0.0 + ] + }, + { + "label": "F", + "location": [ + 9.172900199890137, + 3.5046000480651857, + 0.0 + ] + }, + { + "label": "F", + "location": [ + 10.17199993133545, + 2.505500078201294, + 0.0 + ] + }, + { + "label": "N", + "location": [ + 8.441900253295899, + 6.497799873352051, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 7.577600002288818, + 5.999000072479248, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 6.86329984664917, + 6.709099769592285, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 7.577600002288818, + 5.001200199127197, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 6.770199775695801, + 4.41480016708374, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 7.078700065612793, + 3.4656999111175539, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 8.077799797058106, + 3.4656999111175539, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 8.384900093078614, + 4.41480016708374, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 5.7947001457214359, + 4.6219000816345219, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 5.126299858093262, + 3.8798000812530519, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 5.434800148010254, + 2.9307000637054445, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 6.4116997718811039, + 2.723599910736084, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 6.51170015335083, + 5.379199981689453, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 6.153200149536133, + 3.687999963760376, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 4.76639986038208, + 2.1886000633239748, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 5.074900150299072, + 1.2395000457763672, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 6.051799774169922, + 1.0325000286102296, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 6.720200061798096, + 1.7745000123977662, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 5.693299770355225, + 1.9663000106811524, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 3.7825000286102297, + 2.3984999656677248, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 3.122499942779541, + 1.6549999713897706, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 3.430999994277954, + 0.7059000134468079, + 0.0 + ] + }, + { + "label": "N", + "location": [ + 4.407899856567383, + 0.49889999628067019, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 4.507900238037109, + 3.1530001163482668, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 5.3333001136779789, + 0.27649998664855959, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 2.7249999046325685, + 0.0, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 7.480299949645996, + 2.4776999950408937, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 2, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 2, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 14 + ] + }, + { + "type": 1, + "atoms": [ + 14, + 15 + ] + }, + { + "type": 2, + "atoms": [ + 15, + 16 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 13 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 12 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 17, + 15 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 17, + 18 + ] + }, + { + "type": 1, + "atoms": [ + 18, + 19 + ] + }, + { + "type": 1, + "atoms": [ + 19, + 20 + ] + }, + { + "type": 1, + "atoms": [ + 20, + 21 + ] + }, + { + "type": 1, + "atoms": [ + 21, + 17 + ] + }, + { + "type": 1, + "atoms": [ + 18, + 26 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 18, + 22 + ] + }, + { + "type": 1, + "atoms": [ + 22, + 23 + ] + }, + { + "type": 1, + "atoms": [ + 23, + 24 + ] + }, + { + "type": 1, + "atoms": [ + 24, + 25 + ] + }, + { + "type": 1, + "atoms": [ + 25, + 31 + ] + }, + { + "type": 1, + "atoms": [ + 31, + 30 + ] + }, + { + "type": 1, + "atoms": [ + 30, + 29 + ] + }, + { + "type": 1, + "atoms": [ + 29, + 38 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 19, + 40 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 19, + 25 + ] + }, + { + "type": 1, + "atoms": [ + 25, + 27 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 24, + 32 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 24, + 28 + ] + }, + { + "type": 1, + "atoms": [ + 28, + 37 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 28, + 33 + ] + }, + { + "type": 2, + "atoms": [ + 33, + 34 + ] + }, + { + "type": 1, + "atoms": [ + 34, + 35 + ] + }, + { + "type": 2, + "atoms": [ + 35, + 39 + ] + }, + { + "type": 1, + "atoms": [ + 28, + 29 + ] + }, + { + "type": 1, + "atoms": [ + 29, + 36 + ] + }, + { + "type": 1, + "atoms": [ + 36, + 35 + ] + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/stereo-different-ketcher-marvin2.ket b/api/tests/integration/tests/basic/ref/stereo-different-ketcher-marvin2.ket new file mode 100644 index 0000000000..2f88c7c94d --- /dev/null +++ b/api/tests/integration/tests/basic/ref/stereo-different-ketcher-marvin2.ket @@ -0,0 +1,687 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + 7.806600093841553, + 4.691299915313721, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 6.983799934387207, + 4.218500137329102, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 6.983799934387207, + 3.2713000774383547, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 7.806600093841553, + 2.7969000339508058, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 8.626099586486817, + 4.218500137329102, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 8.626099586486817, + 3.2695999145507814, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 9.445599555969239, + 2.7969000339508058, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 10.26669979095459, + 3.2679998874664308, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 9.445599555969239, + 4.691299915313721, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 10.26669979095459, + 4.218500137329102, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 10.268400192260743, + 6.116300106048584, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 9.44729995727539, + 5.640200138092041, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 11.09119987487793, + 5.640200138092041, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 11.089500427246094, + 4.689599990844727, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 11.990300178527832, + 4.395999908447266, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 12.550999641418457, + 5.160699844360352, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 11.993599891662598, + 5.930500030517578, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "O", + "location": [ + 6.137800216674805, + 2.723900079727173, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 8.588000297546387, + 5.339900016784668, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 9.42240047454834, + 3.5383999347686769, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 10.25510025024414, + 5.24370002746582, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 11.114399909973145, + 3.61299991607666, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 11.089500427246094, + 6.7316999435424809, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 11.998600006103516, + 7.237599849700928, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 12.796500205993653, + 7.7270002365112309, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 12.773300170898438, + 8.662599563598633, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 11.948800086975098, + 9.11050033569336, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 11.152600288391114, + 8.617799758911133, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 11.177499771118164, + 7.682199954986572, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 11.948800086975098, + 10.140700340270996, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 5.154099941253662, + 2.723900079727173, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "O", + "location": [ + 4.646500110626221, + 3.573199987411499, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 3.6577999591827394, + 3.5599000453948976, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 3.175100088119507, + 2.69569993019104, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 3.6826999187469484, + 1.8463000059127808, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 4.672999858856201, + 1.861299991607666, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 3.052299976348877, + 4.460700035095215, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 1.8944000005722047, + 2.665800094604492, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 3.234800100326538, + 0.8127999901771545, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 5.1855998039245609, + 0.784600019454956, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 3, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 20 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 0, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 18 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 2, + 17 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 30, + 17 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 30, + 35 + ] + }, + { + "type": 1, + "atoms": [ + 35, + 39 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 4, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 19 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 11, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 10, + 12 + ] + }, + { + "type": 1, + "atoms": [ + 12, + 13 + ] + }, + { + "type": 1, + "atoms": [ + 13, + 14 + ] + }, + { + "type": 1, + "atoms": [ + 14, + 15 + ] + }, + { + "type": 1, + "atoms": [ + 15, + 16 + ] + }, + { + "type": 1, + "atoms": [ + 16, + 12 + ] + }, + { + "type": 1, + "atoms": [ + 12, + 22 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 8, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 13 + ] + }, + { + "type": 1, + "atoms": [ + 13, + 21 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 16, + 23 + ], + "stereo": 1 + }, + { + "type": 2, + "atoms": [ + 23, + 24 + ] + }, + { + "type": 1, + "atoms": [ + 24, + 25 + ] + }, + { + "type": 1, + "atoms": [ + 25, + 26 + ] + }, + { + "type": 1, + "atoms": [ + 26, + 27 + ] + }, + { + "type": 2, + "atoms": [ + 27, + 28 + ] + }, + { + "type": 1, + "atoms": [ + 28, + 23 + ] + }, + { + "type": 2, + "atoms": [ + 26, + 29 + ] + }, + { + "type": 1, + "atoms": [ + 30, + 31 + ] + }, + { + "type": 1, + "atoms": [ + 31, + 32 + ] + }, + { + "type": 1, + "atoms": [ + 32, + 33 + ] + }, + { + "type": 1, + "atoms": [ + 33, + 34 + ] + }, + { + "type": 1, + "atoms": [ + 34, + 35 + ] + }, + { + "type": 1, + "atoms": [ + 32, + 36 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 33, + 37 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 34, + 38 + ], + "stereo": 6 + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/t4_R.ket b/api/tests/integration/tests/basic/ref/t4_R.ket new file mode 100644 index 0000000000..419854b7fb --- /dev/null +++ b/api/tests/integration/tests/basic/ref/t4_R.ket @@ -0,0 +1,87 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + -4.662700176239014, + 3.579900026321411, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "F", + "location": [ + -4.662700176239014, + 4.404900074005127, + 0.0 + ] + }, + { + "label": "Cl", + "location": [ + -3.8376998901367189, + 3.579900026321411, + 0.0 + ] + }, + { + "label": "Br", + "location": [ + -4.876200199127197, + 2.7829999923706056, + 0.0 + ] + }, + { + "label": "I", + "location": [ + -5.45959997177124, + 3.7934000492095949, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ], + "stereo": 1 + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/t4_R_iso.ket b/api/tests/integration/tests/basic/ref/t4_R_iso.ket new file mode 100644 index 0000000000..49390af902 --- /dev/null +++ b/api/tests/integration/tests/basic/ref/t4_R_iso.ket @@ -0,0 +1,88 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + -4.662700176239014, + 3.579900026321411, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "F", + "location": [ + -4.662700176239014, + 4.404900074005127, + 0.0 + ], + "isotope": 16 + }, + { + "label": "Cl", + "location": [ + -3.8376998901367189, + 3.579900026321411, + 0.0 + ] + }, + { + "label": "Br", + "location": [ + -4.876200199127197, + 2.7829999923706056, + 0.0 + ] + }, + { + "label": "F", + "location": [ + -5.45959997177124, + 3.7934000492095949, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ], + "stereo": 1 + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/t4_S.ket b/api/tests/integration/tests/basic/ref/t4_S.ket new file mode 100644 index 0000000000..8b47f68e50 --- /dev/null +++ b/api/tests/integration/tests/basic/ref/t4_S.ket @@ -0,0 +1,87 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + -4.662700176239014, + 3.579900026321411, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "F", + "location": [ + -4.662700176239014, + 4.404900074005127, + 0.0 + ] + }, + { + "label": "Cl", + "location": [ + -3.8376998901367189, + 3.579900026321411, + 0.0 + ] + }, + { + "label": "Br", + "location": [ + -4.876200199127197, + 2.7829999923706056, + 0.0 + ] + }, + { + "label": "I", + "location": [ + -5.45959997177124, + 3.7934000492095949, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ], + "stereo": 6 + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/t4_S_iso.ket b/api/tests/integration/tests/basic/ref/t4_S_iso.ket new file mode 100644 index 0000000000..75b80f7b80 --- /dev/null +++ b/api/tests/integration/tests/basic/ref/t4_S_iso.ket @@ -0,0 +1,88 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + -4.662700176239014, + 3.579900026321411, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "F", + "location": [ + -4.662700176239014, + 4.404900074005127, + 0.0 + ] + }, + { + "label": "Cl", + "location": [ + -3.8376998901367189, + 3.579900026321411, + 0.0 + ] + }, + { + "label": "Br", + "location": [ + -4.876200199127197, + 2.7829999923706056, + 0.0 + ] + }, + { + "label": "F", + "location": [ + -5.45959997177124, + 3.7934000492095949, + 0.0 + ], + "isotope": 16 + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 1 + ], + "stereo": 1 + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/trans.ket b/api/tests/integration/tests/basic/ref/trans.ket new file mode 100644 index 0000000000..9990ac7adc --- /dev/null +++ b/api/tests/integration/tests/basic/ref/trans.ket @@ -0,0 +1,100 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + -4.729000091552734, + 0.17679999768733979, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -3.9040000438690187, + 0.17679999768733979, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -5.312399864196777, + 0.7601000070571899, + 0.0 + ] + }, + { + "label": "Br", + "location": [ + -3.4974000453948976, + 0.7601000070571899, + 0.0 + ] + }, + { + "label": "Cl", + "location": [ + -3.32069993019104, + -0.4065999984741211, + 0.0 + ] + }, + { + "label": "F", + "location": [ + -5.312399864196777, + -0.4065999984741211, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 2, + "atoms": [ + 0, + 1 + ], + "cip": "E" + }, + { + "type": 1, + "atoms": [ + 2, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 5 + ] + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/basic/ref/without_stereo_label.ket b/api/tests/integration/tests/basic/ref/without_stereo_label.ket new file mode 100644 index 0000000000..137de100cb --- /dev/null +++ b/api/tests/integration/tests/basic/ref/without_stereo_label.ket @@ -0,0 +1,495 @@ +{ + "root": { + "nodes": [ + { + "$ref": "mol0" + } + ] + }, + "mol0": { + "type": "molecule", + "atoms": [ + { + "label": "C", + "location": [ + -4.281300067901611, + -2.7964999675750734, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -4.281300067901611, + -1.7964999675750733, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -3.415299892425537, + -1.2964999675750733, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -3.415299892425537, + -3.2964999675750734, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -2.5492000579833986, + -2.7964999675750734, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -1.6833000183105469, + -3.2964999675750734, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -0.8172000050544739, + -2.7964999675750734, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -0.8172000050544739, + -1.7964999675750733, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 0.04879999905824661, + -1.2964999675750733, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + 0.9998999834060669, + -1.6053999662399293, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 1.5875999927520753, + -0.796500027179718, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.9998999834060669, + 0.012600000016391278, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 1.3087999820709229, + 0.9635999798774719, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 2.2869999408721926, + 1.1714999675750733, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 2.5959999561309816, + 2.122499942779541, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 3.574199914932251, + 2.3304998874664308, + 0.0 + ], + "stereoLabel": "&1" + }, + { + "label": "C", + "location": [ + 3.8329999446868898, + 3.2964999675750734, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 4.281300067901611, + 1.6233999729156495, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.6018000245094299, + 1.670799970626831, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 0.04879999905824661, + -0.29649999737739565, + 0.0 + ], + "stereoLabel": "&1", + "cip": "R" + }, + { + "label": "C", + "location": [ + 0.04879999905824661, + 0.703499972820282, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -0.8172000050544739, + 0.20350000262260438, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -1.6833000183105469, + -0.29649999737739565, + 0.0 + ] + }, + { + "label": "C", + "location": [ + -1.6833000183105469, + -1.2964999675750733, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + -2.5492000579833986, + -1.7964999675750733, + 0.0 + ], + "stereoLabel": "&1", + "cip": "S" + }, + { + "label": "C", + "location": [ + -2.5492000579833986, + -0.796500027179718, + 0.0 + ] + }, + { + "label": "H", + "location": [ + -1.6833000183105469, + -2.2964999675750734, + 0.0 + ] + }, + { + "label": "H", + "location": [ + -0.8172000050544739, + -0.796500027179718, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 0.04879999905824661, + -2.2964999675750734, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "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": 1, + "atoms": [ + 11, + 10 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 11, + 12 + ] + }, + { + "type": 1, + "atoms": [ + 12, + 13 + ] + }, + { + "type": 1, + "atoms": [ + 13, + 14 + ] + }, + { + "type": 1, + "atoms": [ + 14, + 15 + ] + }, + { + "type": 1, + "atoms": [ + 15, + 16 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 15, + 17 + ] + }, + { + "type": 1, + "atoms": [ + 12, + 18 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 11, + 19 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 19 + ] + }, + { + "type": 1, + "atoms": [ + 19, + 20 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 19, + 21 + ] + }, + { + "type": 1, + "atoms": [ + 21, + 22 + ] + }, + { + "type": 1, + "atoms": [ + 22, + 23 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 23 + ] + }, + { + "type": 1, + "atoms": [ + 23, + 24 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 24 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 24 + ] + }, + { + "type": 1, + "atoms": [ + 24, + 25 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 23, + 26 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 7, + 27 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 8, + 28 + ], + "stereo": 6 + } + ] + } +} \ No newline at end of file diff --git a/core/indigo-core/graph/graph.h b/core/indigo-core/graph/graph.h index c0090f4b3a..6828f135b0 100644 --- a/core/indigo-core/graph/graph.h +++ b/core/indigo-core/graph/graph.h @@ -141,6 +141,7 @@ namespace indigo EdgesAuto edges(); virtual void clear(); + virtual void changed(); const Vertex& getVertex(int idx) const; diff --git a/core/indigo-core/graph/src/graph.cpp b/core/indigo-core/graph/src/graph.cpp index 1bacc021b6..eff7d09e88 100644 --- a/core/indigo-core/graph/src/graph.cpp +++ b/core/indigo-core/graph/src/graph.cpp @@ -75,6 +75,7 @@ Graph::~Graph() int Graph::addVertex() { + changed(); return _vertices->add(*_neighbors_pool); } @@ -144,7 +145,7 @@ int Graph::addEdge(int beg, int end) _topology_valid = false; _sssr_valid = false; _components_valid = false; - + changed(); return edge_idx; } @@ -169,6 +170,7 @@ void Graph::removeEdge(int idx) _topology_valid = false; _sssr_valid = false; _components_valid = false; + changed(); } void Graph::removeAllEdges() @@ -180,6 +182,7 @@ void Graph::removeAllEdges() _topology_valid = false; _sssr_valid = false; _components_valid = false; + changed(); } void Graph::removeVertex(int idx) @@ -203,6 +206,7 @@ void Graph::removeVertex(int idx) _topology_valid = false; _sssr_valid = false; _components_valid = false; + changed(); } const Vertex& Graph::getVertex(int idx) const @@ -296,6 +300,10 @@ EdgesAuto Graph::edges() return EdgesAuto(*this); } +void Graph::changed() +{ +} + void Graph::clear() { _vertices->clear(); @@ -303,6 +311,7 @@ void Graph::clear() _topology_valid = false; _sssr_valid = false; _components_valid = false; + changed(); } bool Graph::isChain_AssumingConnected(const Graph& graph) diff --git a/core/indigo-core/molecule/base_molecule.h b/core/indigo-core/molecule/base_molecule.h index 1596235f01..a7a248cc79 100644 --- a/core/indigo-core/molecule/base_molecule.h +++ b/core/indigo-core/molecule/base_molecule.h @@ -26,6 +26,7 @@ #include "molecule/metadata_storage.h" #include "molecule/molecule_allene_stereo.h" #include "molecule/molecule_arom.h" +#include "molecule/molecule_cip_calculator.h" #include "molecule/molecule_cis_trans.h" #include "molecule/molecule_ionize.h" #include "molecule/molecule_rgroups.h" @@ -104,6 +105,7 @@ namespace indigo class DLLEXPORT BaseMolecule : public Graph { public: + friend class MoleculeCIPCalculator; typedef std::map Mapping; BaseMolecule(); @@ -118,6 +120,7 @@ namespace indigo virtual bool isQueryMolecule(); void clear() override; + virtual void changed() override; // 'neu' means 'new' in German virtual BaseMolecule* neu() = 0; @@ -232,6 +235,12 @@ namespace indigo CHANGED_ALL = 0xFF, }; virtual void invalidateAtom(int index, int mask); + void addCIP(); + void clearCIP(); + CIPDesc getAtomCIP(int atom_idx); + CIPDesc getBondCIP(int bond_idx); + void setAtomCIP(int atom_idx, CIPDesc cip); + void setBondCIP(int bond_idx, CIPDesc cip); Vec3f& getAtomXyz(int idx); void setAtomXyz(int idx, float x, float y, float z); @@ -244,6 +253,7 @@ namespace indigo MoleculeAlleneStereo allene_stereo; bool have_xyz = false; + bool have_cip = false; bool isChiral(); @@ -462,7 +472,10 @@ namespace indigo Array _bond_directions; Array _xyz; - std::map _stereo_flag_positions; + RedBlackMap _stereo_flag_positions; + // CIP maps should be changed to std::unordered_map + RedBlackMap _cip_atoms; + RedBlackMap _cip_bonds; ObjArray> _rsite_attachment_points; bool _rGroupFragment; diff --git a/core/indigo-core/molecule/ket_commons.h b/core/indigo-core/molecule/ket_commons.h index 390bb23d6b..71c5fb6e72 100644 --- a/core/indigo-core/molecule/ket_commons.h +++ b/core/indigo-core/molecule/ket_commons.h @@ -26,6 +26,7 @@ #include "common/math/algebra.h" #include "graph/graph.h" +#include "molecule/molecule_cip_calculator.h" #include "reaction/base_reaction.h" namespace indigo @@ -42,6 +43,11 @@ namespace indigo const uint8_t KETReagentDownArea = 2; const uint8_t KETProductArea = 3; + const std::unordered_map KStringToCIP = {{"R", CIPDesc::R}, {"S", CIPDesc::S}, {"r", CIPDesc::r}, + {"s", CIPDesc::s}, {"E", CIPDesc::E}, {"Z", CIPDesc::Z}}; + const std::unordered_map KCIPToString = {{(int)CIPDesc::R, "R"}, {(int)CIPDesc::S, "S"}, {(int)CIPDesc::r, "r"}, + {(int)CIPDesc::s, "s"}, {(int)CIPDesc::E, "E"}, {(int)CIPDesc::Z, "Z"}}; + struct compareFunction { bool operator()(const std::pair& a, const std::pair& b) const @@ -84,6 +90,16 @@ namespace indigo return bit_mask; } + inline bool isCIPSGroup(SGroup& sgroup) + { + if (sgroup.sgroup_type == SGroup::SG_DATA) + { + auto& dsg = (DataSGroup&)sgroup; + return std::string(dsg.name.ptr()) == "INDIGO_CIP_DESC"; + } + return false; + } + inline void getSGroupAtoms(BaseMolecule& mol, std::list>& neighbors) { for (int i = mol.sgroups.begin(); i != mol.sgroups.end(); i = mol.sgroups.next(i)) diff --git a/core/indigo-core/molecule/molecule_cip_calculator.h b/core/indigo-core/molecule/molecule_cip_calculator.h index 2ef433ee7f..5d025b3e08 100644 --- a/core/indigo-core/molecule/molecule_cip_calculator.h +++ b/core/indigo-core/molecule/molecule_cip_calculator.h @@ -19,6 +19,8 @@ #pragma once #include +#include +#include #include "base_c/defs.h" #include "base_cpp/array.h" @@ -28,7 +30,7 @@ namespace indigo class BaseMolecule; class Molecule; - enum class CIPDesc + enum class CIPDesc : int { NONE = 0, UNKNOWN, @@ -70,11 +72,15 @@ namespace indigo class DLLEXPORT MoleculeCIPCalculator { public: - void updateCIPStereoDescriptors(BaseMolecule& mol, bool add_stereo_desc); + bool addCIPStereoDescriptors(BaseMolecule& mol); + void addCIPSgroups(BaseMolecule& mol); + void removeCIPSgroups(BaseMolecule& mol); + void convertSGroupsToCIP(BaseMolecule& mol); + + const std::unordered_map KSGroupToCIP = {{"(R)", CIPDesc::R}, {"(S)", CIPDesc::S}, {"(r)", CIPDesc::r}, + {"(s)", CIPDesc::s}, {"(E)", CIPDesc::E}, {"(Z)", CIPDesc::Z}}; private: - void _addCIPStereoDescriptors(BaseMolecule& mol); - void _addCIPSgroups(BaseMolecule& mol, Array& atom_cip_desc, Array& bond_cip_desc); void _calcRSStereoDescriptor(BaseMolecule& mol, BaseMolecule& unfolded_h_mol, int idx, Array& atom_cip_desc, Array& stereo_passed, bool use_stereo, Array& equiv_ligands, bool& digraph_cip_used); void _calcEZStereoDescriptor(BaseMolecule& mol, BaseMolecule& unfolded_h_mol, int idx, Array& bond_cip_desc); diff --git a/core/indigo-core/molecule/src/base_molecule.cpp b/core/indigo-core/molecule/src/base_molecule.cpp index ebba68d15f..5df6f64541 100644 --- a/core/indigo-core/molecule/src/base_molecule.cpp +++ b/core/indigo-core/molecule/src/base_molecule.cpp @@ -61,6 +61,12 @@ bool BaseMolecule::isQueryMolecule() return false; } +void BaseMolecule::changed() +{ + if (have_cip) + clearCIP(); +} + void BaseMolecule::clear() { have_xyz = false; @@ -94,6 +100,7 @@ void BaseMolecule::clear() ignore_chem_templates = false; updateEditRevision(); _meta.resetMetaData(); + clearCIP(); } bool BaseMolecule::hasCoord(BaseMolecule& mol) @@ -263,6 +270,29 @@ void BaseMolecule::_mergeWithSubmolecule_Sub(BaseMolecule& mol, const Array else _xyz.zerofill(); + // copy cip values + for (int i = mol._cip_atoms.begin(); i != mol._cip_atoms.end(); i = mol._cip_atoms.next(i)) + { + try + { + _cip_atoms.insert(mapping[mol._cip_atoms.key(i)], mol._cip_atoms.value(i)); + } + catch (Exception& e) + { + } + } + + for (int i = mol._cip_bonds.begin(); i != mol._cip_bonds.end(); i = mol._cip_bonds.next(i)) + { + try + { + _cip_bonds.insert(mapping[mol._cip_bonds.key(i)], mol._cip_bonds.value(i)); + } + catch (Exception& e) + { + } + } + reaction_atom_mapping.expandFill(vertexEnd(), 0); reaction_atom_inversion.expandFill(vertexEnd(), 0); reaction_atom_exact_change.expandFill(vertexEnd(), 0); @@ -4114,7 +4144,7 @@ void BaseMolecule::setStereoFlagPosition(int frag_index, const Vec3f& pos) { try { - _stereo_flag_positions.emplace(frag_index, pos); + _stereo_flag_positions.insert(frag_index, pos); } catch (Exception& ex) { @@ -4123,10 +4153,10 @@ void BaseMolecule::setStereoFlagPosition(int frag_index, const Vec3f& pos) bool BaseMolecule::getStereoFlagPosition(int frag_index, Vec3f& pos) { - auto it = _stereo_flag_positions.find(frag_index); - if (it != _stereo_flag_positions.end()) + auto* pval = _stereo_flag_positions.at2(frag_index); + if (pval) { - pos = it->second; + pos = *pval; return true; } return false; @@ -4262,6 +4292,43 @@ void BaseMolecule::buildFromBondsAlleneStereo(bool ignore_errors, int* sensible_ allene_stereo.buildFromBonds(*this, ignore_errors, sensible_bonds_out); } +void BaseMolecule::addCIP() +{ + MoleculeCIPCalculator mcc; + have_cip = mcc.addCIPStereoDescriptors(*this); +} + +void BaseMolecule::clearCIP() +{ + _cip_atoms.clear(); + _cip_bonds.clear(); + have_cip = false; +} + +CIPDesc BaseMolecule::getAtomCIP(int atom_idx) +{ + auto* pval = _cip_atoms.at2(atom_idx); + return pval ? *pval : CIPDesc::NONE; +} + +CIPDesc BaseMolecule::getBondCIP(int bond_idx) +{ + auto* pval = _cip_bonds.at2(bond_idx); + return pval ? *pval : CIPDesc::NONE; +} + +void BaseMolecule::setAtomCIP(int atom_idx, CIPDesc cip) +{ + _cip_atoms.insert(atom_idx, cip); + have_cip = true; +} + +void BaseMolecule::setBondCIP(int bond_idx, CIPDesc cip) +{ + _cip_bonds.insert(bond_idx, cip); + have_cip = true; +} + void BaseMolecule::getBoundingBox(Rect2f& bbox) const { Vec2f a, b; diff --git a/core/indigo-core/molecule/src/molecule_cip_calculator.cpp b/core/indigo-core/molecule/src/molecule_cip_calculator.cpp index 567ebeff72..9f35ecd836 100644 --- a/core/indigo-core/molecule/src/molecule_cip_calculator.cpp +++ b/core/indigo-core/molecule/src/molecule_cip_calculator.cpp @@ -30,30 +30,10 @@ using namespace indigo; -void MoleculeCIPCalculator::updateCIPStereoDescriptors(BaseMolecule& mol, bool add_stereo_desc) -{ - // clear old stereo descriptors DAT S-groups - for (auto i = mol.sgroups.begin(); i != mol.sgroups.end(); i = mol.sgroups.next(i)) - { - SGroup& sgroup = mol.sgroups.getSGroup(i); - if (sgroup.sgroup_type == SGroup::SG_TYPE_DAT) - { - DataSGroup& datasgroup = (DataSGroup&)sgroup; - if (datasgroup.name.size() > 0 && strcmp(datasgroup.name.ptr(), "INDIGO_CIP_DESC") == 0) - { - mol.sgroups.remove(i); - } - } - } - // add current stereo descriptors DAT S-groups - if (add_stereo_desc) - { - _addCIPStereoDescriptors(mol); - } -} - -void MoleculeCIPCalculator::_addCIPStereoDescriptors(BaseMolecule& mol) +bool MoleculeCIPCalculator::addCIPStereoDescriptors(BaseMolecule& mol) { + if (mol.have_cip) + return false; QS_DEF(Array, atom_cip_desc); QS_DEF(Array, bond_cip_desc); std::unique_ptr unfolded_h_mol; @@ -171,7 +151,21 @@ void MoleculeCIPCalculator::_addCIPStereoDescriptors(BaseMolecule& mol) _calcEZStereoDescriptor(mol, *unfolded_h_mol, i, bond_cip_desc); } - _addCIPSgroups(mol, atom_cip_desc, bond_cip_desc); + mol._cip_atoms.clear(); + mol._cip_bonds.clear(); + + for (auto atom_idx = 0; atom_idx < atom_cip_desc.size(); ++atom_idx) + { + if (atom_cip_desc[atom_idx] > CIPDesc::UNKNOWN) + mol._cip_atoms.insert(atom_idx, atom_cip_desc[atom_idx]); + } + + for (auto bond_idx = 0; bond_idx < bond_cip_desc.size(); ++bond_idx) + { + if (bond_cip_desc[bond_idx] != CIPDesc::NONE) + mol._cip_bonds.insert(bond_idx, bond_cip_desc[bond_idx]); + } + return mol._cip_atoms.size() || mol._cip_bonds.size(); } int MoleculeCIPCalculator::_getNumberOfStereoDescritors(const Array& atom_cip_desc) @@ -185,58 +179,115 @@ int MoleculeCIPCalculator::_getNumberOfStereoDescritors(const Array& at return ndesc; } -void MoleculeCIPCalculator::_addCIPSgroups(BaseMolecule& mol, Array& atom_cip_desc, Array& bond_cip_desc) +void MoleculeCIPCalculator::addCIPSgroups(BaseMolecule& mol) { int sg_idx; - for (auto i : mol.vertices()) + for (int i = mol._cip_atoms.begin(); i != mol._cip_atoms.end(); i = mol._cip_atoms.next(i)) { - if (atom_cip_desc[i] > CIPDesc::UNKNOWN) + sg_idx = mol.sgroups.addSGroup(SGroup::SG_TYPE_DAT); + DataSGroup& sgroup = (DataSGroup&)mol.sgroups.getSGroup(sg_idx); + sgroup.atoms.push(mol._cip_atoms.key(i)); + + switch (mol._cip_atoms.value(i)) { - sg_idx = mol.sgroups.addSGroup(SGroup::SG_TYPE_DAT); - DataSGroup& sgroup = (DataSGroup&)mol.sgroups.getSGroup(sg_idx); - - sgroup.atoms.push(i); - - if (atom_cip_desc[i] == CIPDesc::R) - sgroup.data.readString("(R)", true); - else if (atom_cip_desc[i] == CIPDesc::S) - sgroup.data.readString("(S)", true); - else if (atom_cip_desc[i] == CIPDesc::r) - sgroup.data.readString("(r)", true); - else if (atom_cip_desc[i] == CIPDesc::s) - sgroup.data.readString("(s)", true); - - sgroup.name.readString("INDIGO_CIP_DESC", true); - sgroup.display_pos.x = 0.0; - sgroup.display_pos.y = 0.0; - sgroup.detached = true; - sgroup.relative = true; + case CIPDesc::R: + sgroup.data.readString("(R)", true); + break; + case CIPDesc::S: + sgroup.data.readString("(S)", true); + break; + case CIPDesc::r: + sgroup.data.readString("(r)", true); + break; + case CIPDesc::s: + sgroup.data.readString("(s)", true); + break; } + + sgroup.name.readString("INDIGO_CIP_DESC", true); + sgroup.display_pos.x = 0.0; + sgroup.display_pos.y = 0.0; + sgroup.detached = true; + sgroup.relative = true; } - for (auto i : mol.edges()) + for (int i = mol._cip_bonds.begin(); i != mol._cip_bonds.end(); i = mol._cip_bonds.next(i)) { - int beg = mol.getEdge(i).beg; - int end = mol.getEdge(i).end; + int bond_idx = mol._cip_bonds.key(i); + int beg = mol.getEdge(bond_idx).beg; + int end = mol.getEdge(bond_idx).end; + + sg_idx = mol.sgroups.addSGroup(SGroup::SG_TYPE_DAT); + DataSGroup& sgroup = (DataSGroup&)mol.sgroups.getSGroup(sg_idx); + + sgroup.atoms.push(beg); + sgroup.atoms.push(end); + if (mol._cip_bonds.value(i) == CIPDesc::E) + sgroup.data.readString("(E)", true); + else if (mol._cip_bonds.value(i) == CIPDesc::Z) + sgroup.data.readString("(Z)", true); + + sgroup.name.readString("INDIGO_CIP_DESC", true); + sgroup.display_pos.x = 0.0; + sgroup.display_pos.y = 0.0; + sgroup.detached = true; + sgroup.relative = true; + } +} - if (bond_cip_desc[i] != CIPDesc::NONE) +void MoleculeCIPCalculator::removeCIPSgroups(BaseMolecule& mol) +{ + for (auto i = mol.sgroups.begin(); i != mol.sgroups.end(); i = mol.sgroups.next(i)) + { + SGroup& sgroup = mol.sgroups.getSGroup(i); + if (sgroup.sgroup_type == SGroup::SG_TYPE_DAT) { - sg_idx = mol.sgroups.addSGroup(SGroup::SG_TYPE_DAT); - DataSGroup& sgroup = (DataSGroup&)mol.sgroups.getSGroup(sg_idx); - - sgroup.atoms.push(beg); - sgroup.atoms.push(end); - if (bond_cip_desc[i] == CIPDesc::E) - sgroup.data.readString("(E)", true); - else if (bond_cip_desc[i] == CIPDesc::Z) - sgroup.data.readString("(Z)", true); - - sgroup.name.readString("INDIGO_CIP_DESC", true); - sgroup.display_pos.x = 0.0; - sgroup.display_pos.y = 0.0; - sgroup.detached = true; - sgroup.relative = true; + DataSGroup& datasgroup = (DataSGroup&)sgroup; + if (datasgroup.name.size() > 0 && strcmp(datasgroup.name.ptr(), "INDIGO_CIP_DESC") == 0) + mol.sgroups.remove(i); + } + } +} + +void MoleculeCIPCalculator::convertSGroupsToCIP(BaseMolecule& mol) +{ + mol.clearCIP(); + for (auto i = mol.sgroups.begin(); i != mol.sgroups.end(); i = mol.sgroups.next(i)) + { + SGroup& sgroup = mol.sgroups.getSGroup(i); + if (sgroup.sgroup_type == SGroup::SG_TYPE_DAT) + { + DataSGroup& dsg = (DataSGroup&)sgroup; + if (dsg.name.size() > 0 && std::string(dsg.name.ptr()) == "INDIGO_CIP_DESC") + { + auto cip_it = KSGroupToCIP.find(dsg.data.ptr()); + if (cip_it != KSGroupToCIP.end()) + { + switch (cip_it->second) + { + case CIPDesc::s: + case CIPDesc::r: + case CIPDesc::S: + case CIPDesc::R: + // atoms + for (auto atom_idx : dsg.atoms) + mol.setAtomCIP(atom_idx, cip_it->second); + break; + case CIPDesc::E: + case CIPDesc::Z: + // bonds + for (int idx = 0; idx < dsg.atoms.size() - 1; idx += 2) + { + int bond_idx = mol.findEdgeIndex(dsg.atoms[idx], dsg.atoms[idx + 1]); + if (bond_idx != -1) + mol.setBondCIP(bond_idx, cip_it->second); + } + break; + } + } + mol.sgroups.remove(i); + } } } } diff --git a/core/indigo-core/molecule/src/molecule_json_loader.cpp b/core/indigo-core/molecule/src/molecule_json_loader.cpp index b00b935a93..ee8355bfbc 100644 --- a/core/indigo-core/molecule/src/molecule_json_loader.cpp +++ b/core/indigo-core/molecule/src/molecule_json_loader.cpp @@ -54,7 +54,8 @@ MoleculeJsonLoader::MoleculeJsonLoader(Document& ket) } MoleculeJsonLoader::MoleculeJsonLoader(Value& mol_nodes) - : _mol_nodes(mol_nodes), _meta_objects(kArrayType), _pmol(0), _pqmol(0), ignore_noncritical_query_features(false) + : _mol_nodes(mol_nodes), _meta_objects(kArrayType), _pmol(0), _pqmol(0), ignore_noncritical_query_features(false), ignore_no_chiral_flag(false), + skip_3d_chirality(false), treat_x_as_pseudoatom(false), treat_stereo_as(0) { } @@ -487,6 +488,14 @@ void MoleculeJsonLoader::parseAtoms(const rapidjson::Value& atoms, BaseMolecule& sgroup.display_pos.x = mol.getAtomXyz(atom_idx).x; sgroup.display_pos.y = mol.getAtomXyz(atom_idx).y; } + + if (a.HasMember("cip")) + { + std::string cip = a["cip"].GetString(); + auto cip_it = KStringToCIP.find(cip); + if (cip_it != KStringToCIP.end()) + mol.setAtomCIP(atom_idx, cip_it->second); + } } if (_pqmol) @@ -583,6 +592,15 @@ void MoleculeJsonLoader::parseBonds(const rapidjson::Value& bonds, BaseMolecule& break; } } + + if (b.HasMember("cip")) + { + std::string cip = b["cip"].GetString(); + auto cip_it = KStringToCIP.find(cip); + if (cip_it != KStringToCIP.end()) + mol.setBondCIP(bond_idx, cip_it->second); + } + if (rcenter) { mol.reaction_bond_reacting_center[i] = rcenter; diff --git a/core/indigo-core/molecule/src/molecule_json_saver.cpp b/core/indigo-core/molecule/src/molecule_json_saver.cpp index 20d135fc78..82e6f04d3c 100644 --- a/core/indigo-core/molecule/src/molecule_json_saver.cpp +++ b/core/indigo-core/molecule/src/molecule_json_saver.cpp @@ -437,6 +437,18 @@ void MoleculeJsonSaver::saveBonds(BaseMolecule& mol, JsonWriter& writer) writer.Key("stereo"); writer.Uint(stereo); } + + auto cip = mol.getBondCIP(i); + if (cip != CIPDesc::NONE) + { + auto cip_it = KCIPToString.find((int)cip); + if (cip_it != KCIPToString.end()) + { + writer.Key("cip"); + writer.String(cip_it->second.c_str()); + } + } + writer.EndObject(); } } @@ -798,6 +810,18 @@ void MoleculeJsonSaver::saveAtoms(BaseMolecule& mol, JsonWriter& writer) break; } } + + auto cip = mol.getAtomCIP(i); + if (cip != CIPDesc::NONE) + { + auto cip_it = KCIPToString.find((int)cip); + if (cip_it != KCIPToString.end()) + { + writer.Key("cip"); + writer.String(cip_it->second.c_str()); + } + } + writer.EndObject(); } } @@ -838,12 +862,12 @@ void MoleculeJsonSaver::saveRGroup(PtrPool& fragments, int rgnum, void MoleculeJsonSaver::saveMolecule(BaseMolecule& bmol, JsonWriter& writer) { + if (add_stereo_desc) + bmol.addCIP(); + std::unique_ptr mol(bmol.neu()); mol->clone_KeepIndices(bmol); - MoleculeCIPCalculator mcc; - mcc.updateCIPStereoDescriptors(*mol, add_stereo_desc); - if (!BaseMolecule::hasCoord(*mol)) { MoleculeLayout ml(*mol, false); diff --git a/core/indigo-core/molecule/src/molfile_loader.cpp b/core/indigo-core/molecule/src/molfile_loader.cpp index 8d31df2578..6c72c4d9c9 100644 --- a/core/indigo-core/molecule/src/molfile_loader.cpp +++ b/core/indigo-core/molecule/src/molfile_loader.cpp @@ -2097,6 +2097,8 @@ void MolfileLoader::_postLoad() _bmol->rgroups.getRGroup(i).occurrence.push((1 << 16) | 0xFFFF); */ _bmol->have_xyz = true; + MoleculeCIPCalculator cip; + cip.convertSGroupsToCIP(*_bmol); } void MolfileLoader::_readRGroups2000() diff --git a/core/indigo-core/molecule/src/molfile_saver.cpp b/core/indigo-core/molecule/src/molfile_saver.cpp index afccfde0a3..75f5d25012 100644 --- a/core/indigo-core/molecule/src/molfile_saver.cpp +++ b/core/indigo-core/molecule/src/molfile_saver.cpp @@ -148,7 +148,11 @@ void MolfileSaver::_saveMolecule(BaseMolecule& mol, bool query) } MoleculeCIPCalculator mcc; - mcc.updateCIPStereoDescriptors(mol, add_stereo_desc); + if (add_stereo_desc && mcc.addCIPStereoDescriptors(mol)) + { + mcc.removeCIPSgroups(mol); // remove old CIP-Sroups + mcc.addCIPSgroups(mol); + } if (_v2000) { diff --git a/utils/indigo-depict/main.c b/utils/indigo-depict/main.c index 4936dbd5a5..0fa8733cb1 100644 --- a/utils/indigo-depict/main.c +++ b/utils/indigo-depict/main.c @@ -395,7 +395,6 @@ int parseParams(Params* p, int argc, char* argv[]) indigoSetOptionBool("render-coloring", 1); indigoSetOptionBool("render-highlight-color-enabled", 1); indigoSetOption("render-superatom-mode", "collapse"); - indigoSetOptionBool("json-saving-pretty", 1); for (; i < argc; i++) { @@ -852,6 +851,7 @@ int main(int argc, char* argv[]) indigoSetOption("ignore-stereochemistry-errors", "on"); indigoSetOption("molfile-saving-mode", "3000"); + indigoSetOptionBool("json-saving-pretty", "on"); if (parseParams(&p, argc, argv) < 0) return -1;