-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Hi, I got a warning in cbind when I adapted the example code to have a centroid on position 1. See the code below
ints <- c(13, 8, 12, 7, 4, 9, 15, 16, 11, 8, 3, 2, 3, 9, 12, 14, 13, 8, 3)
mzs <- seq_along(ints)
pidx <- as.integer(c(1, 3, 8, 16))
MsCoreUtils::refineCentroids(mzs, ints, pidx, k = 3L, descending = TRUE, threshold = .33)
Results in:
[1] 1.380952 2.568182 7.898305 15.982143
Warning message: In cbind(...) : number of rows of result is not a multiple of vector length (arg 1)
It does produce the correct weighted mass for the centroid on position 1, but does not for the 2nd centroid. Changing the ints variable and pidx (without a centroid on position 1) back to the example code gives a different (correct) weighted mass.
ints <- c(5, 8, 12, 7, 4, 9, 15, 16, 11, 8, 3, 2, 3, 9, 12, 14, 13, 8, 3)
pidx <- as.integer(c(3, 8, 16))
MsCoreUtils::refineCentroids(mzs, ints, pidx, k = 3L, descending = TRUE, threshold = .33)
[1] 2.916667 7.898305 15.982143
Metadata
Metadata
Assignees
Labels
No labels