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

Add SQL view for precursor m/z #300

Open
meowcat opened this issue Mar 24, 2021 · 1 comment
Open

Add SQL view for precursor m/z #300

meowcat opened this issue Mar 24, 2021 · 1 comment

Comments

@meowcat
Copy link
Contributor

meowcat commented Mar 24, 2021

In the current database scheme, the msms_spectrum view contains precursor_mz_text. However, the view can't be cached because of subselects, and the precursor is in text format.
To rapidly select viable candidates via SQL (see rformassspectrometry/MsBackendMassbank#28) I am proposing this one:

CREATE VIEW msms_precursor 
AS 
SELECT RECORD AS spectrum_id, CAST(MS_FOCUSED_ION.VALUE AS DOUBLE) AS precursor_mz 
from MS_FOCUSED_ION 
WHERE 
	MS_FOCUSED_ION.SUBTAG = 'PRECURSOR_M/Z' AND 
	MS_FOCUSED_ION.VALUE NOT LIKE "% %" AND 
	MS_FOCUSED_ION.VALUE NOT LIKE "%/%"

The exclusion criteria are what is currently needed to get rid of records that don't cast properly, like MS3 cases and two very strange ones that list many values

https://massbank.eu/MassBank/RecordDisplay?id=PT100763
https://massbank.eu/MassBank/RecordDisplay?id=PT102460
MS$FOCUSED_ION: PRECURSOR_M/Z 590.4495 1.315 590.0900 7.802 589.9528 1.134 444.0505 2.504

@sneumann
Copy link
Member

Those precursors look like a combination of all possible precursors falling into the isolation window. Just imagine what that would look like in the case of SWATH ...
So mzML has specified in http://www.peptideatlas.org/tmp/mzML1.1.0.html#precursorList
that there is either one isolation window, or selectedIonList of multiple ions (i.e. as above).
We could request (and most submitters interpretetd it that way) that the MassBank record knows which ion resulted in the spectrum. Especially for known compounds. In that case the numeric precursor information makes sense. Yours, Steffen

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