addIdentificationData-methods {MSnbase} | R Documentation

## Adds Identification Data

### Description

These methods add identification data to a raw MS experiment (an `"MSnExp"` object) or to quantitative data (an `"MSnSet"` object). The identification data needs to be available as a `mzIdentML` file (and passed as filenames, or directly as identification object) or, alternatively, can be passed as an arbitrary `data.frame`. See details in the Methods section.

### Details

The `featureData` slots in a `"MSnExp"` or a `"MSnSet"` instance provides only one row per MS2 spectrum but the identification is not always bijective. Prior to addition, the identification data is filtered as documented in the `filterIdentificationDataFrame` function: (1) only PSMs matching the regular (non-decoy) database are retained; (2) PSMs of rank greater than 1 are discarded; and (3) only proteotypic peptides are kept.

If after filtering, more then one PSM per spectrum are still present, these are combined (reduced, see `reduce,data.frame-method`) into a single row and separated by a semi-colon. This has as side-effect that feature variables that are being reduced are converted to characters. See the `reduce` manual page for examples.

See also the section about identification data in the MSnbase-demo vignette for details and additional examples.

After addition of the identification data, new feature variables are created. The column `nprot` contains the number of members in the protein group; the columns `accession` and `description` contain a semicolon separated list of all matches. The columns `npsm.prot` and `npep.prot` represent the number of PSMs and peptides that were matched to a particular protein group. The column `npsm.pep` indicates how many PSMs were attributed to a peptide (as defined by its sequence `pepseq`). All these values are re-calculated after filtering and reduction.

### Methods

`signature(object = "MSnExp", id = "character", ...`

  Adds the identification data stored in mzIdentML files to a `"MSnExp"` instance. The method handles one or multiple mzIdentML files provided via `id`. `id` has to be a `character` vector of valid filenames. See below for additional arguments.

`signature(object = "MSnExp", id = "mzID", ...)`

  Same as above but `id` is a `mzID` object generated by `mzID::mzID`. See below for additional arguments.

`signature(object = "MSnExp", id = "mzIDCollection", ...)`

  Same as above but `id` is a `mzIDCollection` object. See below for additional arguments.

`signature(object = "MSnExp", id = "mzRident", ...`

  Same as above but `id` is a `mzRident` object generated by `mzR::openIdfile`. See below for additional arguments.

`signature(object = "MSnExp", id = "data.frame", ...`

  Same as above but `id` could be a `data.frame`. See below for additional arguments.

`signature(object = "MSnSet", id = "character", ...)`

  Adds the identification data stored in mzIdentML files to an `"MSnSet"` instance. The method handles one or multiple mzIdentML files provided via `id`. `id` has to be a `character` vector of valid filenames. See below for additional arguments.

`signature(object = "MSnSet", id = "mzID", ...)`

  Same as above but `id` is a `mzID` object. See below for additional arguments.

`signature(object = "MSnSet", id = "mzIDCollection", ...)`

  Same as above but `id` is a `mzIDCollection` object. See below for additional arguments.

`signature(object = "MSnSet", id = "data.frame", ...)`

  Same as above but `id` is a `data.frame`. See below for additional arguments.

The methods above take the following additional argument. These need to be set when adding identification data as a `data.frame`. In all other cases, the defaults are set automatically.

fcol

  The matching between the features (raw spectra or quantiative features) and identification results is done by matching columns in the featue data (the `featureData` slot) and the identification data. These values are the spectrum file index and the acquisition number, passed as a `character` of length 2. The default values for these variables in the `object`'s feature data are `"spectrum.file"` and `"acquisition.num"`. Values need to be provided when `id` is a `data.frame`.

icol

  The default values for the spectrum file and acquisition numbers in the identification data (the `id` argument) are `"spectrumFile"` and `"acquisitionNum"`. Values need to be provided when `id` is a `data.frame`.

acc

  The protein (group) accession number or identifier. Defaults are `"DatabaseAccess"` when passing filenames or `mzRident` objects and `"accession"` when passing `mzID` or `mzIDCollection` objects. A value needs to be provided when `id` is a `data.frame`.

desc

  The protein (group) description. Defaults are `"DatabaseDescription"` when passing filenames or `mzRident` objects and `"description"` when passing `mzID` or `mzIDCollection` objects. A value needs to be provided when `id` is a `data.frame`.

pepseq

  The peptide sequence variable name. Defaults are `"sequence"` when passing filenames or `mzRident` objects and `"pepseq"` when passing `mzID` or `mzIDCollection` objects. A value needs to be provided when `id` is a `data.frame`.

key

  The key to be used when the identification data need to be reduced (see details section). Defaults are `"spectrumID"` when passing filenames or `mzRident` objects and `"spectrumid"` when passing `mzID` or `mzIDCollection` objects. A value needs to be provided when `id` is a `data.frame`.

decoy

  The feature variable used to define whether the PSM was matched in the decoy of regular fasta database for PSM filtering. Defaults are `"isDecoy"` when passing filenames or `mzRident` objects and `"isdecoy"` when passing `mzID` or `mzIDCollection` objects. A value needs to be provided when `id` is a `data.frame`. See `filterIdentificationDataFrame` for details.

rank

  The feature variable used to defined the rank of the PSM for filtering. Defaults is `"rank"`. A value needs to be provided when `id` is a `data.frame`. See `filterIdentificationDataFrame` for details.

accession

  The feature variable used to defined the protein (groupo) accession or identifier for PSM filterin. Defaults is to use the same value as `acc` . A value needs to be provided when `id` is a `data.frame`. See `filterIdentificationDataFrame` for details.

verbose

  A `logical` defining whether to print out messages or not. Default is to use the session-wide open from `isMSnbaseVerbose`.

### Author(s)

Sebastian Gibb <mail@sebastiangibb.de> and Laurent Gatto

### See Also

`filterIdentificationDataFrame` for the function that filters identification data, `readMzIdData` to read the identification data as a unfiltered `data.frame` and `reduce,data.frame-method` to reduce it to a `data.frame` that contains only unique PSMs per row.

### Examples

    ## find path to a mzXML file
    quantFile <- dir(system.file(package = "MSnbase", dir = "extdata"),
                     full.name = TRUE, pattern = "mzXML$")
    ## find path to a mzIdentML file
    identFile <- dir(system.file(package = "MSnbase", dir = "extdata"),
                     full.name = TRUE, pattern = "dummyiTRAQ.mzid")

    ## create basic MSnExp
    msexp <- readMSData(quantFile)

    ## add identification information
    msexp <- addIdentificationData(msexp, identFile)

    ## access featureData
    fData(msexp)

    idSummary(msexp)

[Package MSnbase version 2.10.1 Index]