From f5401560f761b83d41fe7ca83fd4c4410c5bb976 Mon Sep 17 00:00:00 2001 From: Aliaksandr Dziarkach <18146690+AliaksandrDziarkach@users.noreply.github.com> Date: Wed, 18 Dec 2024 14:22:45 +0300 Subject: [PATCH] #2427 - Import of unsplit monomers from HELM doesn't work (#2693) --- .../ref/formats/helm_to_ket.py.out | 1 + .../integration/tests/formats/helm_to_ket.py | 1 + .../tests/formats/ref/helm_unsplit.ket | 401 ++++ .../tests/formats/ref/monomer_library.ket | 1658 ++++++++++------- .../molecule/src/sequence_loader.cpp | 9 +- 5 files changed, 1430 insertions(+), 640 deletions(-) create mode 100644 api/tests/integration/tests/formats/ref/helm_unsplit.ket diff --git a/api/tests/integration/ref/formats/helm_to_ket.py.out b/api/tests/integration/ref/formats/helm_to_ket.py.out index 97b250f04f..b4d46f1318 100644 --- a/api/tests/integration/ref/formats/helm_to_ket.py.out +++ b/api/tests/integration/ref/formats/helm_to_ket.py.out @@ -14,6 +14,7 @@ helm_rna_without_base.ket:SUCCEED helm_simple_rna.ket:SUCCEED helm_smiles.ket:SUCCEED helm_smiles_sugar.ket:SUCCEED +helm_unsplit.ket:SUCCEED Test 'CHEM1{[A6OH]}|PEPTIDE1{A}$CHEM1,PEPTIDE1,1:R2-3:R1$$$V2.0': got expected error 'Polymer 'PEPTIDE1' does not contains monomer with number 3.' Test 'CHEM1{[A6OH]}|PEPTIDE1{A}$CHEM1,PEPTIDE1,1:R4-1:R1$$$V2.0': got expected error 'Unknown attachment point 'R4' in monomer A6OH' Test 'CHEM1{[A6OH]}|PEPTIDE1{A}$CHEM10,PEPTIDE1,1:R2-1:R1$$$V2.0': got expected error 'Polymer 'CHEM10' not found.' diff --git a/api/tests/integration/tests/formats/helm_to_ket.py b/api/tests/integration/tests/formats/helm_to_ket.py index 64f112d9e9..f07b22f905 100644 --- a/api/tests/integration/tests/formats/helm_to_ket.py +++ b/api/tests/integration/tests/formats/helm_to_ket.py @@ -44,6 +44,7 @@ def find_diff(a, b): "helm_no_left_ap": "PEPTIDE1{[DACys].C}$$$$V2.0", "helm_fractional_ratio": "PEPTIDE1{(A:1.5+C:0.1+G:3)}$$$$V2.0", "helm_chem_rna_hydro": "CHEM1{[MCC]}|RNA1{R(U)P}$CHEM1,RNA1,1:pair-3:pair$$$V2.0", + "helm_unsplit": "RNA1{[5Br-dU]}$$$$V2.0", } lib = indigo.loadMonomerLibraryFromFile( diff --git a/api/tests/integration/tests/formats/ref/helm_unsplit.ket b/api/tests/integration/tests/formats/ref/helm_unsplit.ket new file mode 100644 index 0000000000..d98233727e --- /dev/null +++ b/api/tests/integration/tests/formats/ref/helm_unsplit.ket @@ -0,0 +1,401 @@ +{ + "root": { + "nodes": [ + { + "$ref": "monomer0" + } + ], + "templates": [ + { + "$ref": "monomerTemplate-5Br-dU___5-Bromo-deoxyuridine" + } + ] + }, + "monomer0": { + "type": "monomer", + "id": "0", + "seqid": 1, + "position": { + "x": 0.000000, + "y": -0.000000 + }, + "alias": "5Br-dU", + "templateId": "5Br-dU___5-Bromo-deoxyuridine" + }, + "monomerTemplate-5Br-dU___5-Bromo-deoxyuridine": { + "type": "monomerTemplate", + "id": "5Br-dU___5-Bromo-deoxyuridine", + "class": "RNA", + "classHELM": "RNA", + "fullName": "5-Bromo-deoxyuridine", + "alias": "5Br-dU", + "naturalAnalogShort": "U", + "attachmentPoints": [ + { + "attachmentAtom": 7, + "type": "left", + "leavingGroup": { + "atoms": [ + 8 + ] + } + }, + { + "attachmentAtom": 10, + "type": "right", + "leavingGroup": { + "atoms": [ + 11 + ] + } + } + ], + "atoms": [ + { + "label": "C", + "location": [ + 15.273682, + -8.096931, + 0.000000 + ], + "stereoLabel": "abs" + }, + { + "label": "O", + "location": [ + 16.187220, + -7.690222, + 0.000000 + ] + }, + { + "label": "C", + "location": [ + 16.856388, + -8.433364, + 0.000000 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 16.356394, + -9.299379, + 0.000000 + ] + }, + { + "label": "C", + "location": [ + 15.378230, + -9.091434, + 0.000000 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 14.407657, + -7.596931, + 0.000000 + ] + }, + { + "label": "N", + "location": [ + 17.850908, + -8.328821, + 0.000000 + ] + }, + { + "label": "O", + "location": [ + 14.407657, + -6.596931, + 0.000000 + ] + }, + { + "label": "H", + "location": [ + 13.541631, + -6.096931, + 0.000000 + ] + }, + { + "label": "O", + "location": [ + 14.635082, + -9.760561, + 0.000000 + ] + }, + { + "label": "P", + "location": [ + 13.684028, + -9.451541, + 0.000000 + ] + }, + { + "label": "O", + "location": [ + 12.940880, + -10.120668, + 0.000000 + ] + }, + { + "label": "O", + "location": [ + 13.476119, + -8.473392, + 0.000000 + ] + }, + { + "label": "O", + "location": [ + 13.891935, + -10.429688, + 0.000000 + ] + }, + { + "label": "C", + "location": [ + 19.348570, + -7.462246, + 0.000000 + ] + }, + { + "label": "C", + "location": [ + 18.350935, + -7.461986, + 0.000000 + ] + }, + { + "label": "C", + "location": [ + 19.849623, + -8.328752, + 0.000000 + ] + }, + { + "label": "C", + "location": [ + 18.353966, + -9.198792, + 0.000000 + ] + }, + { + "label": "N", + "location": [ + 19.354019, + -9.192330, + 0.000000 + ] + }, + { + "label": "O", + "location": [ + 20.849623, + -8.327120, + 0.000000 + ] + }, + { + "label": "O", + "location": [ + 17.857058, + -10.066595, + 0.000000 + ] + }, + { + "label": "Br", + "location": [ + 19.848392, + -6.596118, + 0.000000 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 5 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 2, + 6 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 9 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 9, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 10, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 10, + 12 + ] + }, + { + "type": 2, + "atoms": [ + 10, + 13 + ] + }, + { + "type": 1, + "atoms": [ + 15, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 17 + ] + }, + { + "type": 1, + "atoms": [ + 17, + 18 + ] + }, + { + "type": 1, + "atoms": [ + 18, + 16 + ] + }, + { + "type": 1, + "atoms": [ + 16, + 14 + ] + }, + { + "type": 2, + "atoms": [ + 14, + 15 + ] + }, + { + "type": 2, + "atoms": [ + 16, + 19 + ] + }, + { + "type": 2, + "atoms": [ + 17, + 20 + ] + }, + { + "type": 1, + "atoms": [ + 14, + 21 + ] + } + ] + } +} \ No newline at end of file diff --git a/api/tests/integration/tests/formats/ref/monomer_library.ket b/api/tests/integration/tests/formats/ref/monomer_library.ket index 0ca4748b30..5fd784fcce 100644 --- a/api/tests/integration/tests/formats/ref/monomer_library.ket +++ b/api/tests/integration/tests/formats/ref/monomer_library.ket @@ -2242,7 +2242,10 @@ "$ref": "monomerGroupTemplate-dR(U)P" }, { - "$ref": "monomerTemplate-UNSPLIT" + "$ref": "monomerTemplate-UNSPLIT" + }, + { + "$ref": "monomerTemplate-5Br-dU___5-Bromo-deoxyuridine" } ] }, @@ -45013,10 +45016,10 @@ "fullName": "Dipropanol-disulfide", "alias": "SS3", "idtAliases": { - "base": "ThioMC3-D", - "modifications": { - "endpoint3": "3ThioMC3-D" - } + "base": "ThioMC3-D", + "modifications": { + "endpoint3": "3ThioMC3-D" + } }, "attachmentPoints": [ { @@ -170442,636 +170445,1019 @@ ] }, "monomerTemplate-UNSPLIT": { - "type": "monomerTemplate", - "id": "UNSPLIT", - "class": "DNA", - "classHELM": "RNA", - "alias": "UNSPLIT", - "name": "UNSPLIT", - "naturalAnalogShort": "dThy", - "naturalAnalog": "dThy", - "idtAliases": { - "base": "UNSPLIT" - }, - "attachmentPoints": [ - { - "attachmentAtom": 1, - "leavingGroup": { - "atoms": [ - 0 - ] - } - }, - { - "attachmentAtom": 4, - "leavingGroup": { - "atoms": [ - 6 - ] - } - } - ], - "atoms": [ - { - "label": "H", - "location": [ - -11.6943998336792, - -6.12470006942749, - 0 - ] - }, - { - "label": "O", - "location": [ - -10.494400024414063, - -6.125, - 0 - ] - }, - { - "label": "C", - "location": [ - -9.742799758911133, - -4.825900077819824, - 0 - ] - }, - { - "label": "C", - "location": [ - -8.241999626159668, - -4.826399803161621, - 0 - ] - }, - { - "label": "O", - "location": [ - -7.489699840545654, - -6.125, - 0 - ] - }, - { - "label": "C", - "location": [ - -7.4903998374938969, - -3.5272998809814455, - 0 - ] - }, - { - "label": "H", - "location": [ - -6.289700031280518, - -6.124000072479248, - 0 - ] - }, - { - "label": "C", - "location": [ - -5.98960018157959, - -3.527600049972534, - 0 - ] - }, - { - "label": "C", - "location": [ - -5.23799991607666, - -2.228600025177002, - 0 - ] - }, - { - "label": "C", - "location": [ - -3.7372000217437746, - -2.2288999557495119, - 0 - ] - }, - { - "label": "N", - "location": [ - -2.985599994659424, - -0.9297999739646912, - 0 - ] - }, - { - "label": "C", - "location": [ - -1.4847999811172486, - -0.9302999973297119, - 0 - ] - }, - { - "label": "C", - "location": [ - -0.733299970626831, - 0.36890000104904177, - 0 - ] - }, - { - "label": "O", - "location": [ - -0.8853999972343445, - -1.9697999954223633, - 0 - ] - }, - { - "label": "C", - "location": [ - 1.5152000188827515, - 1.6705000400543213, - 0 - ] - }, - { - "label": "C", - "location": [ - 0.766700029373169, - 0.37059998512268069, - 0 - ] - }, - { - "label": "C", - "location": [ - -1.4847999811172486, - 1.6670000553131104, - 0 - ] - }, - { - "label": "C", - "location": [ - -0.736299991607666, - 2.966900110244751, - 0 - ] - }, - { - "label": "C", - "location": [ - 0.763700008392334, - 2.968600034713745, - 0 - ] - }, - { - "label": "O", - "location": [ - 3.136399984359741, - 3.475600004196167, - 0 - ] - }, - { - "label": "C", - "location": [ - 2.9814000129699709, - 1.9837000370025635, - 0 - ] - }, - { - "label": "C", - "location": [ - 1.7654000520706177, - 4.084099769592285, - 0 - ] - }, - { - "label": "O", - "location": [ - 1.5144000053405762, - 5.257599830627441, - 0 - ] - }, - { - "label": "O", - "location": [ - 6.018400192260742, - 1.424299955368042, - 0 - ] - }, - { - "label": "C", - "location": [ - 5.045499801635742, - 0.2825999855995178, - 0 - ] - }, - { - "label": "C", - "location": [ - 3.5703001022338869, - 0.5543000102043152, - 0 - ] - }, - { - "label": "C", - "location": [ - 4.040999889373779, - 3.1094000339508058, - 0 - ] - }, - { - "label": "C", - "location": [ - 5.516200065612793, - 2.8376998901367189, - 0 - ] - }, - { - "label": "C", - "location": [ - 6.48859977722168, - 3.9793999195098879, - 0 - ] - }, - { - "label": "C", - "location": [ - 3.538300037384033, - 4.522900104522705, - 0 - ] - }, - { - "label": "C", - "location": [ - 4.511199951171875, - 5.664599895477295, - 0 - ] - }, - { - "label": "C", - "location": [ - 5.986400127410889, - 5.3927998542785648, - 0 - ] - }, - { - "label": "C", - "location": [ - 5.547399997711182, - -1.1306999921798707, - 0 - ] - }, - { - "label": "C", - "location": [ - 4.57450008392334, - -2.27239990234375, - 0 - ] - }, - { - "label": "C", - "location": [ - 3.099299907684326, - -2.000699996948242, - 0 - ] - }, - { - "label": "C", - "location": [ - 2.597100019454956, - -0.5873000025749207, - 0 - ] - }, - { - "label": "O", - "location": [ - 6.764699935913086, - 6.306099891662598, - 0 - ] - }, - { - "label": "O", - "location": [ - 4.97629976272583, - -3.4031999111175539, - 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": [ - 3, - 5 - ] - }, - { - "type": 1, - "atoms": [ - 4, - 6 - ] - }, - { - "type": 1, - "atoms": [ - 5, - 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": 2, - "atoms": [ - 11, - 13 - ] - }, - { - "type": 2, - "atoms": [ - 15, - 12 - ] - }, - { - "type": 1, - "atoms": [ - 12, - 16 - ] - }, - { - "type": 1, - "atoms": [ - 14, - 15 - ] - }, - { - "type": 2, - "atoms": [ - 16, - 17 - ] - }, - { - "type": 1, - "atoms": [ - 17, - 18 - ] - }, - { - "type": 1, - "atoms": [ - 18, - 21 - ] - }, - { - "type": 2, - "atoms": [ - 14, - 18 - ] - }, - { - "type": 1, - "atoms": [ - 20, - 14 - ] - }, - { - "type": 1, - "atoms": [ - 19, - 20 - ] - }, - { - "type": 1, - "atoms": [ - 19, - 21 - ] - }, - { - "type": 2, - "atoms": [ - 21, - 22 - ] - }, - { - "type": 1, - "atoms": [ - 25, - 20 - ] - }, - { - "type": 1, - "atoms": [ - 20, - 26 - ] - }, - { - "type": 1, - "atoms": [ - 23, - 24 - ] - }, - { - "type": 1, - "atoms": [ - 23, - 27 - ] - }, - { - "type": 2, - "atoms": [ - 26, - 29 - ] - }, - { - "type": 1, - "atoms": [ - 27, - 26 - ] - }, - { - "type": 2, - "atoms": [ - 28, - 27 - ] - }, - { - "type": 1, - "atoms": [ - 29, - 30 - ] - }, - { - "type": 2, - "atoms": [ - 30, - 31 - ] - }, - { - "type": 1, - "atoms": [ - 28, - 31 - ] - }, - { - "type": 2, - "atoms": [ - 32, - 24 - ] - }, - { - "type": 1, - "atoms": [ - 25, - 24 - ] - }, - { - "type": 2, - "atoms": [ - 35, - 25 - ] - }, - { - "type": 1, - "atoms": [ - 32, - 33 - ] - }, - { - "type": 2, - "atoms": [ - 33, - 34 - ] - }, - { - "type": 1, - "atoms": [ - 34, - 35 - ] - }, - { - "type": 1, - "atoms": [ - 31, - 36 - ] - }, - { - "type": 1, - "atoms": [ - 33, - 37 - ] - } - ] + "type": "monomerTemplate", + "id": "UNSPLIT", + "class": "DNA", + "classHELM": "RNA", + "alias": "UNSPLIT", + "name": "UNSPLIT", + "naturalAnalogShort": "dThy", + "naturalAnalog": "dThy", + "idtAliases": { + "base": "UNSPLIT" + }, + "attachmentPoints": [ + { + "attachmentAtom": 1, + "leavingGroup": { + "atoms": [ + 0 + ] + } + }, + { + "attachmentAtom": 4, + "leavingGroup": { + "atoms": [ + 6 + ] + } + } + ], + "atoms": [ + { + "label": "H", + "location": [ + -11.6943998336792, + -6.12470006942749, + 0 + ] + }, + { + "label": "O", + "location": [ + -10.494400024414063, + -6.125, + 0 + ] + }, + { + "label": "C", + "location": [ + -9.742799758911133, + -4.825900077819824, + 0 + ] + }, + { + "label": "C", + "location": [ + -8.241999626159668, + -4.826399803161621, + 0 + ] + }, + { + "label": "O", + "location": [ + -7.489699840545654, + -6.125, + 0 + ] + }, + { + "label": "C", + "location": [ + -7.4903998374938969, + -3.5272998809814455, + 0 + ] + }, + { + "label": "H", + "location": [ + -6.289700031280518, + -6.124000072479248, + 0 + ] + }, + { + "label": "C", + "location": [ + -5.98960018157959, + -3.527600049972534, + 0 + ] + }, + { + "label": "C", + "location": [ + -5.23799991607666, + -2.228600025177002, + 0 + ] + }, + { + "label": "C", + "location": [ + -3.7372000217437746, + -2.2288999557495119, + 0 + ] + }, + { + "label": "N", + "location": [ + -2.985599994659424, + -0.9297999739646912, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.4847999811172486, + -0.9302999973297119, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.733299970626831, + 0.36890000104904177, + 0 + ] + }, + { + "label": "O", + "location": [ + -0.8853999972343445, + -1.9697999954223633, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.5152000188827515, + 1.6705000400543213, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.766700029373169, + 0.37059998512268069, + 0 + ] + }, + { + "label": "C", + "location": [ + -1.4847999811172486, + 1.6670000553131104, + 0 + ] + }, + { + "label": "C", + "location": [ + -0.736299991607666, + 2.966900110244751, + 0 + ] + }, + { + "label": "C", + "location": [ + 0.763700008392334, + 2.968600034713745, + 0 + ] + }, + { + "label": "O", + "location": [ + 3.136399984359741, + 3.475600004196167, + 0 + ] + }, + { + "label": "C", + "location": [ + 2.9814000129699709, + 1.9837000370025635, + 0 + ] + }, + { + "label": "C", + "location": [ + 1.7654000520706177, + 4.084099769592285, + 0 + ] + }, + { + "label": "O", + "location": [ + 1.5144000053405762, + 5.257599830627441, + 0 + ] + }, + { + "label": "O", + "location": [ + 6.018400192260742, + 1.424299955368042, + 0 + ] + }, + { + "label": "C", + "location": [ + 5.045499801635742, + 0.2825999855995178, + 0 + ] + }, + { + "label": "C", + "location": [ + 3.5703001022338869, + 0.5543000102043152, + 0 + ] + }, + { + "label": "C", + "location": [ + 4.040999889373779, + 3.1094000339508058, + 0 + ] + }, + { + "label": "C", + "location": [ + 5.516200065612793, + 2.8376998901367189, + 0 + ] + }, + { + "label": "C", + "location": [ + 6.48859977722168, + 3.9793999195098879, + 0 + ] + }, + { + "label": "C", + "location": [ + 3.538300037384033, + 4.522900104522705, + 0 + ] + }, + { + "label": "C", + "location": [ + 4.511199951171875, + 5.664599895477295, + 0 + ] + }, + { + "label": "C", + "location": [ + 5.986400127410889, + 5.3927998542785648, + 0 + ] + }, + { + "label": "C", + "location": [ + 5.547399997711182, + -1.1306999921798707, + 0 + ] + }, + { + "label": "C", + "location": [ + 4.57450008392334, + -2.27239990234375, + 0 + ] + }, + { + "label": "C", + "location": [ + 3.099299907684326, + -2.000699996948242, + 0 + ] + }, + { + "label": "C", + "location": [ + 2.597100019454956, + -0.5873000025749207, + 0 + ] + }, + { + "label": "O", + "location": [ + 6.764699935913086, + 6.306099891662598, + 0 + ] + }, + { + "label": "O", + "location": [ + 4.97629976272583, + -3.4031999111175539, + 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": [ + 3, + 5 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 5, + 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": 2, + "atoms": [ + 11, + 13 + ] + }, + { + "type": 2, + "atoms": [ + 15, + 12 + ] + }, + { + "type": 1, + "atoms": [ + 12, + 16 + ] + }, + { + "type": 1, + "atoms": [ + 14, + 15 + ] + }, + { + "type": 2, + "atoms": [ + 16, + 17 + ] + }, + { + "type": 1, + "atoms": [ + 17, + 18 + ] + }, + { + "type": 1, + "atoms": [ + 18, + 21 + ] + }, + { + "type": 2, + "atoms": [ + 14, + 18 + ] + }, + { + "type": 1, + "atoms": [ + 20, + 14 + ] + }, + { + "type": 1, + "atoms": [ + 19, + 20 + ] + }, + { + "type": 1, + "atoms": [ + 19, + 21 + ] + }, + { + "type": 2, + "atoms": [ + 21, + 22 + ] + }, + { + "type": 1, + "atoms": [ + 25, + 20 + ] + }, + { + "type": 1, + "atoms": [ + 20, + 26 + ] + }, + { + "type": 1, + "atoms": [ + 23, + 24 + ] + }, + { + "type": 1, + "atoms": [ + 23, + 27 + ] + }, + { + "type": 2, + "atoms": [ + 26, + 29 + ] + }, + { + "type": 1, + "atoms": [ + 27, + 26 + ] + }, + { + "type": 2, + "atoms": [ + 28, + 27 + ] + }, + { + "type": 1, + "atoms": [ + 29, + 30 + ] + }, + { + "type": 2, + "atoms": [ + 30, + 31 + ] + }, + { + "type": 1, + "atoms": [ + 28, + 31 + ] + }, + { + "type": 2, + "atoms": [ + 32, + 24 + ] + }, + { + "type": 1, + "atoms": [ + 25, + 24 + ] + }, + { + "type": 2, + "atoms": [ + 35, + 25 + ] + }, + { + "type": 1, + "atoms": [ + 32, + 33 + ] + }, + { + "type": 2, + "atoms": [ + 33, + 34 + ] + }, + { + "type": 1, + "atoms": [ + 34, + 35 + ] + }, + { + "type": 1, + "atoms": [ + 31, + 36 + ] + }, + { + "type": 1, + "atoms": [ + 33, + 37 + ] + } + ] + }, + "monomerTemplate-5Br-dU___5-Bromo-deoxyuridine": { + "type": "monomerTemplate", + "id": "5Br-dU___5-Bromo-deoxyuridine", + "fullName": "5-Bromo-deoxyuridine", + "alias": "5Br-dU", + "naturalAnalogShort": "U", + "class": "RNA", + "classHELM": "RNA", + "idtAliases": { + "base": "5Br-dU", + "modifications": { + "endpoint5": "55Br-dU", + "internal": "i5Br-dU" + } + }, + "atoms": [ + { + "label": "C", + "location": [ + 15.27368166456315, + -8.096931197906855, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "O", + "location": [ + 16.187220060139033, + -7.690221693402063, + 0 + ] + }, + { + "label": "C", + "location": [ + 16.856388517475764, + -8.433364320969021, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 16.356394722265833, + -9.299378977741815, + 0 + ] + }, + { + "label": "C", + "location": [ + 15.378230099489361, + -9.091433408060443, + 0 + ], + "stereoLabel": "abs" + }, + { + "label": "C", + "location": [ + 14.40765626077871, + -7.596931197906856, + 0 + ] + }, + { + "label": "N", + "location": [ + 17.850908865779402, + -8.328821139412243, + 0 + ] + }, + { + "label": "O", + "location": [ + 14.40765626077871, + -6.596931197906856, + 0 + ] + }, + { + "label": "H", + "location": [ + 13.54163085699427, + -6.096931197906856, + 0 + ] + }, + { + "label": "O", + "location": [ + 14.635082705075886, + -9.760561161315726, + 0 + ] + }, + { + "label": "P", + "location": [ + 13.684027375172867, + -9.451540515625085, + 0 + ] + }, + { + "label": "O", + "location": [ + 12.940879980759393, + -10.120668268880369, + 0 + ] + }, + { + "label": "O", + "location": [ + 13.476119439683323, + -8.473392116679161, + 0 + ] + }, + { + "label": "O", + "location": [ + 13.891935310662411, + -10.42968891457101, + 0 + ] + }, + { + "label": "C", + "location": [ + 19.348570784225796, + -7.4622457118045205, + 0 + ] + }, + { + "label": "C", + "location": [ + 18.350934727894703, + -7.461985668540121, + 0 + ] + }, + { + "label": "C", + "location": [ + 19.849623318679498, + -8.328751871016399, + 0 + ] + }, + { + "label": "C", + "location": [ + 18.353965124619553, + -9.19879248321622, + 0 + ] + }, + { + "label": "N", + "location": [ + 19.35401911367669, + -9.192329962483955, + 0 + ] + }, + { + "label": "O", + "location": [ + 20.849621986216285, + -8.327119411323263, + 0 + ] + }, + { + "label": "O", + "location": [ + 17.85705680132365, + -10.066595524372019, + 0 + ] + }, + { + "label": "Br", + "location": [ + 19.848393302483174, + -6.596117863133869, + 0 + ] + } + ], + "bonds": [ + { + "type": 1, + "atoms": [ + 0, + 4 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 3 + ] + }, + { + "type": 1, + "atoms": [ + 3, + 2 + ] + }, + { + "type": 1, + "atoms": [ + 2, + 1 + ] + }, + { + "type": 1, + "atoms": [ + 1, + 0 + ] + }, + { + "type": 1, + "atoms": [ + 0, + 5 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 2, + 6 + ], + "stereo": 1 + }, + { + "type": 1, + "atoms": [ + 5, + 7 + ] + }, + { + "type": 1, + "atoms": [ + 7, + 8 + ] + }, + { + "type": 1, + "atoms": [ + 4, + 9 + ], + "stereo": 6 + }, + { + "type": 1, + "atoms": [ + 9, + 10 + ] + }, + { + "type": 1, + "atoms": [ + 10, + 11 + ] + }, + { + "type": 1, + "atoms": [ + 10, + 12 + ] + }, + { + "type": 2, + "atoms": [ + 10, + 13 + ] + }, + { + "type": 1, + "atoms": [ + 15, + 6 + ] + }, + { + "type": 1, + "atoms": [ + 6, + 17 + ] + }, + { + "type": 1, + "atoms": [ + 17, + 18 + ] + }, + { + "type": 1, + "atoms": [ + 18, + 16 + ] + }, + { + "type": 1, + "atoms": [ + 16, + 14 + ] + }, + { + "type": 2, + "atoms": [ + 14, + 15 + ] + }, + { + "type": 2, + "atoms": [ + 16, + 19 + ] + }, + { + "type": 2, + "atoms": [ + 17, + 20 + ] + }, + { + "type": 1, + "atoms": [ + 14, + 21 + ] + } + ], + "attachmentPoints": [ + { + "attachmentAtom": 7, + "leavingGroup": { + "atoms": [ + 8 + ] + }, + "type": "left" + }, + { + "attachmentAtom": 10, + "leavingGroup": { + "atoms": [ + 11 + ] + }, + "type": "right" + } + ] } } \ No newline at end of file diff --git a/core/indigo-core/molecule/src/sequence_loader.cpp b/core/indigo-core/molecule/src/sequence_loader.cpp index e33dfda732..37c1cde738 100644 --- a/core/indigo-core/molecule/src/sequence_loader.cpp +++ b/core/indigo-core/molecule/src/sequence_loader.cpp @@ -1738,13 +1738,14 @@ void SequenceLoader::loadHELM(KetDocument& document) else // kHELMPolymerTypeRNA { const std::string& phosphate_lib_id = _library.getMonomerTemplateIdByAlias(MonomerClass::Phosphate, std::get<0>(monomer_info)); - if (phosphate_lib_id.size()) + const std::string& nucleotide_id = _library.getMonomerTemplateIdByAlias(MonomerClass::RNA, std::get<0>(monomer_info)); + if (phosphate_lib_id.size() || nucleotide_id.size()) { // add phosphate - auto phosphate_idx = addKetMonomer(document, monomer_info, MonomerClass::Phosphate, pos); - cur_polymer_map->second[monomer_idx] = phosphate_idx; + auto added_idx = addKetMonomer(document, monomer_info, nucleotide_id.size() > 0 ? MonomerClass::RNA : MonomerClass::Phosphate, pos); + cur_polymer_map->second[monomer_idx] = added_idx; if (monomer_idx > 1) - addMonomerConnection(document, phosphate_idx - 1, phosphate_idx); + addMonomerConnection(document, added_idx - 1, added_idx); ch = _scanner.lookNext(); if (ch != '.' && ch != '}') throw Error("Unexpected symbol. Expected '.' or '}' but found '%c'.", ch);