Explicit Retention Time from msp library for small molecules

support
Explicit Retention Time from msp library for small molecules meowcat  2024-02-13 02:56
 

Hi,

we are using MSP libraries from in-house small molecule standards with specified retention time.
This is correctly loaded into the MSP (NIST) library. However, the retention times from the library aren't used as explicit retention times when adding the compound.

I made a github issue and coded a provisional "solution":
https://github.com/ProteoWizard/pwiz/issues/2755
https://github.com/ProteoWizard/pwiz/pull/2860

Aside from the fact that it would need to be improved, maybe this isn't needed at all:

  • Is there an existing way to add an explicit retention time (e.g. from a CSV file) in batch to molecules imported from a Spectral Library?
  • Is there an existing way to associate spectra from spectral libraries to existing molecules in a document (rather than to insert new molecules from spectra)?
 
 
Brian Pratt responded:  2024-02-13 12:26

This code change shouldn't be necessary (and isn't really proper either - explicit RT is a different concept than library RT - but we appreciate the effort!).

Normally you'd just set a tight tolerance for "Transition Settings > Full-Scan > Retention Time Filtering > Use only scans within <tolerance> minutes of MS/MS IDs". But if that's not working for some reason, let's learn more about your situation.

Thanks for using the Skyline support board,

Brian Pratt

 
meowcat responded:  2024-02-15 00:19

and isn't really proper either - explicit RT is a different concept than library RT - but we appreciate the effort!

Are these concepts documented somewhere? Then it would probably be clearer to me why this wasn't doing what I expected in the first place :)

Our issue:
In small molecule target quantification, we start from RT + accurate mass. Explicit RT and RT window are fundamental to this workflow. We use the MS2, if we have it, to further confirm what we already know from RT + accurate mass. We might not have an MS2 confirmation for our target in every specific file.

We are quite happy with importing CSV transition lists with formula and explicit RT, which can include MS2 fragments. However, in this case, the users don't get the MS2 dotp.

On the other hand, we can import spectra from our in-house curated spectral library with matching retention times. However, in this case, only formula and spectrum are imported; the users would have to add explicit RT by hand.

I just want to provide a way for our users to add compounds to their documents with

  • formula
  • explicit RT
  • spectrum
    so they can do quantification based on RT + accurate mass and still get a dotp for their spectrum if there is one.

(Aside, it would be cool to have a head-to-tail plot for spectrum vs library spectrum somewhere. If this exists, I haven't found it yet...)

 
Brian Pratt responded:  2024-02-15 10:50

Yes, we should put together a support tip that explains the interactions of explicit RT, library RT, and iRT. It is somewhat complicated. In software there's always tension between flexibility and simplicity...

At any rate, you have a couple of options, both of which start with loading a spectral library.

Once you have that:
Set up your transitions by importing a transition list that contains explicit RT and explicit RT Window information
or
Add the contents of the spectral library to the document, then use the Document Grid to add Explicit RT information to the precursors. This can be done pretty easily as a columnwise cut and paste action (assuming, of course, that you have the order right).

Spectral libraries don't carry RT window information, so even if we added a "Use Library RT as Explicit RT" option when adding spectral library entries to the document, it wouldn't solve the problem (unless, I suppose, an additional option "Use this Explicit RT Window for all precursors" would suffice).

Aside, it would be cool to have a head-to-tail plot for spectrum vs library spectrum somewhere. If this exists, I haven't found it yet..

The Library Match window is meant to convey that kind of information - is it not quite what you need?

Best regards.

Brian

 
meowcat responded:  2024-02-16 05:31

Hi,
thanks for getting back to me;

I tried setting up the method starting from an inclusion list with RT as you suggested. It works "partly" but not fully.
(Option with copy/pasting RT into document grid: I don’t want to suggest this to my users, as it’s quite error-prone. At that point I’d probably write a script that modifies the XML directly.)

Steps to reproduce
See the upload in the "file sharing folder": 20240214_Skyline_MS2.zip

  • Start Skyline
  • Import Transition List
  • Type: Quantification
  • Molecule Settings: Library -> add «Eawag_45». Pick mol matching Library, rank by Picked Intensity
  • Transition settings:
    • Filter: precursor [M+H]+, Fragment [M+] ion types f, p;
    • Library: tolerance 0.5 m/z, [x] pick ions, 3 product ions
    • Full scan: ms1: count, centroided, 3 peaks, 5ppm; msms: dda, centroided, 5 ppm, include all
  • Paste data from transitions.xlsx
  • Enable auto-select
  • Save document
  • Import results: import the two raw files
  • Adjust the view somewhat, then Save again

Results

  • Library spectrum is correctly shown in “Library match”
  • The MSMS spectrum is correctly extracted, and can be seen clicking on the trace / potentially selecting “MS/MS” if MS1 is selected
  • However, no dotp value is shown in the “Targets”. Also, in the Results grid, “Library dot product” is #N/A
  • The “Library match” only shows the library spectrum
  • We hope to see a head-to-tail plot, or some other visualization of the measured vs reference spectrum, such as this example: https://www.mdpi.com/metabolites/metabolites-10-00158/article_deploy/html/images/metabolites-10-00158-g006.png , ideally with the library dot product shown somewhere
    • Interestingly, while I’m on a “Spectrum information unavailable” view, I can select “Mirror” in the context menu. This option doesn’t exist when I have a small molecule library match.
    • While I now have a “Spectrum” and a “Mirror” selector, I can only choose “Eawag_45”, not the measured spectrum there. The measured spectrum is only in the “Full scan” window.

Further potential bug

  • If i now adapt the explicit retention time using right click -> modify and set venlafaxine to 14.1, the InChIkey is lost (this can be confirmed in the document grid, where the inchikey is now blank).
  • It is also not possible to add the InChIKey back in, as this field is seemingly readonly in the document grid
  • As expected, the “library match” screen then shows “Spectrum information unavailable”.
  • (This doesn’t happen if I adapt the inchikey directly in the document grid)
 
Brian Pratt responded:  2024-02-16 10:09

I can have a look at this early next week.

Having those files in hand to reproduce your steps is a huge help, thanks for that.

 
Nick Shulman responded:  2024-02-20 16:10
The "Library Dot Product" that you see in the Document Grid is supposed to be "#N/A" because your Targets tree only has one MS2 transition in it.

The Library Dot Product is calculated by comparing the peak areas of the MS2 transitions with the intensities from the library spectrum.
In Skyline 23.1 you needed to have at least three MS2 transitions in order to get a dot product value. We recently relaxed that restriction so when the next Skyline-daily comes out in a few weeks you will be able to get a dot product even when you only have two transitions. But, Skyline would never be able to calculate a dot product with only one transition in your Targets tree.

It sounds like you were hoping that Skyline would be able to tell you the dot product of the DDA spectrum from your raw file compared to the spectrum in the spectral library. Skyline never calculates dot products of entire spectra-- only the portions of spectra that correspond to the m/z's of transitions in the Targets tree.
-- Nick
 
meowcat responded:  2024-02-21 02:25
> It sounds like you were hoping that Skyline would be able to tell you the dot product of the DDA spectrum from your raw file compared to the spectrum in the spectral library. Skyline never calculates dot products of entire spectra-- only the portions of spectra that correspond to the m/z's of transitions in the Targets tree.

That's in fact what I expected, yes. Good to know! - We can live with the alternative (though I would prefer the full dot product). However, then we are back to the initial problem: how to get the fragments from the library into the target list?

* I can either not specify any fragments in the inclusion list; then Auto-select enables "5 precursor and 0 fragment transitions".
* Or I can specify a known fragment in the inclusion list; then Auto-select enables "5 precursor and 2 fragment transitions", which are the two I already added. This is despite having "Pick: 3 product ions" in Transition Settings -> Library.
* The Library Match spectrum is still shown, so clearly the matching spectrum is found, but the fragments are not added
* When I set "minimum product ions" to 3 also, there is no "Auto-select" popup window at all and neither extra precursor nor fragment transitions are added. This seems to mean that the library spectrum is not matched at all now.


I noticed that in my Eawag-45 library I still have duplicated inchikeys (spectra from two instruments and the same collision energies), which I will take care of - however manually removing one of the two spectra still didn't change anything, so this is unlikely to be the culprit?
 
Nick Shulman responded:  2024-02-21 08:04
With small molecules, the "Pick X product ions" setting at "Settings > Transition Settings > Library" really only seems to have an effect if you add the molecule to the document by going to:
View > Spectral Libraries
and push the "Add" or "Add All" button.

After the molecule has been added to the document, Skyline does not appear to have any sort of user interface to add new transitions based on the m/z values seen in the library spectrum.
It's not clear that it is a good idea to add m/z's from the library to the document, since it's difficult to know whether a particular m/z is characteristic of the molecule of interest, or is just something that happened to be present in the spectrum when that molecule was detected that one time.

-- Nick
 
Brian Pratt responded:  2024-02-21 09:34
Much of this comes down to the fact (as Nick has already mentioned) that Skyline does not have a model to predict fragments for molecules other than peptides, so we rely on transition lists and/or spectral libraries for non-proteomic fragment data.

The "Pick X product ions" setting at "Settings > Transition Settings > Library" is, yes, used to determine how many product ions to bring in from a spectral library at the time of "Add" or "Add All..." (selection is based on descending reported intensity). I do have some work in progress to make this more dynamic - to adjust the already-imported document when that value changes - but it's not complete yet.

>> It's not clear that it is a good idea to add m/z's from the library to the document, since it's difficult to know whether a particular m/z is characteristic of the molecule of interest, or is just something that happened to be present in the spectrum when that molecule was detected that one time.

MSP-format libraries tend to contain curated lists of fragments, I think that this is the case in the current scenario.

To the issue of treating library RT as explicit RT, which is where this all started, this might be best addressed by a UI change where the user can enable it - though it's not clear to me why a more restrictive library match m/z and RT tolerance doesn't suffice.
 
meowcat responded:  2024-02-22 00:29

It's not clear that it is a good idea to add m/z's from the library to the document, since it's difficult to know whether a particular m/z is characteristic of the molecule of interest

That can be certainly discussed in general, however for this it shouldn't matter whether the molecule is added from the library via "Add" or via matching, right? Doesn't the user choose this behaviour / agree to it by setting "If a library spectrum is available, pick its most intense ions" and "Pick X product ions"?

By the way, an interesting consequence of "If a library..." checkbox for small molecules; I don't know if this is intended or not:

  • if the checkbox is activated, the viewer in Settings -> Spectral Libraries highlights the top-n ions in the spectrum in blue
  • if the checkbox is deactivated, the viewer in Settings -> Spectral Libraries highlights all ions in blue, and "add" inserts all fragments to the document. See attached screenshot.