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

Support OR #1

Open
jorainer opened this issue Nov 2, 2021 · 2 comments
Open

Support OR #1

jorainer opened this issue Nov 2, 2021 · 2 comments
Assignees

Comments

@jorainer
Copy link
Member

jorainer commented Nov 2, 2021

Support an OR for matching values (as described in here).
Specifically, we want to support queries such as WHERE MS2PROD=(100 OR 104):TOLERANCEPPM=5. This should ideally work for all conditions, e.g. also for MS2PREC etc.

@andreavicini
Copy link
Collaborator

The functions .translate_filter_ms2prec and .translate_filter_ms2nl use filter functions from Spectra: filterPrecursorMzand containsNeutralLoss which allow only one value (of mz or neutral loss). Assuming we have
a query like WHERE MS2PREC=(100 OR 104):TOLERANCEPPM=5 we would need to check both values (100 and 104).
At the moment .translate_filter_ms2prec returns ProcessingStep(filterPrecursorMz, ARGS = list(mz = mzr)) which is ok if mzr has length 1. Maybe to solve the problem at the origin one could modify the filterPrecursorMz so that it receives also vectors. Otherwise I was thinking to define a filter function like

filt_fun <- function(x, pmz, tolerance, ppm) { mzr <- pmz + c(-1, 1) * (tolerance + ppm(pmz, ppm = ppm)) do.call(c, lapply(mzr, function(v) ProcessingStep(filterPrecursorMz, ARGS = list(mz = v)))) }

and return ProcessingStep(filt_fun, ARGS = list(pmz, tolerance, ppm)). This however can have problems because due to tolerance and ppm different calls to filterPrecursorMz could return the same spectra leading to duplicates in the final spectra returned.

@jorainer
Copy link
Member Author

Good point. I will have a look into the filterPrecursorMz function in Spectra.

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