From 816c591ca361bd66a1c85a6b15e1c4700ae00203 Mon Sep 17 00:00:00 2001 From: Bamboo Date: Sat, 24 Aug 2024 02:04:58 +0000 Subject: [PATCH 1/5] [maven-release-plugin] prepare release openchemlib-2024.8.3 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index b21bac15..28b819b7 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ Please follow the naming scheme YEAR.MONTH.RELEASE_NO_OF_MONTH (eg. 2016.4.1 for second release in Apr 2016) --> - 2024.8.3-SNAPSHOT + 2024.8.3 OpenChemLib Open Source Chemistry Library @@ -209,7 +209,7 @@ scm:git:git@github.com:Actelion/openchemlib.git scm:git:git@github.com:Actelion/openchemlib.git https://github.com/Actelion/openchemlib - HEAD + openchemlib-2024.8.3 From 56efaf9b4e5615be66453f769802b53e9d67851e Mon Sep 17 00:00:00 2001 From: Bamboo Date: Sat, 24 Aug 2024 02:05:02 +0000 Subject: [PATCH 2/5] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 28b819b7..e0723b4d 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ Please follow the naming scheme YEAR.MONTH.RELEASE_NO_OF_MONTH (eg. 2016.4.1 for second release in Apr 2016) --> - 2024.8.3 + 2024.8.4-SNAPSHOT OpenChemLib Open Source Chemistry Library @@ -209,7 +209,7 @@ scm:git:git@github.com:Actelion/openchemlib.git scm:git:git@github.com:Actelion/openchemlib.git https://github.com/Actelion/openchemlib - openchemlib-2024.8.3 + HEAD From 8f42cb3b2dedd9053817baf422567fbd8f931de8 Mon Sep 17 00:00:00 2001 From: Bamboo Date: Sat, 31 Aug 2024 02:05:04 +0000 Subject: [PATCH 3/5] [maven-release-plugin] prepare release openchemlib-2024.8.4 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e0723b4d..515f0e2a 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ Please follow the naming scheme YEAR.MONTH.RELEASE_NO_OF_MONTH (eg. 2016.4.1 for second release in Apr 2016) --> - 2024.8.4-SNAPSHOT + 2024.8.4 OpenChemLib Open Source Chemistry Library @@ -209,7 +209,7 @@ scm:git:git@github.com:Actelion/openchemlib.git scm:git:git@github.com:Actelion/openchemlib.git https://github.com/Actelion/openchemlib - HEAD + openchemlib-2024.8.4 From 4da398ebfc3ee1c5442bbb560b2bd94d81d725b8 Mon Sep 17 00:00:00 2001 From: Bamboo Date: Sat, 31 Aug 2024 02:05:08 +0000 Subject: [PATCH 4/5] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 515f0e2a..596bc8e6 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ Please follow the naming scheme YEAR.MONTH.RELEASE_NO_OF_MONTH (eg. 2016.4.1 for second release in Apr 2016) --> - 2024.8.4 + 2024.8.5-SNAPSHOT OpenChemLib Open Source Chemistry Library @@ -209,7 +209,7 @@ scm:git:git@github.com:Actelion/openchemlib.git scm:git:git@github.com:Actelion/openchemlib.git https://github.com/Actelion/openchemlib - openchemlib-2024.8.4 + HEAD From f60b78d7fc68a7efe1808c55f9740020b752cb1f Mon Sep 17 00:00:00 2001 From: korffmo Date: Tue, 3 Sep 2024 10:23:46 +0200 Subject: [PATCH 5/5] Added: exhaustive three synthons search. Log file in table format. --- .../research/calc/ArrayUtilsCalc.java | 13 +++-- .../research/calc/histogram/Histogram.java | 11 +++- .../descriptor/flexophore/MolDistHistViz.java | 8 +++ ...ctiveBlurFlexophoreHardMatchUncovered.java | 5 +- .../generator/CreatorMolDistHistViz.java | 51 +++++++++++++++++++ 5 files changed, 83 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/actelion/research/calc/ArrayUtilsCalc.java b/src/main/java/com/actelion/research/calc/ArrayUtilsCalc.java index 3ed8a156..9c5929d2 100644 --- a/src/main/java/com/actelion/research/calc/ArrayUtilsCalc.java +++ b/src/main/java/com/actelion/research/calc/ArrayUtilsCalc.java @@ -57,15 +57,12 @@ public class ArrayUtilsCalc { public final static int [] cat(int [] a, int [] b) { int [] c = new int [a.length + b.length]; - for (int i = 0; i < a.length; i++) { c[i]=a[i]; } - for (int i = 0; i < b.length; i++) { c[a.length+i]=b[i]; } - return c; } @@ -80,6 +77,16 @@ public final static boolean contains(int [] a, int b) { } return bFound; } + public final static boolean containsAll(int [] a, int [] b) { + boolean bFound = true; + for (int i = 0; i < b.length; i++) { + if(!contains(a, b[i])){ + bFound=false; + break; + } + } + return bFound; + } public final static int [] copy(int [] a) { int [] b = new int [a.length]; diff --git a/src/main/java/com/actelion/research/calc/histogram/Histogram.java b/src/main/java/com/actelion/research/calc/histogram/Histogram.java index 7feef388..a45ede76 100644 --- a/src/main/java/com/actelion/research/calc/histogram/Histogram.java +++ b/src/main/java/com/actelion/research/calc/histogram/Histogram.java @@ -38,6 +38,7 @@ import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.text.NumberFormat; +import java.util.Collection; import java.util.Locale; import java.util.Random; @@ -83,6 +84,15 @@ public Histogram(double [] arrRaw, double min, double max, int bins) { initialize(arrRaw,min,max,bins); } + public Histogram(Collection values, double min, double max, int bins) { + double [] v = new double[values.size()]; + int c=0; + for (Double value : values) { + v[c++]=value; + } + initialize(v,min,max,bins); + } + public Histogram(double [] arrRaw, int bins) { double max = -Double.MAX_VALUE; @@ -96,7 +106,6 @@ public Histogram(double [] arrRaw, int bins) { min=v; } } - initialize(arrRaw,min,max,bins); } diff --git a/src/main/java/com/actelion/research/chem/descriptor/flexophore/MolDistHistViz.java b/src/main/java/com/actelion/research/chem/descriptor/flexophore/MolDistHistViz.java index 2b2ac116..202064e7 100644 --- a/src/main/java/com/actelion/research/chem/descriptor/flexophore/MolDistHistViz.java +++ b/src/main/java/com/actelion/research/chem/descriptor/flexophore/MolDistHistViz.java @@ -176,6 +176,14 @@ public void setNodeWeight(int indexNode, double weight){ } arrWeight[indexNode]=weight; } + public void resetNodeWeights(){ + if(!finalized){ + throw new RuntimeException("MolDistHistViz not finalized!"); + } + for (int i = 0; i < liPPNodeViz.size(); i++) { + arrWeight[i]=1; + } + } public void removeInevitablePharmacophorePoint(int indexPPNode){ hsIndexMandatoryPPPoints.remove(indexPPNode); diff --git a/src/main/java/com/actelion/research/chem/descriptor/flexophore/completegraphmatcher/ObjectiveBlurFlexophoreHardMatchUncovered.java b/src/main/java/com/actelion/research/chem/descriptor/flexophore/completegraphmatcher/ObjectiveBlurFlexophoreHardMatchUncovered.java index c65a6751..b006f40a 100644 --- a/src/main/java/com/actelion/research/chem/descriptor/flexophore/completegraphmatcher/ObjectiveBlurFlexophoreHardMatchUncovered.java +++ b/src/main/java/com/actelion/research/chem/descriptor/flexophore/completegraphmatcher/ObjectiveBlurFlexophoreHardMatchUncovered.java @@ -43,7 +43,10 @@ public class ObjectiveBlurFlexophoreHardMatchUncovered implements IObjectiveComp // 03.03.2016 Top result so far for 0.9 // 13.04.2020 Maybe obsolete // ToDo - final static double THRESH_NODE_SIMILARITY_START = 0.5; + // final static double THRESH_NODE_SIMILARITY_START = 0.5; + + // Changed to 0.9 21.08.2024 MvK + final static double THRESH_NODE_SIMILARITY_START = 0.9; private static final float INIT_VAL = -1; diff --git a/src/main/java/com/actelion/research/chem/descriptor/flexophore/generator/CreatorMolDistHistViz.java b/src/main/java/com/actelion/research/chem/descriptor/flexophore/generator/CreatorMolDistHistViz.java index 5a35d8c5..ff84f486 100644 --- a/src/main/java/com/actelion/research/chem/descriptor/flexophore/generator/CreatorMolDistHistViz.java +++ b/src/main/java/com/actelion/research/chem/descriptor/flexophore/generator/CreatorMolDistHistViz.java @@ -34,6 +34,7 @@ package com.actelion.research.chem.descriptor.flexophore.generator; +import com.actelion.research.calc.ArrayUtilsCalc; import com.actelion.research.calc.ThreadMaster; import com.actelion.research.chem.*; import com.actelion.research.chem.descriptor.DescriptorHandlerFlexophore; @@ -41,6 +42,7 @@ import com.actelion.research.chem.descriptor.flexophore.redgraph.SubGraphExtractor; import com.actelion.research.chem.descriptor.flexophore.redgraph.SubGraphIndices; import com.actelion.research.chem.interactionstatistics.InteractionAtomTypeCalculator; +import com.actelion.research.util.StringFunctions; import java.util.*; @@ -422,12 +424,61 @@ public static MolDistHistViz create(List liMultCoordFragInde return molDistHistViz; + } + + public void addFlexophoreDistanceHistograms(MolDistHistViz mdhv){ + Molecule3D molecule = mdhv.getMolecule(); + + List liMultCoordFragIndex = new ArrayList<>(); + for (PPNodeViz node : mdhv.getNodes()) { + liMultCoordFragIndex.add(new MultCoordFragIndex(node.getArrayIndexOriginalAtoms())); + } + conformerGeneratorStageTries.setMolecule(molecule); + int ccConformationsGenerated=0; + for (int i = 0; i < DescriptorHandlerFlexophore.NUM_CONFORMATIONS; i++) { + boolean conformerGenerated = false; + try { + conformerGenerated = conformerGeneratorStageTries.generateConformerAndSetCoordinates(molecule.getAtoms(), molecule); + } catch (ExceptionTimeOutConformerGeneration e) { + System.err.println( + "CreatorMolDistHistViz: ExceptionTimeOutConformerGeneration for idcode " + molecule.getIDCode( )+ ", hence generated " + ccConformationsGenerated + " conformers."); + // e.printStackTrace(); + break; + } + + if(!conformerGenerated){ + break; + } + ccConformationsGenerated++; + calcFragmentCenter(molecule, liMultCoordFragIndex); + + } + + for (int i = 0; i < liMultCoordFragIndex.size(); i++) { + for (int j = i+1; j < liMultCoordFragIndex.size(); j++) { + byte [] arrDistHist = MultCoordFragIndex.getDistHist(liMultCoordFragIndex.get(i), liMultCoordFragIndex.get(j)); + // System.out.println(StringFunctions.toString(arrDistHist)); + mdhv.setDistHist(i,j,arrDistHist); + } + } + } public MolDistHistViz createWithoutCoordinates(Molecule3D molecule3D){ InteractionAtomTypeCalculator.setInteractionTypes(molecule3D); List sgis = getSubGraphIndices(molecule3D); return createWithoutCoordinates(sgis, molecule3D); } + public MolDistHistViz createWithoutCoordinates(Molecule3D molecule3D, int [] indices2consider){ + InteractionAtomTypeCalculator.setInteractionTypes(molecule3D); + List sgis = getSubGraphIndices(molecule3D); + List sgis2consider = new ArrayList<>(); + for (SubGraphIndices sgi : sgis) { + if(ArrayUtilsCalc.containsAll(indices2consider, sgi.getAtomIndices())) { + sgis2consider.add(sgi); + } + } + return createWithoutCoordinates(sgis2consider, molecule3D); + } public static MolDistHistViz createWithoutCoordinates(List liMultCoordFragIndex, Molecule3D molecule3D){