Fix CSV spacing consistency: remove padding and trailing spaces

Remove leading-space padding from fmt calls in getMiscStatsCSV and
FeatureImportances, fix header/data spacing mismatch in toPocketsCSV,
and remove trailing space in toLigandsCSV header.
This commit is contained in:
rdk
2026-03-09 13:32:51 +01:00
parent fdebd71daf
commit 412c590dcb
2 changed files with 4 additions and 4 deletions

View File

@@ -940,7 +940,7 @@ class Evaluation implements Parametrized {
String getMiscStatsCSV() {
stats.collect { "$it.key, ${fmt it.value}" }.join("\n")
stats.collect { "$it.key, ${fmtCsv it.value}" }.join("\n")
}
String diffSuccRatesCSV(List<Integer> tolerances, Evaluation diffWith) {
@@ -974,7 +974,7 @@ class Evaluation implements Parametrized {
*/
String toLigandsCSV() {
StringBuilder csv = new StringBuilder()
csv << "file, #ligands, ligand, chain, ligCode, #atoms, dca4rank, closestPocketDist, proteinDist, centerToProteinDist, sasDist, #contactProteinAtoms, atomIds \n"
csv << "file, #ligands, ligand, chain, ligCode, #atoms, dca4rank, closestPocketDist, proteinDist, centerToProteinDist, sasDist, #contactProteinAtoms, atomIds\n"
ligandRows.each { r ->
List<String> rec = new ArrayList()
@@ -1065,7 +1065,7 @@ class Evaluation implements Parametrized {
String toPocketsCSV() {
StringBuilder csv = new StringBuilder()
csv << "file, #ligands, #pockets, pocket, ligand, rank, score, newRank, oldScore, zScoreTP, probaTP, samplePoints, rawNewScore, pocketVolume, surfaceAtoms \n"
csv << "file,#ligands,#pockets,pocket,ligand,rank,score,newRank,oldScore,zScoreTP,probaTP,samplePoints,rawNewScore,pocketVolume,surfaceAtoms\n"
for (PocketRow p in pocketRows) {
csv << "$p.protName,$p.ligCount,$p.pocketCount,$p.pocketName,$p.ligName,"

View File

@@ -38,7 +38,7 @@ class FeatureImportances {
static String fmt_fi(Object x) {
if (x==null) return ""
sprintf "%8.6f", x
sprintf "%.6f", x
}
static FeatureImportances from(List<Double> importanceValues) {