From 3aba754a2171ce71dff2ddd6196c1384b5b2dfb1 Mon Sep 17 00:00:00 2001 From: Fredrik Wallner Date: Fri, 17 Nov 2023 13:20:02 +0100 Subject: [PATCH 1/8] Initial test for 2641 --- test/files/attype.00.smi | 1 + test/files/ringresults.txt | 3 +++ 2 files changed, 4 insertions(+) diff --git a/test/files/attype.00.smi b/test/files/attype.00.smi index c84f4a4c9d..ce74e69367 100644 --- a/test/files/attype.00.smi +++ b/test/files/attype.00.smi @@ -1,3 +1,4 @@ +O1C23C4=C(C=C12)C1=COC(=C4OC3)C1 github_2641 aryl Oc1ccccc1c2nnco2 BIONET_10A-002 aryl CC(=O)c1ccc(cc1)n2ccnc2 BIONET_10A-004 aryl CN(C)/C=C/1\CCNC1=O BIONET_10A-007 hetatm diff --git a/test/files/ringresults.txt b/test/files/ringresults.txt index 82f437e1ce..501dd545af 100644 --- a/test/files/ringresults.txt +++ b/test/files/ringresults.txt @@ -1,3 +1,6 @@ + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 +5 + 1 3 3 2 1 2 2 1 1 2 2 1 1 2 1 2 3 4 5 6 8 9 10 11 12 2 0 1 1 1 1 1 1 1 1 1 1 1 From bf36f555c53dbddadda653071efb30dd4810b47d Mon Sep 17 00:00:00 2001 From: Fredrik Wallner Date: Tue, 21 Nov 2023 16:41:24 +0100 Subject: [PATCH 2/8] Calculate bondsets for all rings when pruning in SSSR --- src/ring.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/ring.cpp b/src/ring.cpp index 7103a03c04..9287cffcfb 100644 --- a/src/ring.cpp +++ b/src/ring.cpp @@ -348,10 +348,24 @@ namespace OpenBabel if (_rlist.size() == (unsigned)frj) return; - //make sure tmp is the same size as the rings + // create bondsets + std::vector _bslist; + std::vector bonds; + OBBitVec bondset; + OBMol *mol = _rlist[0]->GetParent(); + for (j = 0; j < (signed)_rlist.size(); ++j) + { + bondset.Clear(); + bonds = atomRingToBondRing(mol, (_rlist[j])->_path); + for (unsigned int i = 0; i < bonds.size(); ++i) + bondset.SetBitOn(bonds[i]); + _bslist.push_back(bondset); + } + + // make sure tmp is the same size as the rings OBBitVec tmp; - for (j = 0;j < (signed)_rlist.size();++j) - tmp = (_rlist[j])->_pathset; + for (j = 0; j < (signed)_bslist.size(); ++j) + tmp = _bslist[j]; //remove larger rings that cover the same atoms as smaller rings for (i = _rlist.size()-1;i >= 0;i--) @@ -359,11 +373,11 @@ namespace OpenBabel tmp.Clear(); for (j = 0;j < (signed)_rlist.size();++j) if ((_rlist[j])->_path.size() <= (_rlist[i])->_path.size() && i != j) - tmp |= (_rlist[j])->_pathset; + tmp |= _bslist[j]; - tmp = tmp & (_rlist[i])->_pathset; + tmp = tmp & _bslist[i]; - if (tmp == (_rlist[i])->_pathset) + if (tmp == _bslist[i]) { delete _rlist[i]; _rlist.erase(_rlist.begin()+i); From 0da91a35c13fcef913c751b140f7cec699835ca8 Mon Sep 17 00:00:00 2001 From: Fredrik Wallner Date: Wed, 6 Dec 2023 14:43:49 +0100 Subject: [PATCH 3/8] Updated result files for formalcharge, formula and smarts test --- test/files/formalchargeresults.txt | 37 ++++----- test/files/formularesults.txt | 1 + test/files/smartsresults.txt | 120 +++++++++++++++++++++++++++++ 3 files changed, 140 insertions(+), 18 deletions(-) diff --git a/test/files/formalchargeresults.txt b/test/files/formalchargeresults.txt index 1b80089449..a68197625a 100644 --- a/test/files/formalchargeresults.txt +++ b/test/files/formalchargeresults.txt @@ -1,3 +1,4 @@ +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 @@ -26,7 +27,7 @@ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 @@ -263,10 +264,10 @@ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/test/files/formularesults.txt b/test/files/formularesults.txt index 8fc02b84db..d4629032ae 100644 --- a/test/files/formularesults.txt +++ b/test/files/formularesults.txt @@ -1,3 +1,4 @@ +C11H6O3 186.164 186.032 C8H6N2O2 162.145 162.043 C11H10N2O 186.21 186.079 C7H12N2O 140.183 140.095 diff --git a/test/files/smartsresults.txt b/test/files/smartsresults.txt index 3e3ad4f625..115a53a371 100644 --- a/test/files/smartsresults.txt +++ b/test/files/smartsresults.txt @@ -1,4 +1,124 @@ 120 patterns + 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + + 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + + + 1 5 8 9 12 13 14 + 3 4 6 7 10 11 + 2 + 1 2 3 4 6 7 9 10 11 12 + 5 8 + 13 14 + + 5 8 + 5 8 + 13 14 + + 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + + + 7 8 9 10 11 12 13 14 + 1 4 5 + 3 6 + 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + + + + + 1 2 6 + + 2 3 4 5 6 7 8 9 10 11 12 13 14 + 1 2 3 4 5 6 + + + 1 9 12 + + 2 3 4 5 6 7 8 10 11 13 14 + + + 1 9 12 + 3 4 5 6 7 8 10 11 + 2 13 14 + 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + + + 1 5 8 9 12 13 14 + 3 4 6 7 10 11 + + + + + + + + + 2 3 4 5 6 7 8 10 11 13 14 + + 1 9 12 + + + + + 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + + + + + + + + + + 2 3 4 5 6 7 8 10 11 13 14 + 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + 3 4 5 6 7 8 10 11 + + + 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + + + 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + + + + 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + + + + + + 2 3 4 5 6 7 8 10 11 13 14 + + + 1 9 12 + + 1 9 12 + 1 9 12 + 13 14 + 1 9 12 + 1 9 12 + + + + + 3 4 6 7 10 11 + + + + + + + + + + + 1 9 12 + 2 3 4 5 6 7 8 10 11 13 14 + + 1 9 12 + 1 2 3 4 5 6 7 8 9 10 11 12 2 3 4 5 6 7 8 9 10 11 12 1 From 6917413a0f25d65fb49f9d0899e6226bd3440cf4 Mon Sep 17 00:00:00 2001 From: Fredrik Wallner Date: Mon, 11 Mar 2024 14:20:02 +0100 Subject: [PATCH 4/8] Updated canonstable test strings. (One is unstable atm, giving a failed test) --- test/files/canonstable.can | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/files/canonstable.can b/test/files/canonstable.can index d2249f3f61..58ac1eadf7 100644 --- a/test/files/canonstable.can +++ b/test/files/canonstable.can @@ -225,7 +225,7 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00:00:00 2001 From: Fredrik Wallner Date: Mon, 11 Mar 2024 14:24:30 +0100 Subject: [PATCH 5/8] Update results for smartstest --- test/files/smartsresults.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/files/smartsresults.txt b/test/files/smartsresults.txt index 115a53a371..b27e42b338 100644 --- a/test/files/smartsresults.txt +++ b/test/files/smartsresults.txt @@ -18,9 +18,9 @@ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 - 7 8 9 10 11 12 13 14 - 1 4 5 - 3 6 + 1 5 8 9 12 13 + 4 6 7 10 11 14 + 2 3 1 2 3 4 5 6 7 8 9 10 11 12 13 14 @@ -29,7 +29,7 @@ 1 2 6 2 3 4 5 6 7 8 9 10 11 12 13 14 - 1 2 3 4 5 6 + 3 4 7 10 11 14 1 9 12 From c13d725e3d760d9c4a6ec31bdbce94ea1c9d84dd Mon Sep 17 00:00:00 2001 From: Fredrik Wallner Date: Fri, 15 Mar 2024 08:10:36 +0100 Subject: [PATCH 6/8] Revert "Updated canonstable test strings." This reverts commit 6917413a0f25d65fb49f9d0899e6226bd3440cf4. --- test/files/canonstable.can | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/files/canonstable.can b/test/files/canonstable.can index 58ac1eadf7..d2249f3f61 100644 --- a/test/files/canonstable.can +++ b/test/files/canonstable.can @@ -225,7 +225,7 @@ C1Oc2c(O1)cc(cc2)/C=C\c1nc2ccccc2nc1/C=C/c1ccc2c(c1)OCO2 C1[C@@H]2C[C@@H]3[C@@]4([C@H]1C[C@H](C2)C3)OO[C@@]14[C@@H]2C[C@@H]3C[C@H]1C[C@H](C2)C3 C1[C@@H]2C[C@@H]3C[C@H]1C[C@](C2)(C3)/N=C/[C@]12C[C@H]3C[C@@H](C2)C[C@@H](C1)C3 C1[C@@H]2C[C@@H]3C[C@H]1C[C@](C2)(C3)C#C[C@]12C[C@H]3C[C@@H](C2)C[C@@H](C1)C3 -C1[C@H]2C[C@@H]3C[C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C@@H](c1c(=O)oc2c(c1O)cccc2)c1ccccc1.Cl @@ -1838,7 +1838,7 @@ O[C@H](Cc1ccc(cc1)Br)CN1CC[C@H](CC1)c1ccccc1.Cl CN1CCC[C@H]([C@H]1CN[C@]12C[C@H]3C[C@@H](C2)C[C@@H](C1)C3)O.Cl [O-]C(=O)[C-]12C3=C4[Fe+2]5678923(C1=C45)[C-]1(C(=[OH+])O)C6=C8C9=C71.Cl [O-]C(=O)[C-]12C3=C4[Fe+2]5678923(C1=C45)[C-]1(C(=[OH+])O)C6=C8C9=C71.Cl -c1ccc(cc1)CN(C[C@]12C[C@@H]3C[C@H](C1)C[C@H](C2)C3)CCCCCCN(C[C@]12C[C@H]3C[C@@H](C2)C[C@@H](C1)C3)Cc1ccccc1.Cl +C(CCN(C[C@]12C[C@H]3C[C@@H](C2)C[C@@H](C1)C3)Cc1ccccc1)CCCN(C[C@]12C[C@H]3C[C@@H](C2)C[C@@H](C1)C3)Cc1ccccc1.Cl N(=C\[C-]12C3=C4[Fe+2]5678923(C1=C45)[c-]1c6c8c9c71)/Nc1ccc2c(n1)cccc2.Cl N(=C\[C-]12C3=C4[Fe+2]5678923(C1=C45)[c-]1c6c8c9c71)/Nc1ccc2c(n1)cccc2.Cl Cl/C=C/C[N@+]12CN3CN(C2)CN(C1)C3 From c39d73cd44ace3132e59984073fa7f9bdefafd2d Mon Sep 17 00:00:00 2001 From: Fredrik Wallner Date: Fri, 15 Mar 2024 08:15:55 +0100 Subject: [PATCH 7/8] Fix bug in ring pruning in RingSearch --- src/ring.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ring.cpp b/src/ring.cpp index 9287cffcfb..82878f6c77 100644 --- a/src/ring.cpp +++ b/src/ring.cpp @@ -378,10 +378,11 @@ namespace OpenBabel tmp = tmp & _bslist[i]; if (tmp == _bslist[i]) - { - delete _rlist[i]; - _rlist.erase(_rlist.begin()+i); - } + { + delete _rlist[i]; + _rlist.erase(_rlist.begin() + i); + _bslist.erase(_bslist.begin() + i); + } if (_rlist.size() == (unsigned)frj) break; From 69ea2f661dbf9db1d3e49ea2fb6e70628d0e29ee Mon Sep 17 00:00:00 2001 From: Fredrik Wallner Date: Fri, 15 Mar 2024 08:17:23 +0100 Subject: [PATCH 8/8] Added test smile for ringtest and updated the corresponding test files --- test/files/attype.00.smi | 1 + test/files/formalchargeresults.txt | 1 + test/files/formularesults.txt | 1 + test/files/ringresults.txt | 3 + test/files/smartsresults.txt | 120 +++++++++++++++++++++++++++++ 5 files changed, 126 insertions(+) diff --git a/test/files/attype.00.smi b/test/files/attype.00.smi index ce74e69367..809647c8c5 100644 --- a/test/files/attype.00.smi +++ b/test/files/attype.00.smi @@ -1,3 +1,4 @@ +C1[C@@H]2C[C@@H]3C[C@@H]1CC(C2)(C3)Nc1nc(N[C@]23C[C@@H]4C[C@@H](C3)C[C@H](C2)C4)nc(n1)N[C@]12C[C@@H]3C[C@@H](C2)C[C@@H](C1)C3 github_2641_2 O1C23C4=C(C=C12)C1=COC(=C4OC3)C1 github_2641 aryl Oc1ccccc1c2nnco2 BIONET_10A-002 aryl CC(=O)c1ccc(cc1)n2ccnc2 BIONET_10A-004 aryl diff --git a/test/files/formalchargeresults.txt b/test/files/formalchargeresults.txt index a68197625a..2124850ffe 100644 --- a/test/files/formalchargeresults.txt +++ b/test/files/formalchargeresults.txt @@ -1,3 +1,4 @@ +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/test/files/formularesults.txt b/test/files/formularesults.txt index d4629032ae..a6a82fac90 100644 --- a/test/files/formularesults.txt +++ b/test/files/formularesults.txt @@ -1,3 +1,4 @@ +C33H48N6 528.774 528.394 C11H6O3 186.164 186.032 C8H6N2O2 162.145 162.043 C11H10N2O 186.21 186.079 diff --git a/test/files/ringresults.txt b/test/files/ringresults.txt index 501dd545af..13577bfe67 100644 --- a/test/files/ringresults.txt +++ b/test/files/ringresults.txt @@ -1,3 +1,6 @@ + 0 1 2 3 4 5 6 7 8 9 10 11 14 15 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 36 37 38 39 40 41 42 43 44 45 46 47 +10 + 2 2 1 2 2 3 2 2 1 1 0 1 1 1 0 3 2 2 1 2 2 1 2 2 1 1 1 1 0 3 2 2 1 2 2 1 2 2 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 5 1 3 3 2 1 2 2 1 1 2 2 1 1 2 diff --git a/test/files/smartsresults.txt b/test/files/smartsresults.txt index b27e42b338..fbce9d97ef 100644 --- a/test/files/smartsresults.txt +++ b/test/files/smartsresults.txt @@ -1,4 +1,124 @@ 120 patterns + 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 + 12 13 14 26 27 28 + 1 2 3 4 5 6 7 8 9 10 11 15 16 17 18 19 20 21 22 23 24 25 29 30 31 32 33 34 35 36 37 38 39 + + + 1 3 5 7 9 10 11 13 15 17 19 21 22 24 25 26 28 29 31 33 35 36 38 39 + 2 4 6 12 14 18 20 23 27 32 34 37 + 8 16 30 + 8 12 13 14 16 26 27 28 30 + 2 4 6 11 15 18 20 23 29 32 34 37 + 1 3 5 7 9 10 17 19 21 22 24 25 31 33 35 36 38 39 + + 2 4 6 11 15 18 20 23 29 32 34 37 + 2 4 6 11 15 18 20 23 29 32 34 37 + 1 3 5 7 9 10 17 19 21 22 24 25 31 33 35 36 38 39 + + 1 2 3 4 5 6 7 8 9 10 12 13 14 16 17 18 19 20 21 22 23 24 25 26 27 28 30 31 32 33 34 35 36 37 38 39 + 11 15 29 + 11 15 29 + 3 9 10 12 13 14 19 22 25 26 27 28 33 36 39 + 1 2 4 5 7 8 17 18 20 21 23 24 31 32 34 35 37 38 + 6 16 30 + 1 2 3 4 5 6 7 8 9 10 12 13 14 16 17 18 19 20 21 22 23 24 25 26 27 28 30 31 32 33 34 35 36 37 38 39 + 11 15 29 + 11 15 29 + + + + + + 1 2 3 4 5 6 7 8 9 10 12 13 14 16 17 18 19 20 21 22 23 24 25 26 27 28 30 31 32 33 34 35 36 37 38 39 + + + + 11 13 15 26 28 29 + 1 2 3 4 5 6 7 8 9 10 12 14 16 17 18 19 20 21 22 23 24 25 27 30 31 32 33 34 35 36 37 38 39 + + + 13 26 28 + 11 12 14 15 27 29 + 1 2 3 4 5 6 7 8 9 10 16 17 18 19 20 21 22 23 24 25 30 31 32 33 34 35 36 37 38 39 + 1 2 3 4 5 6 7 8 9 10 12 13 14 16 17 18 19 20 21 22 23 24 25 26 27 28 30 31 32 33 34 35 36 37 38 39 + 11 15 29 + + 1 3 5 7 9 10 12 13 14 17 19 21 22 24 25 26 27 28 31 33 35 36 38 39 + 2 4 6 8 16 18 20 23 30 32 34 37 + + + + + + + + + 1 2 3 4 5 6 7 8 9 10 12 14 16 17 18 19 20 21 22 23 24 25 27 30 31 32 33 34 35 36 37 38 39 + 11 13 15 26 28 29 + + + + 2 4 6 16 18 20 23 30 32 34 37 + 2 4 6 16 18 20 23 30 32 34 37 + 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 + + + 12 14 27 + + + + + + + 1 2 3 4 5 6 7 8 9 10 16 17 18 19 20 21 22 23 24 25 30 31 32 33 34 35 36 37 38 39 + 1 2 3 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 23 24 25 27 29 30 31 32 33 34 35 36 37 38 39 + + + 12 13 14 26 27 28 + 1 2 3 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 23 24 25 27 29 30 31 32 33 34 35 36 37 38 39 + 1 2 3 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 23 24 25 27 29 30 31 32 33 34 35 36 37 38 39 + 2 4 6 16 18 20 23 30 32 34 37 + + 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 + 11 15 29 + + + 1 2 3 4 5 6 7 8 9 10 16 17 18 19 20 21 22 23 24 25 30 31 32 33 34 35 36 37 38 39 + + 2 4 6 18 20 23 32 34 37 + 2 4 6 18 20 23 32 34 37 + + + 1 2 3 4 5 6 7 8 9 10 16 17 18 19 20 21 22 23 24 25 30 31 32 33 34 35 36 37 38 39 + 12 14 27 + + + + + + 1 3 5 7 9 10 17 19 21 22 24 25 31 33 35 36 38 39 + 12 13 14 26 27 28 + 12 13 14 26 27 28 + + + + 12 14 27 + 12 14 27 + + + + + + + + + + + + 1 2 3 4 5 6 7 8 9 10 12 14 16 17 18 19 20 21 22 23 24 25 27 30 31 32 33 34 35 36 37 38 39 + + 12 13 14 26 27 28 + 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 2 3 4 5 6 7 8 9 10 11 12 13 14