From eb6c27a1880442fceed9927d6a4c07fdcd51f4f9 Mon Sep 17 00:00:00 2001 From: even1024 Date: Tue, 17 Oct 2023 10:33:58 +0200 Subject: [PATCH] #1183 Support monomer templates import from KET-format (#1335) --- .../integration/ref/formats/ket_to_mol.py.out | 6 + .../integration/tests/formats/ket_to_mol.py | 13 +- .../tests/formats/molecules/chem.ket | 183 ++++++++ .../tests/formats/molecules/chem.mol | 2 +- .../tests/formats/molecules/cysteine.ket | 177 ++++++++ .../tests/formats/molecules/dala.ket | 141 +++++++ .../tests/formats/molecules/dcysteine.ket | 179 ++++++++ .../tests/formats/molecules/dthymine.ket | 382 +++++++++++++++++ .../tests/formats/molecules/thymine.ket | 399 ++++++++++++++++++ .../integration/tests/formats/ref/chem.mol | 58 +++ .../tests/formats/ref/cysteine.mol | 58 +++ .../integration/tests/formats/ref/dala.mol | 49 +++ .../tests/formats/ref/dcysteine.mol | 58 +++ .../tests/formats/ref/dthymine.mol | 82 ++++ .../integration/tests/formats/ref/thymine.mol | 84 ++++ .../molecule/src/molfile_saver.cpp | 3 +- 16 files changed, 1871 insertions(+), 3 deletions(-) create mode 100644 api/tests/integration/tests/formats/molecules/chem.ket create mode 100644 api/tests/integration/tests/formats/molecules/cysteine.ket create mode 100644 api/tests/integration/tests/formats/molecules/dala.ket create mode 100644 api/tests/integration/tests/formats/molecules/dcysteine.ket create mode 100644 api/tests/integration/tests/formats/molecules/dthymine.ket create mode 100644 api/tests/integration/tests/formats/molecules/thymine.ket create mode 100644 api/tests/integration/tests/formats/ref/chem.mol create mode 100644 api/tests/integration/tests/formats/ref/cysteine.mol create mode 100644 api/tests/integration/tests/formats/ref/dala.mol create mode 100644 api/tests/integration/tests/formats/ref/dcysteine.mol create mode 100644 api/tests/integration/tests/formats/ref/dthymine.mol create mode 100644 api/tests/integration/tests/formats/ref/thymine.mol diff --git a/api/tests/integration/ref/formats/ket_to_mol.py.out b/api/tests/integration/ref/formats/ket_to_mol.py.out index d35f29db50..c52c3e95c2 100644 --- a/api/tests/integration/ref/formats/ket_to_mol.py.out +++ b/api/tests/integration/ref/formats/ket_to_mol.py.out @@ -1,4 +1,10 @@ *** KET to MOL *** +chem.ket:SUCCEED +cysteine.ket:SUCCEED +dala.ket:SUCCEED +dcysteine.ket:SUCCEED +dthymine.ket:SUCCEED suplabel.ket:SUCCEED +thymine.ket:SUCCEED empty_apid.ket:SUCCEED ket-reaction-arrow.ket:SUCCEED diff --git a/api/tests/integration/tests/formats/ket_to_mol.py b/api/tests/integration/tests/formats/ket_to_mol.py index ea2bc685de..bf2258c78d 100644 --- a/api/tests/integration/tests/formats/ket_to_mol.py +++ b/api/tests/integration/tests/formats/ket_to_mol.py @@ -24,11 +24,22 @@ def find_diff(a, b): ref_path = joinPathPy("ref/", __file__) root_rea = joinPathPy("reactions/", __file__) -files = ["suplabel"] +files = [ + "suplabel", + "cysteine", + "dcysteine", + "thymine", + "dthymine", + "dala", + "chem", +] files.sort() for filename in files: mol = indigo.loadMoleculeFromFile(os.path.join(root, filename + ".ket")) + # with open(os.path.join(ref_path, filename) + ".mol", "w") as file: + # file.write(mol.molfile()) + with open(os.path.join(ref_path, filename) + ".mol", "r") as file: ket_ref = file.read() ket = mol.molfile() diff --git a/api/tests/integration/tests/formats/molecules/chem.ket b/api/tests/integration/tests/formats/molecules/chem.ket new file mode 100644 index 0000000000..8b9923cc5b --- /dev/null +++ b/api/tests/integration/tests/formats/molecules/chem.ket @@ -0,0 +1,183 @@ +{ + "root": { + "nodes": [], + "templates": [ + { + "$ref": "monomerTemplate-cch_3" + } + ] + }, + "monomerTemplate-cch_3": { + "type": "monomerTemplate", + "id": "cch_3", + "class": "Chem", + "classHELM": "CHEM", + "alias": "cch", + "attachmentPoints": [ + { + "type": "right", + "label": "R2", + "attachmentAtom": 8, + "leavingGroup": { + "atoms": [ + 1 + ] + } + }, + { + "type": "side", + "label": "R3", + "attachmentAtom": 6, + "leavingGroup": { + "atoms": [ + 2 + ] + } + }, + { + "type": "side", + "label": "R5", + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 0 + ] + } + } + ], + "atoms": [ + { + "label": "H", + "location": [ + 9.201199531555176, + -7.158699989318848, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 8.374699592590332, + -7.985400199890137, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 10.02810001373291, + -7.985400199890137, + 0.0 + ] + }, + { + "label": "S", + "location": [ + 9.718199729919434, + -6.737199783325195, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 9.194899559020996, + -7.6427001953125, + 0.0 + ], + "stereoLabel": "abs" + }, + { + "label": "O", + "location": [ + 9.698399543762207, + -8.580300331115723, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 9.698399543762207, + -7.97629976272583, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 9.194899559020996, + -7.03879976272583, + 0.0 + ] + }, + { + "label": "N", + "location": [ + 8.704099655151368, + -7.994699954986572, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 3, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 6, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 7 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 7, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 4 + ] + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/formats/molecules/chem.mol b/api/tests/integration/tests/formats/molecules/chem.mol index 428920759b..710fb22cf7 100644 --- a/api/tests/integration/tests/formats/molecules/chem.mol +++ b/api/tests/integration/tests/formats/molecules/chem.mol @@ -37,7 +37,7 @@ M V30 2 SUP 2 ATOMS=(1 3) XBONDS=(1 2) LABEL=OH CSTATE=(4 2 -0.825 0 0) - M V30 CLASS=LGRP M V30 3 SUP 3 ATOMS=(1 1) XBONDS=(1 1) LABEL=H CSTATE=(4 1 0 -0.8267 0) - M V30 CLASS=LGRP -M V30 4 SUP 4 ATOMS=(6 4 5 6 7 8 9) XBONDS=(3 1 2 3) LABEL=Cys CSTATE=(4 3 - +M V30 4 SUP 4 ATOMS=(6 4 5 6 7 8 9) XBONDS=(3 1 2 3) LABEL=cch CSTATE=(4 3 - M V30 -0.8265 0 0) CSTATE=(4 2 0.825 0 0) CSTATE=(4 1 0 0.8267 0) CLASS=AA - M V30 SAP=(3 9 2 Br) SAP=(3 7 3 Cx) SAP=(3 4 1 Ex) M V30 END SGROUP diff --git a/api/tests/integration/tests/formats/molecules/cysteine.ket b/api/tests/integration/tests/formats/molecules/cysteine.ket new file mode 100644 index 0000000000..e8a46d44c1 --- /dev/null +++ b/api/tests/integration/tests/formats/molecules/cysteine.ket @@ -0,0 +1,177 @@ +{ + "root": { + "nodes": [], + "templates": [ + { + "$ref": "monomerTemplate-cys_3" + } + ] + }, + "monomerTemplate-cys_3": { + "type": "monomerTemplate", + "id": "cys_3", + "class": "AminoAcid", + "classHELM": "PEPTIDE", + "alias": "C", + "attachmentPoints": [ + { + "attachmentAtom": 8, + "leavingGroup": { + "atoms": [ + 1 + ] + } + }, + { + "attachmentAtom": 6, + "leavingGroup": { + "atoms": [ + 2 + ] + } + }, + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 0 + ] + } + } + ], + "atoms": [ + { + "label": "H", + "location": [ + 9.201199531555176, + -7.158699989318848, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 8.374699592590332, + -7.985400199890137, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 10.02810001373291, + -7.985400199890137, + 0.0 + ] + }, + { + "label": "S", + "location": [ + 9.718199729919434, + -6.737199783325195, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 9.194899559020996, + -7.6427001953125, + 0.0 + ], + "stereoLabel": "abs" + }, + { + "label": "O", + "location": [ + 9.698399543762207, + -8.580300331115723, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 9.698399543762207, + -7.97629976272583, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 9.194899559020996, + -7.03879976272583, + 0.0 + ] + }, + { + "label": "N", + "location": [ + 8.704099655151368, + -7.994699954986572, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 3, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 6, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 7 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 7, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 4 + ] + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/formats/molecules/dala.ket b/api/tests/integration/tests/formats/molecules/dala.ket new file mode 100644 index 0000000000..11c52a388b --- /dev/null +++ b/api/tests/integration/tests/formats/molecules/dala.ket @@ -0,0 +1,141 @@ +{ + "root": { + "nodes": [], + "templates": [ + { + "$ref": "monomerTemplate-ala_23" + } + ] + }, + "monomerTemplate-ala_23": { + "type": "monomerTemplate", + "id": "ala_23", + "class": "D-AminoAcid", + "classHELM": "PEPTIDE", + "alias": "da", + "naturalAnalog": "Ala", + "naturalAnalogShort": "A", + "attachmentPoints": [ + { + "attachmentAtom": 2, + "leavingGroup": { + "atoms": [ + 1 + ] + } + }, + { + "attachmentAtom": 4, + "leavingGroup": { + "atoms": [ + 0 + ] + } + } + ], + "atoms": [ + { + "label": "O", + "location": [ + 6.6265997886657719, + -2.066200017929077, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 5.0015997886657719, + -2.087599992752075, + 0.0 + ] + }, + { + "label": "N", + "location": [ + 5.135799884796143, + -2.078399896621704, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 5.78439998626709, + -1.5982999801635743, + 0.0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 6.475299835205078, + -2.0652999877929689, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 6.475299835205078, + -2.897700071334839, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 5.78439998626709, + -0.7662000060081482, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 2, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 6 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 2, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 0 + ] + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/formats/molecules/dcysteine.ket b/api/tests/integration/tests/formats/molecules/dcysteine.ket new file mode 100644 index 0000000000..34379115a6 --- /dev/null +++ b/api/tests/integration/tests/formats/molecules/dcysteine.ket @@ -0,0 +1,179 @@ +{ + "root": { + "nodes": [], + "templates": [ + { + "$ref": "monomerTemplate-cys_27" + } + ] + }, + "monomerTemplate-cys_27": { + "type": "monomerTemplate", + "id": "cys_27", + "class": "D-AminoAcid", + "classHELM": "PEPTIDE", + "alias": "dc", + "naturalAnalog": "Cys", + "naturalAnalogShort": "C", + "attachmentPoints": [ + { + "attachmentAtom": 8, + "leavingGroup": { + "atoms": [ + 1 + ] + } + }, + { + "attachmentAtom": 6, + "leavingGroup": { + "atoms": [ + 2 + ] + } + }, + { + "attachmentAtom": 3, + "leavingGroup": { + "atoms": [ + 0 + ] + } + } + ], + "atoms": [ + { + "label": "H", + "location": [ + 9.201199531555176, + -7.158699989318848, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 8.374699592590332, + -7.985400199890137, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 10.02810001373291, + -7.985400199890137, + 0.0 + ] + }, + { + "label": "S", + "location": [ + 9.718199729919434, + -6.737199783325195, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 9.194899559020996, + -7.6427001953125, + 0.0 + ], + "stereoLabel": "abs" + }, + { + "label": "O", + "location": [ + 9.698399543762207, + -8.580300331115723, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 9.698399543762207, + -7.97629976272583, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 9.194899559020996, + -7.03879976272583, + 0.0 + ] + }, + { + "label": "N", + "location": [ + 8.704099655151368, + -7.994699954986572, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 3, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 1 + ] + }, + { + "type": 2, + "atoms": [ + 6, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 7 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 7, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 4 + ] + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/formats/molecules/dthymine.ket b/api/tests/integration/tests/formats/molecules/dthymine.ket new file mode 100644 index 0000000000..d7cd558006 --- /dev/null +++ b/api/tests/integration/tests/formats/molecules/dthymine.ket @@ -0,0 +1,382 @@ +{ + "root": { + "nodes": [], + "templates": [ + { + "$ref": "monomerTemplate-Thy_45" + } + ] + }, + "monomerTemplate-Thy_45": { + "type": "monomerTemplate", + "id": "Thy_45", + "class": "DNA", + "classHELM": "RNA", + "alias": "T", + "attachmentPoints": [ + { + "attachmentAtom": 9, + "leavingGroup": { + "atoms": [ + 20 + ] + } + }, + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 21 + ] + } + } + ], + "atoms": [ + { + "label": "O", + "location": [ + 13.210200309753418, + -15.37720012664795, + 0.0 + ] + }, + { + "label": "N", + "location": [ + 14.565500259399414, + -12.637800216674805, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 13.616000175476075, + -13.013799667358399, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 14.294500350952149, + -13.512299537658692, + 0.0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 14.042400360107422, + -14.283599853515625, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 13.210200309753418, + -14.283599853515625, + 0.0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 12.947199821472168, + -13.501299858093262, + 0.0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 12.16569995880127, + -13.255499839782715, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 11.916500091552735, + -12.463500022888184, + 0.0 + ] + }, + { + "label": "P", + "location": [ + 10.941300392150879, + -12.113499641418457, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 10.941300392150879, + -11.28849983215332, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 10.941300392150879, + -12.93850040435791, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 15.402700424194336, + -12.37279987335205, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 13.824299812316895, + -11.970499992370606, + 0.0 + ] + }, + { + "label": "N", + "location": [ + 15.675100326538086, + -11.494000434875489, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 16.06060028076172, + -13.013500213623047, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 14.096699714660645, + -11.09179973602295, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 14.973299980163575, + -10.844300270080567, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 15.244199752807618, + -9.970199584960938, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 13.437600135803223, + -10.448399543762207, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 10.800800323486329, + -13.745400428771973, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 13.378700256347657, + -13.745400428771973, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 21 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 3 + ] + }, + { + "type": 2, + "atoms": [ + 9, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 7 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 3, + 1 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 0 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 12 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 13 + ] + }, + { + "type": 1, + "atoms": [ + 12, + 14 + ] + }, + { + "type": 2, + "atoms": [ + 12, + 15 + ] + }, + { + "type": 2, + "atoms": [ + 13, + 16 + ] + }, + { + "type": 1, + "atoms": [ + 14, + 17 + ] + }, + { + "type": 2, + "atoms": [ + 17, + 18 + ] + }, + { + "type": 1, + "atoms": [ + 16, + 17 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 16, + 19 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 20 + ] + }, + { + "type": 1, + "atoms": [ + 8, + 9 + ] + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/formats/molecules/thymine.ket b/api/tests/integration/tests/formats/molecules/thymine.ket new file mode 100644 index 0000000000..c87483e86f --- /dev/null +++ b/api/tests/integration/tests/formats/molecules/thymine.ket @@ -0,0 +1,399 @@ +{ + "root": { + "nodes": [], + "templates": [ + { + "$ref": "monomerTemplate-Thy_131" + } + ] + }, + "monomerTemplate-Thy_131": { + "type": "monomerTemplate", + "id": "Thy_131", + "class": "RNA", + "classHELM": "RNA", + "alias": "T", + "attachmentPoints": [ + { + "attachmentAtom": 10, + "leavingGroup": { + "atoms": [ + 21 + ] + } + }, + { + "attachmentAtom": 0, + "leavingGroup": { + "atoms": [ + 22 + ] + } + } + ], + "atoms": [ + { + "label": "O", + "location": [ + 12.760199546813965, + -15.714699745178223, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 14.082500457763672, + -15.261699676513672, + 0.0 + ] + }, + { + "label": "N", + "location": [ + 14.108799934387207, + -12.9483003616333, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 13.166000366210938, + -13.326299667358399, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 13.844499588012696, + -13.824799537658692, + 0.0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 13.592399597167969, + -14.596099853515625, + 0.0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 12.760199546813965, + -14.596099853515625, + 0.0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 12.497200012207032, + -13.813799858093262, + 0.0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 11.715700149536133, + -13.567999839782715, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 11.466500282287598, + -12.776000022888184, + 0.0 + ] + }, + { + "label": "P", + "location": [ + 10.491299629211426, + -12.37600040435791, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 10.116299629211426, + -11.550999641418457, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 10.491299629211426, + -13.201000213623047, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 14.943900108337403, + -12.676899909973145, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 13.362500190734864, + -12.286600112915039, + 0.0 + ] + }, + { + "label": "N", + "location": [ + 15.209600448608399, + -11.795900344848633, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 15.60669994354248, + -13.3125, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 13.628100395202637, + -11.405900001525879, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 14.502799987792969, + -11.151599884033204, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 14.767000198364258, + -10.275500297546387, + 0.0 + ] + }, + { + "label": "C", + "location": [ + 12.964200019836426, + -10.767499923706055, + 0.0 + ] + }, + { + "label": "O", + "location": [ + 10.525699615478516, + -14.04539966583252, + 0.0 + ] + }, + { + "label": "H", + "location": [ + 12.559800148010254, + -14.04539966583252, + 0.0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 22 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 10, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 4 + ] + }, + { + "type": 2, + "atoms": [ + 10, + 12 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 4, + 2 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 1 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 6, + 0 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 8, + 9 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 13 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 14 + ] + }, + { + "type": 1, + "atoms": [ + 13, + 15 + ] + }, + { + "type": 2, + "atoms": [ + 13, + 16 + ] + }, + { + "type": 2, + "atoms": [ + 14, + 17 + ] + }, + { + "type": 1, + "atoms": [ + 15, + 18 + ] + }, + { + "type": 2, + "atoms": [ + 18, + 19 + ] + }, + { + "type": 1, + "atoms": [ + 17, + 18 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 17, + 20 + ] + }, + { + "type": 1, + "atoms": [ + 10, + 21 + ] + }, + { + "type": 1, + "atoms": [ + 9, + 10 + ] + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/formats/ref/chem.mol b/api/tests/integration/tests/formats/ref/chem.mol new file mode 100644 index 0000000000..efd77a765a --- /dev/null +++ b/api/tests/integration/tests/formats/ref/chem.mol @@ -0,0 +1,58 @@ + + -INDIGO-01000000002D + + 0 0 0 0 0 0 0 0 0 0 0 V3000 +M V30 BEGIN CTAB +M V30 COUNTS 0 0 0 0 0 +M V30 BEGIN ATOM +M V30 END ATOM +M V30 BEGIN BOND +M V30 END BOND +M V30 END CTAB +M V30 BEGIN TEMPLATE +M V30 TEMPLATE 1 CHEM/cch/cch +M V30 BEGIN CTAB +M V30 COUNTS 9 8 4 0 0 +M V30 BEGIN ATOM +M V30 1 H 9.2012 -7.1587 0.0 0 +M V30 2 H 8.3747 -7.9854 0.0 0 +M V30 3 O 10.0281 -7.9854 0.0 0 +M V30 4 S 9.7182 -6.7372 0.0 0 +M V30 5 C 9.1949 -7.6427 0.0 0 CFG=2 +M V30 6 O 9.6984 -8.5803 0.0 0 +M V30 7 C 9.6984 -7.9763 0.0 0 +M V30 8 C 9.1949 -7.0388 0.0 0 +M V30 9 N 8.7041 -7.9947 0.0 0 +M V30 END ATOM +M V30 BEGIN BOND +M V30 1 1 4 1 +M V30 2 1 7 3 +M V30 3 1 9 2 +M V30 4 2 7 6 +M V30 5 1 5 8 CFG=1 +M V30 6 1 8 4 +M V30 7 1 5 7 +M V30 8 1 9 5 +M V30 END BOND +M V30 BEGIN COLLECTION +M V30 MDLV30/STEABS ATOMS=(1 5) +M V30 END COLLECTION +M V30 BEGIN SGROUP +M V30 1 SUP 1 ATOMS=(1 2) XBONDS=(1 3) BRKXYZ=(9 0.164700 -0.004650 0.000000- +M V30 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000) LABEL=H CLASS=- +M V30 LGRP +M V30 2 SUP 2 ATOMS=(1 3) XBONDS=(1 2) BRKXYZ=(9 -0.164850 0.004550 0.000000- +M V30 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000) LABEL=OH CLASS- +M V30 =LGRP +M V30 3 SUP 3 ATOMS=(1 1) XBONDS=(1 1) BRKXYZ=(9 0.258500 0.210750 0.000000 - +M V30 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000) LABEL=H CLASS=L- +M V30 GRP +M V30 4 SUP 4 ATOMS=(6 4 5 6 7 8 9) XBONDS=(3 1 2 3) BRKXYZ=(9 -0.258500 -0.- +M V30 210750 0.000000 0.164850 -0.004550 0.000000 0.000000 0.000000 0.000000- +M V30 ) BRKXYZ=(9 -0.164700 0.004650 0.000000 0.000000 0.000000 0.000000 0.0- +M V30 00000 0.000000 0.000000) LABEL=cch CLASS=CHEM SAP=(3 9 2 R2) SAP=(3 7 - +M V30 3 Dx) SAP=(3 4 1 Fx) +M V30 END SGROUP +M V30 END CTAB +M V30 END TEMPLATE +M END diff --git a/api/tests/integration/tests/formats/ref/cysteine.mol b/api/tests/integration/tests/formats/ref/cysteine.mol new file mode 100644 index 0000000000..f38151667b --- /dev/null +++ b/api/tests/integration/tests/formats/ref/cysteine.mol @@ -0,0 +1,58 @@ + + -INDIGO-01000000002D + + 0 0 0 0 0 0 0 0 0 0 0 V3000 +M V30 BEGIN CTAB +M V30 COUNTS 0 0 0 0 0 +M V30 BEGIN ATOM +M V30 END ATOM +M V30 BEGIN BOND +M V30 END BOND +M V30 END CTAB +M V30 BEGIN TEMPLATE +M V30 TEMPLATE 1 AA/cys/C +M V30 BEGIN CTAB +M V30 COUNTS 9 8 4 0 0 +M V30 BEGIN ATOM +M V30 1 H 9.2012 -7.1587 0.0 0 +M V30 2 H 8.3747 -7.9854 0.0 0 +M V30 3 O 10.0281 -7.9854 0.0 0 +M V30 4 S 9.7182 -6.7372 0.0 0 +M V30 5 C 9.1949 -7.6427 0.0 0 CFG=2 +M V30 6 O 9.6984 -8.5803 0.0 0 +M V30 7 C 9.6984 -7.9763 0.0 0 +M V30 8 C 9.1949 -7.0388 0.0 0 +M V30 9 N 8.7041 -7.9947 0.0 0 +M V30 END ATOM +M V30 BEGIN BOND +M V30 1 1 4 1 +M V30 2 1 7 3 +M V30 3 1 9 2 +M V30 4 2 7 6 +M V30 5 1 5 8 CFG=1 +M V30 6 1 8 4 +M V30 7 1 5 7 +M V30 8 1 9 5 +M V30 END BOND +M V30 BEGIN COLLECTION +M V30 MDLV30/STEABS ATOMS=(1 5) +M V30 END COLLECTION +M V30 BEGIN SGROUP +M V30 1 SUP 1 ATOMS=(1 2) XBONDS=(1 3) BRKXYZ=(9 0.164700 -0.004650 0.000000- +M V30 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000) LABEL=H CLASS=- +M V30 LGRP +M V30 2 SUP 2 ATOMS=(1 3) XBONDS=(1 2) BRKXYZ=(9 -0.164850 0.004550 0.000000- +M V30 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000) LABEL=OH CLASS- +M V30 =LGRP +M V30 3 SUP 3 ATOMS=(1 1) XBONDS=(1 1) BRKXYZ=(9 0.258500 0.210750 0.000000 - +M V30 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000) LABEL=H CLASS=L- +M V30 GRP +M V30 4 SUP 4 ATOMS=(6 4 5 6 7 8 9) XBONDS=(3 1 2 3) BRKXYZ=(9 -0.258500 -0.- +M V30 210750 0.000000 0.164850 -0.004550 0.000000 0.000000 0.000000 0.000000- +M V30 ) BRKXYZ=(9 -0.164700 0.004650 0.000000 0.000000 0.000000 0.000000 0.0- +M V30 00000 0.000000 0.000000) LABEL=C CLASS=AA SAP=(3 9 2 Al) SAP=(3 7 3 Br- +M V30 ) SAP=(3 4 1 Cx) +M V30 END SGROUP +M V30 END CTAB +M V30 END TEMPLATE +M END diff --git a/api/tests/integration/tests/formats/ref/dala.mol b/api/tests/integration/tests/formats/ref/dala.mol new file mode 100644 index 0000000000..0310b71fa4 --- /dev/null +++ b/api/tests/integration/tests/formats/ref/dala.mol @@ -0,0 +1,49 @@ + + -INDIGO-01000000002D + + 0 0 0 0 0 0 0 0 0 0 0 V3000 +M V30 BEGIN CTAB +M V30 COUNTS 0 0 0 0 0 +M V30 BEGIN ATOM +M V30 END ATOM +M V30 BEGIN BOND +M V30 END BOND +M V30 END CTAB +M V30 BEGIN TEMPLATE +M V30 TEMPLATE 1 dAA/ala/a NATREPLACE=AA/A +M V30 BEGIN CTAB +M V30 COUNTS 7 6 3 0 0 +M V30 BEGIN ATOM +M V30 1 O 6.6266 -2.0662 0.0 0 +M V30 2 H 5.0016 -2.0876 0.0 0 +M V30 3 N 5.1358 -2.0784 0.0 0 +M V30 4 C 5.7844 -1.5983 0.0 0 CFG=1 +M V30 5 C 6.4753 -2.0653 0.0 0 +M V30 6 O 6.4753 -2.8977 0.0 0 +M V30 7 C 5.7844 -0.7662 0.0 0 +M V30 END ATOM +M V30 BEGIN BOND +M V30 1 1 3 4 +M V30 2 1 4 5 +M V30 3 2 5 6 +M V30 4 1 4 7 CFG=3 +M V30 5 1 3 2 +M V30 6 1 5 1 +M V30 END BOND +M V30 BEGIN COLLECTION +M V30 MDLV30/STEABS ATOMS=(1 4) +M V30 END COLLECTION +M V30 BEGIN SGROUP +M V30 1 SUP 1 ATOMS=(1 2) XBONDS=(1 5) BRKXYZ=(9 0.067100 0.004600 0.000000 - +M V30 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000) LABEL=H CLASS=L- +M V30 GRP +M V30 2 SUP 2 ATOMS=(1 1) XBONDS=(1 6) BRKXYZ=(9 -0.075650 0.000450 0.000000- +M V30 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000) LABEL=OH CLASS- +M V30 =LGRP +M V30 3 SUP 3 ATOMS=(5 3 4 5 6 7) XBONDS=(2 5 6) BRKXYZ=(9 -0.067100 -0.0046- +M V30 00 0.000000 0.075650 -0.000450 0.000000 0.000000 0.000000 0.000000) LA- +M V30 BEL=a CLASS=AA SAP=(3 3 2 Al) SAP=(3 5 1 Br) NATREPLACE=AA/A +M V30 END SGROUP +M V30 END CTAB +M V30 END TEMPLATE +M END diff --git a/api/tests/integration/tests/formats/ref/dcysteine.mol b/api/tests/integration/tests/formats/ref/dcysteine.mol new file mode 100644 index 0000000000..d4f5eaecb3 --- /dev/null +++ b/api/tests/integration/tests/formats/ref/dcysteine.mol @@ -0,0 +1,58 @@ + + -INDIGO-01000000002D + + 0 0 0 0 0 0 0 0 0 0 0 V3000 +M V30 BEGIN CTAB +M V30 COUNTS 0 0 0 0 0 +M V30 BEGIN ATOM +M V30 END ATOM +M V30 BEGIN BOND +M V30 END BOND +M V30 END CTAB +M V30 BEGIN TEMPLATE +M V30 TEMPLATE 1 dAA/cys/c NATREPLACE=AA/C +M V30 BEGIN CTAB +M V30 COUNTS 9 8 4 0 0 +M V30 BEGIN ATOM +M V30 1 H 9.2012 -7.1587 0.0 0 +M V30 2 H 8.3747 -7.9854 0.0 0 +M V30 3 O 10.0281 -7.9854 0.0 0 +M V30 4 S 9.7182 -6.7372 0.0 0 +M V30 5 C 9.1949 -7.6427 0.0 0 CFG=1 +M V30 6 O 9.6984 -8.5803 0.0 0 +M V30 7 C 9.6984 -7.9763 0.0 0 +M V30 8 C 9.1949 -7.0388 0.0 0 +M V30 9 N 8.7041 -7.9947 0.0 0 +M V30 END ATOM +M V30 BEGIN BOND +M V30 1 1 4 1 +M V30 2 1 7 3 +M V30 3 1 9 2 +M V30 4 2 7 6 +M V30 5 1 5 8 CFG=3 +M V30 6 1 8 4 +M V30 7 1 5 7 +M V30 8 1 9 5 +M V30 END BOND +M V30 BEGIN COLLECTION +M V30 MDLV30/STEABS ATOMS=(1 5) +M V30 END COLLECTION +M V30 BEGIN SGROUP +M V30 1 SUP 1 ATOMS=(1 2) XBONDS=(1 3) BRKXYZ=(9 0.164700 -0.004650 0.000000- +M V30 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000) LABEL=H CLASS=- +M V30 LGRP +M V30 2 SUP 2 ATOMS=(1 3) XBONDS=(1 2) BRKXYZ=(9 -0.164850 0.004550 0.000000- +M V30 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000) LABEL=OH CLASS- +M V30 =LGRP +M V30 3 SUP 3 ATOMS=(1 1) XBONDS=(1 1) BRKXYZ=(9 0.258500 0.210750 0.000000 - +M V30 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000) LABEL=H CLASS=L- +M V30 GRP +M V30 4 SUP 4 ATOMS=(6 4 5 6 7 8 9) XBONDS=(3 1 2 3) BRKXYZ=(9 -0.258500 -0.- +M V30 210750 0.000000 0.164850 -0.004550 0.000000 0.000000 0.000000 0.000000- +M V30 ) BRKXYZ=(9 -0.164700 0.004650 0.000000 0.000000 0.000000 0.000000 0.0- +M V30 00000 0.000000 0.000000) LABEL=c CLASS=AA SAP=(3 9 2 Al) SAP=(3 7 3 Br- +M V30 ) SAP=(3 4 1 Cx) NATREPLACE=AA/C +M V30 END SGROUP +M V30 END CTAB +M V30 END TEMPLATE +M END diff --git a/api/tests/integration/tests/formats/ref/dthymine.mol b/api/tests/integration/tests/formats/ref/dthymine.mol new file mode 100644 index 0000000000..3475b77bfe --- /dev/null +++ b/api/tests/integration/tests/formats/ref/dthymine.mol @@ -0,0 +1,82 @@ + + -INDIGO-01000000002D + + 0 0 0 0 0 0 0 0 0 0 0 V3000 +M V30 BEGIN CTAB +M V30 COUNTS 0 0 0 0 0 +M V30 BEGIN ATOM +M V30 END ATOM +M V30 BEGIN BOND +M V30 END BOND +M V30 END CTAB +M V30 BEGIN TEMPLATE +M V30 TEMPLATE 1 DNA/Thy/T +M V30 BEGIN CTAB +M V30 COUNTS 22 23 3 0 0 +M V30 BEGIN ATOM +M V30 1 O 13.2102 -15.3772 0.0 0 +M V30 2 N 14.5655 -12.6378 0.0 0 +M V30 3 O 13.616 -13.0138 0.0 0 +M V30 4 C 14.2945 -13.5123 0.0 0 CFG=2 +M V30 5 C 14.0424 -14.2836 0.0 0 +M V30 6 C 13.2102 -14.2836 0.0 0 CFG=1 +M V30 7 C 12.9472 -13.5013 0.0 0 CFG=1 +M V30 8 C 12.1657 -13.2555 0.0 0 +M V30 9 O 11.9165 -12.4635 0.0 0 +M V30 10 P 10.9413 -12.1135 0.0 0 +M V30 11 O 10.9413 -11.2885 0.0 0 +M V30 12 O 10.9413 -12.9385 0.0 0 +M V30 13 C 15.4027 -12.3728 0.0 0 +M V30 14 C 13.8243 -11.9705 0.0 0 +M V30 15 N 15.6751 -11.494 0.0 0 +M V30 16 O 16.0606 -13.0135 0.0 0 +M V30 17 C 14.0967 -11.0918 0.0 0 +M V30 18 C 14.9733 -10.8443 0.0 0 +M V30 19 O 15.2442 -9.9702 0.0 0 +M V30 20 C 13.4376 -10.4484 0.0 0 +M V30 21 O 10.8008 -13.7454 0.0 0 +M V30 22 H 13.3787 -13.7454 0.0 0 +M V30 END ATOM +M V30 BEGIN BOND +M V30 1 1 1 22 +M V30 2 1 7 6 +M V30 3 1 10 11 +M V30 4 1 3 4 +M V30 5 2 10 12 +M V30 6 1 6 5 +M V30 7 1 4 5 +M V30 8 1 7 8 CFG=1 +M V30 9 1 4 2 CFG=1 +M V30 10 1 6 1 CFG=3 +M V30 11 1 8 9 +M V30 12 1 2 13 +M V30 13 1 2 14 +M V30 14 1 13 15 +M V30 15 2 13 16 +M V30 16 2 14 17 +M V30 17 1 15 18 +M V30 18 2 18 19 +M V30 19 1 17 18 +M V30 20 1 7 3 +M V30 21 1 17 20 +M V30 22 1 10 21 +M V30 23 1 9 10 +M V30 END BOND +M V30 BEGIN COLLECTION +M V30 MDLV30/STEABS ATOMS=(3 4 6 7) +M V30 END COLLECTION +M V30 BEGIN SGROUP +M V30 1 SUP 1 ATOMS=(1 21) XBONDS=(1 22) BRKXYZ=(9 0.070250 0.815950 0.00000- +M V30 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000) LABEL=OH CLAS- +M V30 S=LGRP +M V30 2 SUP 2 ATOMS=(1 22) XBONDS=(1 1) BRKXYZ=(9 -0.084250 -0.815900 0.0000- +M V30 00 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000) LABEL=H CLAS- +M V30 S=LGRP +M V30 3 SUP 3 ATOMS=(20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20) - +M V30 XBONDS=(2 1 22) BRKXYZ=(9 0.084250 0.815900 0.000000 -0.070250 -0.8159- +M V30 50 0.000000 0.000000 0.000000 0.000000) LABEL=T CLASS=DNA SAP=(3 10 21- +M V30 Al) SAP=(3 1 22 Br) +M V30 END SGROUP +M V30 END CTAB +M V30 END TEMPLATE +M END diff --git a/api/tests/integration/tests/formats/ref/thymine.mol b/api/tests/integration/tests/formats/ref/thymine.mol new file mode 100644 index 0000000000..cedce8dedd --- /dev/null +++ b/api/tests/integration/tests/formats/ref/thymine.mol @@ -0,0 +1,84 @@ + + -INDIGO-01000000002D + + 0 0 0 0 0 0 0 0 0 0 0 V3000 +M V30 BEGIN CTAB +M V30 COUNTS 0 0 0 0 0 +M V30 BEGIN ATOM +M V30 END ATOM +M V30 BEGIN BOND +M V30 END BOND +M V30 END CTAB +M V30 BEGIN TEMPLATE +M V30 TEMPLATE 1 RNA/Thy/T +M V30 BEGIN CTAB +M V30 COUNTS 23 24 3 0 0 +M V30 BEGIN ATOM +M V30 1 O 12.7602 -15.7147 0.0 0 +M V30 2 O 14.0825 -15.2617 0.0 0 +M V30 3 N 14.1088 -12.9483 0.0 0 +M V30 4 O 13.166 -13.3263 0.0 0 +M V30 5 C 13.8445 -13.8248 0.0 0 CFG=2 +M V30 6 C 13.5924 -14.5961 0.0 0 CFG=1 +M V30 7 C 12.7602 -14.5961 0.0 0 CFG=1 +M V30 8 C 12.4972 -13.8138 0.0 0 CFG=1 +M V30 9 C 11.7157 -13.568 0.0 0 +M V30 10 O 11.4665 -12.776 0.0 0 +M V30 11 P 10.4913 -12.376 0.0 0 +M V30 12 O 10.1163 -11.551 0.0 0 +M V30 13 O 10.4913 -13.201 0.0 0 +M V30 14 C 14.9439 -12.6769 0.0 0 +M V30 15 C 13.3625 -12.2866 0.0 0 +M V30 16 N 15.2096 -11.7959 0.0 0 +M V30 17 O 15.6067 -13.3125 0.0 0 +M V30 18 C 13.6281 -11.4059 0.0 0 +M V30 19 C 14.5028 -11.1516 0.0 0 +M V30 20 O 14.767 -10.2755 0.0 0 +M V30 21 C 12.9642 -10.7675 0.0 0 +M V30 22 O 10.5257 -14.0454 0.0 0 +M V30 23 H 12.5598 -14.0454 0.0 0 +M V30 END ATOM +M V30 BEGIN BOND +M V30 1 1 1 23 +M V30 2 1 8 7 +M V30 3 1 11 12 +M V30 4 1 4 5 +M V30 5 2 11 13 +M V30 6 1 7 6 +M V30 7 1 5 6 +M V30 8 1 8 9 CFG=1 +M V30 9 1 5 3 CFG=1 +M V30 10 1 6 2 CFG=3 +M V30 11 1 7 1 CFG=3 +M V30 12 1 9 10 +M V30 13 1 3 14 +M V30 14 1 3 15 +M V30 15 1 14 16 +M V30 16 2 14 17 +M V30 17 2 15 18 +M V30 18 1 16 19 +M V30 19 2 19 20 +M V30 20 1 18 19 +M V30 21 1 8 4 +M V30 22 1 18 21 +M V30 23 1 11 22 +M V30 24 1 10 11 +M V30 END BOND +M V30 BEGIN COLLECTION +M V30 MDLV30/STEABS ATOMS=(4 5 6 7 8) +M V30 END COLLECTION +M V30 BEGIN SGROUP +M V30 1 SUP 1 ATOMS=(1 22) XBONDS=(1 23) BRKXYZ=(9 -0.017200 0.834700 0.0000- +M V30 00 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000) LABEL=OH CLA- +M V30 SS=LGRP +M V30 2 SUP 2 ATOMS=(1 23) XBONDS=(1 1) BRKXYZ=(9 0.100200 -0.834650 0.00000- +M V30 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000) LABEL=H CLASS- +M V30 =LGRP +M V30 3 SUP 3 ATOMS=(21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2- +M V30 1) XBONDS=(2 1 23) BRKXYZ=(9 -0.100200 0.834650 0.000000 0.017200 -0.8- +M V30 34700 0.000000 0.000000 0.000000 0.000000) LABEL=T CLASS=RNA SAP=(3 11- +M V30 22 Al) SAP=(3 1 23 Br) +M V30 END SGROUP +M V30 END CTAB +M V30 END TEMPLATE +M END diff --git a/core/indigo-core/molecule/src/molfile_saver.cpp b/core/indigo-core/molecule/src/molfile_saver.cpp index 36e632edf5..2345377e00 100644 --- a/core/indigo-core/molecule/src/molfile_saver.cpp +++ b/core/indigo-core/molecule/src/molfile_saver.cpp @@ -149,7 +149,8 @@ void MolfileSaver::_saveMolecule(BaseMolecule& mol, bool query) { // auto-detect the format: save to v3000 molfile only // if v2000 is not enough - _v2000 = !(mol.hasHighlighting() || mol.stereocenters.haveEnhancedStereocenter() || (mol.vertexCount() > 999 || mol.edgeCount() > 999)); + _v2000 = !(mol.hasHighlighting() || mol.stereocenters.haveEnhancedStereocenter() || + (mol.vertexCount() > 999 || mol.edgeCount() > 999 || mol.tgroups.getTGroupCount())); } bool rg2000 = (_v2000 && mol.rgroups.getRGroupCount() > 0);