-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
I don't think we can vectorize getting coefficients of
model_peak_center_intensity = function(x, coefficients){
mn_x = mean(x)
# this is all on the coefficients
peak_center = ((-1 * coefficients[2]) / (2 * coefficients[3]))
# this is just center from above, and then coefficients
center_int = coefficients[1] + coefficients[2] * peak_center +
(coefficients[3] * (peak_center ^ 2))
c(ObservedMZ = peak_center + mn_x, Height = center_int)
}
So looking at this, if we passed in a vector of means, and a matrix of coefficients, we should be able to generate a whole lot of peak centers and heights all in one go. This would be good, because one of the big penalties we currently take is writing data-frame, and right now we do it row by row (using purrr mostly, so it's trying to do pre-allocation, but it's still not going to be as good as a whole lot at once I think).
Metadata
Metadata
Assignees
Labels
No labels