From 49dabe0d504bcbdd6ae56eaac942c2b9e90e7cf1 Mon Sep 17 00:00:00 2001 From: Woosub-Kim Date: Thu, 4 Jan 2024 19:47:13 +0900 Subject: [PATCH] scorecomplex many against many bug fixed real final --- src/strucclustutils/scorecomplex.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/strucclustutils/scorecomplex.cpp b/src/strucclustutils/scorecomplex.cpp index 09520513..46622159 100644 --- a/src/strucclustutils/scorecomplex.cpp +++ b/src/strucclustutils/scorecomplex.cpp @@ -301,7 +301,7 @@ class DBSCANCluster { unsigned int clusterAlns() { initializeAlnLabels(); - if (recursiveNum==0 && searchResult.alnVec.size() == idealClusterSize) { + if (recursiveNum==0 && searchResult.alnVec.size() <= idealClusterSize) { checkClusteringNecessity(); } if (++recursiveNum > MAX_RECURSIVE_NUM) return UNCLUSTERED; @@ -424,7 +424,7 @@ class DBSCANCluster { unsigned int finishDBSCAN() { initializeAlnLabels(); - if (prevMaxClusterSize < minClusterSize) return UNCLUSTERED; + if (prevMaxClusterSize < minClusterSize || bestClusters.empty()) return UNCLUSTERED; cLabel = CLUSTERED; for (auto &cluster: bestClusters) { for (auto alnIdx: cluster) { @@ -442,6 +442,7 @@ class DBSCANCluster { } if (checkChainRedundancy()) return UNCLUSTERED; + prevMaxClusterSize = neighbors.size(); bestClusters.emplace_back(neighbors); return finishDBSCAN(); }