Reasonable range of dot-product score for a good MS/MS matching
Do you have some empirical ideas of a reasonable range of dot-product scores for a good MS/MS matching?
Thanks, Minghao
BTW, I am testing if I can loop your function to perform MS/MS matching my top-3 precursor intensity spectra against mass-bank spectra in your docker image committed with installation of xcms package:
#' Identify spectra that contain a peak matching the precursorMz m/z of interest
res_l = list()
for (i in (5:length(sps_select_l))) {
has_mz <- containsMz(mbank, mz = mean(sps_select_l[[i]]$precursorMz), ppm = 10)
mbank_with_mz <- mbank[has_mz]
res_l[[i]] <- Spectra::compareSpectra(sps_select_l[[i]], mbank_with_mz, ppm = 5)
}
Then I get the below warning or errors (which may not completely detrimental as I still get my results):
07 May 2021 02:58:29 [rsession-rstudio] ERROR system error 2 (No such file or directory) [path: /home/rstudio/.local/share/rstudio/notebooks/3A09E91B-MS2_using Spectra_HILIpos_streamline/1/4AEF2C39b837b70d/cfbyi86nkyx3i/000002.csv]; OCCURRED AT rstudio::core::Error rstudio::core::FilePath::openForWrite(std::shared_ptr<std::basic_ostream<char> >&, bool) const src/cpp/shared_core/FilePath.cpp:1482; LOGGED FROM: void rstudio::session::modules::rmarkdown::notebook::ChunkExecContext::onConsoleText(int, const string&, bool) src/cpp/session/modules/rmarkdown/NotebookExec.cpp:429
I also noticed that if I just have one single spectrum to match with mbank, I will need to convert the result vector back into matrix. That will be easy to probably add into your package.
> sps_select_l[[5]]
MSn data (Spectra) with 1 spectra in a MsBackendMzR backend: ...
> res_l[[5]][1:30]
[1] 0.0000000000 0.0029602438 0.0051176429 0.0027193156 0.0030152131 0.0033243167 0.0007293687 0.0002171082 0.0025099129
[10] 0.0000000000 0.0002725596 0.0001034122 0.0035611095 0.0035642449 0.0035104034 0.0003718248 0.0023921176 0.0000000000
[19] 0.0042135824 0.0000000000 0.0048730437 0.0036011623 0.0000000000 0.0002878159 0.0037079353 0.0034891756 0.0040647953
[28] 0.0026787761 0.0018329190 0.0040046180
No, I don't have a good default value. I usually use similarities from 0.7 up. For the error: that seems to be some error related to RStudio - never seen something like that.
That you get a vector instead of a matrix if you have a single spectrum is interesting. Could you please open an issue reporting that (ideally with some example code and your sessionInfo) in the Spectra repo?
That you get a vector instead of a
matrixif you have a single spectrum is interesting. Could you please open an issue reporting that (ideally with some example code and your sessionInfo) in the Spectra repo?
Do you want me to post issues in that repo instead of here? I can do it from my next post. I will also post what you suggest after I finish the current analyses hopefully after this weekend.
Thanks, Minghao
I would suggest to post bugs or feature requests for Spectra directly to the Spectra repository - everything else can be posted here.