Fix DCC criterion to use predefined site centroid for ResidueSites

DCC was computing site.atoms.centroid (geometric center of resolved
residue atoms) instead of site.getCentroid(). For ResidueSites this
returns the predefined centroid from the input file, which is the
authoritative binding site location. For Ligands this changes from
geometric to mass-weighted center (negligible difference).
This commit is contained in:
rdk
2026-03-04 04:00:18 +01:00
parent 53500dd129
commit 22ac1e51ee

View File

@@ -19,17 +19,18 @@ class DCC extends PocketCriterium {
this.cutoff = cutoff
}
// Uses geometric center (Atoms.centroid — unweighted arithmetic mean of coordinates).
// Note: BindingSite.getCentroid() returns mass-weighted center (Atoms.centerOfMass), not geometric center.
// Uses BindingSite.getCentroid():
// Ligand: atoms.centerOfMass (mass-weighted center)
// ResidueSite: predefined centroid from input file
@Override
boolean isIdentified(BindingSite site, Pocket pocket, EvalContext context) {
return cutoff >= Struct.dist(site.atoms.centroid, pocket.centroid)
return cutoff >= Struct.dist(site.centroid, pocket.centroid)
}
@Override
double score(BindingSite site, Pocket pocket) {
return cutoff - Struct.dist(site.atoms.centroid, pocket.centroid)
return cutoff - Struct.dist(site.centroid, pocket.centroid)
}
@Override