MatteoLacki / IsoSpec

Libraries for fine isotopic structure calculator.
Other
35 stars 10 forks source link

Useage of C++ Interface #6

Closed hroest closed 5 years ago

hroest commented 5 years ago

I am trying to integrate IsoSpec with OpenMS and I have had some success in calling the functions provided by IsoSpec and getting isotope probabilities. However, I found that without a deep insight into the code it is tricky to figure out what the best way to call the library. I have found from the R documentation that there are basically these ways to call the algorithm:

Can you give me some insights when you would call these different version?

I am trying to understand what the implications of the different algorithms are, am I correct in thinking that in ALGO_LAYERED one can set the cutoff such that X % of the probability is explained (e.g. one may want 95% of the probability density). On the other hand, ALGO_THRESHOLD would allow one to prune peaks that are below a certain cutoff - here it seems a relative cutoff would be a number between 0 and 1 which is interpreted as relative to the most intense peak, is that correct? What about the absolute cutoff, would that be interpreted as pruning peaks that are below X % probability -- so basically the relative version is just scaling everything by the most intense peak? Are there strong performance difference between the different approaches, e.g. is one always preferred over the others performance-wise?

Finally I found there is also an undocumented option ALGO_LAYERED_ESTIMATE - does this provide a speedup?

Currently my C++ code looks like basically this:

Iso* iso = new Iso(formula.c_str());
IsoThresholdGenerator* generator = new IsoThresholdGenerator(std::move(*iso), threshold_, absolute_, tabSize, hashSize); 
Tabulator<IsoThresholdGenerator>* tabulator = new Tabulator<IsoThresholdGenerator>(generator, true, true, true, true); 

Does that look reasonable?

I was wondering which options to set in tabulator, I think I need get_masses and get_probs, what do the other ones do, do I need the other ones? What do the values in the lprob() and eprob() represent?