patRoon icon indicating copy to clipboard operation
patRoon copied to clipboard

Filtering MS/MS Peaks with Characteristic Fragment Ions

Open Jasmin-Zeng opened this issue 1 year ago • 10 comments

Hello, I would like to ask if patRoon can filter MS/MS peaks containing one or more characteristic fragment ions (CFIs).

For example, I am analyzing organophosphate esters, and the MS/MS peaks of these compounds often include specific fragment ions like C18H16O4P+, C12H12O4P+, C6H8O4P+, H4O4P+, and H2O3P+. I now only want to retain mslists that contain one or more of the characteristic fragment ions, but I don't know how to achieve this.

I would be grateful if you could advise.

Jasmin-Zeng avatar Jan 02 '24 01:01 Jasmin-Zeng

Hi @Jasmin-Zeng ,

Sorry for my late reply.

This is definitely possible. There are various ways, but probably the easiest is to use the delete() function, for instance:

# function to compare mzs with some tolerance
equalMZ <- function(mz1, mz2) abs(mz1 - mz2) < 0.005

# delete all MS/MS spectra without at least one characteristic fragment
mslistsF <- delete(mslists, j = function(pl, grp, ana, type)
{
    if (type != "MSMS")
        return(FALSE) # only consider MS/MS peak lists
    return(!any(sapply(c(94.05239, 107.06016, 300.1234), equalMZ, pl$mz))) # delete if none of these characteristic m/z are present
})

Note that in this example you will need to calculate the exact m/z values for your fragments.

Feel free to ask more details if needed.

Thanks, Rick

rickhelmus avatar Jan 16 '24 07:01 rickhelmus

Thank you for your reply, I will test it and get back to you with the results then.

Jasmin-Zeng avatar Jan 19 '24 02:01 Jasmin-Zeng

Hi @rickhelmus , Thank you for your guidance. I successfully integrated the feature of CFIs into my code, and it's functioning well now.

However, I have another question. I used MS-Dial for deconvolution of data collected in DIA mode and exported the results in .msp format, where precursor ions are well-matched with their corresponding fragment ions.

My question is: can this .msp file be imported into patRoon to generate MSPeakLists, thereby facilitating the use of patRoon's workflow for formula and compound annotation? I've attached the .msp file for your reference. Msp_DIA_300_400.zip

Thank you for your assistance.

Jasmin-Zeng avatar Jan 21 '24 13:01 Jasmin-Zeng

Hi @Jasmin-Zeng ,

Great!

Unfortunately, importing peak lists is not yet supported (but planned for the next major release). However, with a bit of creativity and coding, perhaps you could perform the following:

  1. Generate the MS peak lists with patRoon, setting precursorMzWindow to NULL so that DIA spectra are handled properly.
  2. Import the MSP files with loadMSLibrary()
  3. Use the delete() function to clear-out any mass peaks that are not in the imported MSP data.

Thanks, Rick

rickhelmus avatar Jan 22 '24 11:01 rickhelmus

Ok, I will try it as you suggested, thank you very much.

Jasmin-Zeng avatar Jan 22 '24 18:01 Jasmin-Zeng