From 53500dd129b66b5be646df10cd018f5f6d1377b3 Mon Sep 17 00:00:00 2001 From: rdk Date: Wed, 4 Mar 2026 03:55:17 +0100 Subject: [PATCH] Fix SAS point classification stats for explicit-site datasets and improve cluster logging - PocketRescorer: fall back to explicit site residue atoms for point labeling when no ligand atoms are available, fixing 0-positives in binary classification stats for site-based eval-predict - SLinkClustererV2: log cluster count and sizes instead of full contents --- .../cz/siret/prank/geom/clustering/SLinkClustererV2.java | 2 +- .../prank/prediction/pockets/rescorers/PocketRescorer.groovy | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/groovy/cz/siret/prank/geom/clustering/SLinkClustererV2.java b/src/main/groovy/cz/siret/prank/geom/clustering/SLinkClustererV2.java index d1fdcfc3..a8e724b1 100644 --- a/src/main/groovy/cz/siret/prank/geom/clustering/SLinkClustererV2.java +++ b/src/main/groovy/cz/siret/prank/geom/clustering/SLinkClustererV2.java @@ -74,7 +74,7 @@ public class SLinkClustererV2 implements Clusterer { List> result = new ArrayList<>(clusterMap.values()); - log.info("clusters: {}", result); + log.info("clusters ({}): sizes {}", result.size(), result.stream().map(List::size).toList()); log.info("clusters together: {} / {}", result.stream().mapToInt(List::size).sum(), elements.size()); return result; diff --git a/src/main/groovy/cz/siret/prank/prediction/pockets/rescorers/PocketRescorer.groovy b/src/main/groovy/cz/siret/prank/prediction/pockets/rescorers/PocketRescorer.groovy index 46caab88..8d8f1f2a 100644 --- a/src/main/groovy/cz/siret/prank/prediction/pockets/rescorers/PocketRescorer.groovy +++ b/src/main/groovy/cz/siret/prank/prediction/pockets/rescorers/PocketRescorer.groovy @@ -26,6 +26,11 @@ abstract class PocketRescorer implements Parametrized { this.ligandedProtein = liganatedProtein if (liganatedProtein != null) { ligandAtoms = liganatedProtein.allRelevantLigandAtoms + // Fallback: use explicit site residue atoms for point labeling + if ((ligandAtoms == null || ligandAtoms.empty) && !liganatedProtein.sites.isEmpty()) { + List siteAtomsList = liganatedProtein.sites.collect { it.atoms } + ligandAtoms = Atoms.union(siteAtomsList) + } } }