genSwathIonLib {specL} | R Documentation

## Spectrum library generator for SWATH analysis

### Description

This function generates an ion library for SWATH analysis. It takes a R data object which contains a peak list. The R data object can be generated using the `read.bibliospec` function.

### Usage

        genSwathIonLib(data,
            data.fit = data,
            mascotIonScoreCutOFF=20,
            proteinIDPattern='',
            max.mZ.Da.error = 0.1,
            ignoreMascotIonScore = TRUE,
            topN = 10,
            fragmentIonMzRange = c(300, 1800),
            fragmentIonRange = c(4, 100),
            fragmentIonFUN = .defaultSwathFragmentIon,
            iRT = specL::iRTpeptides,
            AminoAcids = protViz::AA,
            breaks=NULL,
            NORMALIZE=.normalize_rt)

### Arguments

`data` | data set containing mZ and peptide sequence.
`mascotIonScoreCutOFF` | a value for filtering the specs.
`proteinIDPattern` | a filter for protein.
`max.mZ.Da.error` | the mZ error in Dalton on ms2 level.
`ignoreMascotIonScore` | Boolean if mascot score is considered or not.
`topN` | returns the most `N` intense fragment ion only.
`fragmentIonMzRange` | mZ range filter of fragment ion.
`fragmentIonRange` | range filter of the number of identified fragment ion which are assigned in the spectrum library set in `fragmentIonTyp`. Use this option to generate a library with a minimum of five transitions for all peptides using `c(5,100)`, all peptides where at least not five transmissions found were omitted.
`fragmentIonFUN` | `function (b, y)` which derives all requested fragment ion out a given tuple of `b` and `y` ion. If the parameter is not specified the method uses an internal function similar as the example below.
`iRT` | optional table which contains iRT peptides. If an iRT table is provided (default) a `lm` is applied to normalize the rt in `data`. See also `?iRT`. A necessary condition is that `data` contains at least two iRT peptides.
`AminoAcids` | a list containing of 1-letter code and mono-isotopic mass of the amino acids. Default uses the `protViz::AA` data set.
`data.fit` | data set containing mZ and peptide sequence which is used for normalizing rt using a linear model `lm(formula = rt ~ aggregateInputRT * fileName, data)`. The rt aggregation for the model uses `median`.
`breaks` | provides a vector of SWATH windows. If q1 (precursor mass) and q3 (fragment ion) fall into the same SWATH window the fragment ion is ignored in the resulting ion library. The follwing code shows an example `breaks=seq(400, 2000, by=25)`.
`NORMALIZE` | is a `function(data, data.fit, iRT, plot=FALSE)` normalizing the rt. The default is a internal R helper function using `lm`.

### Details

The function is the main contribution of the `specL` package. It generates the spectra library used in a SWATH analysis workflow out of a mass spectrometric measurement.

`genSwathIonLib` uses the core functions `protViz::findNN`, `protViz::fragmentIon`, and `protViz::aa2mass`.

The input is read by using `read.bibliospec` function of this package and passed by the `data` function parameter. If no BiblioSpec files are available also Mascot DAT files can be read using scripts contained in the protViz package exec folder.

If the protein information is lost you can benefit for the `specL::annotate.protein_id.Rd` method.

The function first appear in the `protViz` 0.1.45 package. It has been removed in `protViz` 0.2.6 to avoid package dependencies.

### Value

The output is a data structure defined as `specLSet` object. The generic method `ionlibrary` returns a list of `specL` objects, `specLSet` also stores the input and normalized retention times.

### Author(s)

Christian Panse, Christian Trachsel, and Jonas Grossmann 2012, 2013, 2014, 2016

### See Also

The S4 class definition: `showClass("specL")` `showClass("specLSet")`

and the package vignette file. `vignette('specL')`

### Examples

        myFragmentIon <- function (b, y) {
            Hydrogen <- 1.007825
            Oxygen <- 15.994915
            Nitrogen <- 14.003074

            b1_ <- (b )
            y1_ <- (y )

            b2_ <- (b + Hydrogen) / 2
            y2_ <- (y + Hydrogen) / 2

            b3_ <- (b + 2 * Hydrogen) / 3
            y3_ <- (y + 2 * Hydrogen) / 3

            return( cbind(b1_, y1_, b2_, y2_, b3_, y3_) )
        }

        peptideStd.ionLib <- genSwathIonLib(data=peptideStd,
            data.fit=peptideStd.redundant,
            fragmentIonFUN=myFragmentIon)

        summary(peptideStd.ionLib)

        idx<-40

        op <- par(mfrow = c(2,1))

        plot(peptideStd.ionLib)

        text(rt.input(peptideStd.ionLib)[idx],
            rt.normalized(peptideStd.ionLib)[idx],
            "X", cex=1.5)

        plot(ionlibrary(peptideStd.ionLib)[[idx]])

        ## Not run:
            write.spectronaut(peptideStd.ionLib,
                file="peptideStd.ionLib.csv")

    ## End(Not run)

[Package specL version 1.18.1 Index]