From ddc13c5be7236ce86697f8ec79db862dd905a7af Mon Sep 17 00:00:00 2001 From: korffmo Date: Fri, 26 Jan 2024 15:15:11 +0100 Subject: [PATCH] introduced empty PPNode node --- .../research/chem/descriptor/flexophore/MolDistHist.java | 2 +- .../chem/descriptor/flexophore/MolDistHistHelper.java | 2 -- .../research/chem/descriptor/flexophore/PPNode.java | 6 +++++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/actelion/research/chem/descriptor/flexophore/MolDistHist.java b/src/main/java/com/actelion/research/chem/descriptor/flexophore/MolDistHist.java index 3ebb449f..6350d58c 100644 --- a/src/main/java/com/actelion/research/chem/descriptor/flexophore/MolDistHist.java +++ b/src/main/java/com/actelion/research/chem/descriptor/flexophore/MolDistHist.java @@ -505,7 +505,7 @@ public static List readNodes(String strMolDistHist){ } public static MolDistHist readNodes2MDH(String strMolDistHist){ - List liPPNode = readNodes( strMolDistHist); + List liPPNode = readNodes(strMolDistHist); int size = liPPNode.size(); MolDistHist mdh = new MolDistHist(size); for (PPNode ppNode : liPPNode) { diff --git a/src/main/java/com/actelion/research/chem/descriptor/flexophore/MolDistHistHelper.java b/src/main/java/com/actelion/research/chem/descriptor/flexophore/MolDistHistHelper.java index a56d098c..e8b980e5 100644 --- a/src/main/java/com/actelion/research/chem/descriptor/flexophore/MolDistHistHelper.java +++ b/src/main/java/com/actelion/research/chem/descriptor/flexophore/MolDistHistHelper.java @@ -85,8 +85,6 @@ public static MolDistHist assembleNoDistHist (MolDistHist ... arr){ mdh.addNode(arr[i].getNode(j)); } } - - return mdh; } public static boolean isZero(byte [] b){ diff --git a/src/main/java/com/actelion/research/chem/descriptor/flexophore/PPNode.java b/src/main/java/com/actelion/research/chem/descriptor/flexophore/PPNode.java index 4d463fd8..8c703aab 100644 --- a/src/main/java/com/actelion/research/chem/descriptor/flexophore/PPNode.java +++ b/src/main/java/com/actelion/research/chem/descriptor/flexophore/PPNode.java @@ -613,10 +613,14 @@ public String toStringLongHardPPPoint(){ /** * * @param strNode i.e. 262,392,4358*2,8582,590088,598407 - * @return + * @return the node with the atom types. If an empty string is given a node without atom types is returned. */ public static PPNode read(String strNode) { + if(strNode.length()==0){ + return new PPNode(); + } + String [] arr = strNode.split(SEPARATOR_ATOMS); PPNode n = new PPNode();