Provides probability ranking to candidate compounds assigned to masses, with the prior assumption of connected sample and additional previous and spectral information modeled by the user.
after over a year I finally managed to clean up my changes of your code to send you a pull request. I didn't change the method itself. Basically you will see 3 differences:
(1) The matrix w that stores the connections of the compounds
(i) contains just values of 0 or 1.
(ii) usually contains not very much entries.
(iii) is quadratic and symmetric.
All of those criteria support the use of a sparse matrix format which has optimized access and is also available for Rcpp (arma::sp_mat).
(2) The normalized likelihood you initially calculated in each iteration for the processed query is now calculated once in the beginning and stored in a matrix to avoid redundant calculations.
(3) 2 Code Optimizations
I commented the changed parts as much as useful. If you have any further questions feel free to come back to me.
Dear Ricardo,
after over a year I finally managed to clean up my changes of your code to send you a pull request. I didn't change the method itself. Basically you will see 3 differences:
(1) The matrix w that stores the connections of the compounds (i) contains just values of 0 or 1. (ii) usually contains not very much entries. (iii) is quadratic and symmetric. All of those criteria support the use of a sparse matrix format which has optimized access and is also available for Rcpp (arma::sp_mat).
(2) The normalized likelihood you initially calculated in each iteration for the processed query is now calculated once in the beginning and stored in a matrix to avoid redundant calculations.
(3) 2 Code Optimizations
I commented the changed parts as much as useful. If you have any further questions feel free to come back to me.
best regards, Sarah