splitPolarities {CluMSID} | R Documentation

## Separate spectra with different polarities from the same run

### Description

Using `splitPolarities`, spectra with different polarities from the same run can be separated, e.g. when processing spectra recorded with polarity-switching.

### Usage

    splitPolarities(ms2list, polarity = c("positive", "negative"))

### Arguments

`ms2list` | A list of `MS2spectrum` objects as produced by `extractMS2spectra`.
`polarity` | The polarity of spectra to be analysed, must be `"positive"` or `"negative"`.

### Value

A list of `MS2spectrum` objects that contains only spectra with the given `polarity`.

### Examples

    my_spectra <- extractMS2spectra(MSfile = system.file("extdata",
                                    "PoolA_R_SE.mzXML",
                                    package = "CluMSIDdata"),
                                    min_peaks = 4, RTlims = c(0,5))

    my_positive_spectra <- splitPolarities(my_spectra, "positive")

[Package CluMSID version 1.0.0 Index]