Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reasonable range of dot-product score for a good MS/MS matching #7

Open
gmhhope opened this issue May 7, 2021 · 4 comments
Open

Reasonable range of dot-product score for a good MS/MS matching #7

gmhhope opened this issue May 7, 2021 · 4 comments

Comments

@gmhhope
Copy link

gmhhope commented May 7, 2021

Do you have some empirical ideas of a reasonable range of dot-product scores for a good MS/MS matching?

Thanks,
Minghao

@gmhhope
Copy link
Author

gmhhope commented May 7, 2021

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

@jorainer
Copy link
Owner

jorainer commented May 7, 2021

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?

@gmhhope
Copy link
Author

gmhhope commented May 7, 2021

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?

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

@jorainer
Copy link
Owner

jorainer commented May 7, 2021

I would suggest to post bugs or feature requests for Spectra directly to the Spectra repository - everything else can be posted here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants