Description Usage Arguments Value Examples
Call a C++ function that runs a Gibbs Sampler algorithm to sample from the distribution of metabolite to compound attribution with the previous assumption that the connected combination of attributions makes more sense.
1 | gibbs.samp(x, y, N, w, p)
|
x |
a vector of masses (unique from mass/retention time pairs). |
y |
a vector of candidate compounds for each mass. |
N |
number of iterations to sample. |
w |
matrix of compound connections. |
p |
matrix of likelihood probabilities. |
A list of matrices with attribution indexes and probabilities.
1 2 3 4 5 6 | # Not to run
# tmp <- which(w==1, arr.ind=TRUE)
# w_sparse <- sparseMatrix(i = tmp[,1], j = tmp[,2],x = rep(1, nrow(tmp)), dims = c(C,C))
# x <- 1:ncol(wl$wm)
# y <- 1:nrow(wl$wm)
# system.time(conn <- gibbs.samp(x, y, 5000 , w_sparse, p))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.