From 030b4a57bd931b82a9f969520169e06864479a05 Mon Sep 17 00:00:00 2001 From: Sajjan Singh Mehta Date: Tue, 14 Nov 2023 11:50:27 +0100 Subject: [PATCH] missing epsilon correction in R implementation to fix MassBank/MassBank-data#248 --- splashR/R/getSplash.R | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/splashR/R/getSplash.R b/splashR/R/getSplash.R index bf2670e..daef755 100644 --- a/splashR/R/getSplash.R +++ b/splashR/R/getSplash.R @@ -96,11 +96,10 @@ getBlockHist <- function(peaks, histBase, histLength, binSize) { summedintensities <- tapply(peaks[,2], binindex, sum) wrappedbinindex <- unique(binindex) %% histLength wrappedintensities <- tapply(summedintensities, wrappedbinindex, sum) - normalisedintensities <- as.integer(wrappedintensities/max(wrappedintensities)*(histBase-1)) + normalisedintensities <- as.integer(EPS_CORRECTION + (histBase-1) * wrappedintensities / max(wrappedintensities)) wrappedhist[sort(unique(wrappedbinindex))+1] <- normalisedintensities paste(integer2base36(wrappedhist), collapse="") - } getSplash <- function(peaks) {