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

number of common peaks in @matches #36

Closed
stanstrup opened this issue Sep 20, 2021 · 5 comments
Closed

number of common peaks in @matches #36

stanstrup opened this issue Sep 20, 2021 · 5 comments

Comments

@stanstrup
Copy link

It would be nice to have the number of common peaks in @matches in addition to presence_ratio. When I take a quick look at matches I'd like to see if for example only a single peak was matched.

@jorainer
Copy link
Member

Sure, makes sense.

@jorainer
Copy link
Member

@stanstrup , can you check if you're happy with the recent changes and eventually close the issue?

@stanstrup
Copy link
Author

stanstrup commented Sep 22, 2021

It seems to always return 1...

fl <- system.file("TripleTOF-SWATH", "PestMix1_DDA.mzML", package = "msdata")
pest_ms2 <- filterMsLevel(Spectra(fl), 2L)
pest_ms2 <- pest_ms2[c(808, 809, 945:955)]

load(system.file("extdata", "minimb.RData", package = "MetaboAnnotation"))

csp <- MatchForwardReverseParam(ppm = 10, requirePrecursor = FALSE, THRESHFUN = function(x)  which(x > 0)  )

mtches_test <- matchSpectra(pest_ms2, minimb, csp)

mtches_test@matches$matched_peaks_count %>% table

I also tested with my own larger set where this can definitely not be true and my own calculation (as per the docs compareSpectra(pest_ms2, minimb, FUN = function(x, y, ...) nrow(x), type = "inner", ppm = 10)) also don't get this.

@jorainer
Copy link
Member

OMG, you're right @stanstrup ! Instead of adding the number of common peaks for one match I always replaced the whole column (see 4788bbc)! I'm really sorry for this terrible bug! Thanks for checking and reporting! It should be fixed now.

@stanstrup
Copy link
Author

It is me that thanks you for bothering with my request. It works now. Thanks!

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