impute,MSnSet-method {MSnbase} | R Documentation

## Quantitative proteomics data imputation

### Description

The `impute` method performs data imputation on `MSnSet` instances using a variety of methods.

Users should proceed with care when imputing data and take precautions to assure that the imputation produce valid results, in particular with naive imputations such as replacing missing values with 0.

See `MsCoreUtils::impute_matrix()` for details on the different imputation methods available and strategies.

### Usage

    ## S4 method for signature 'MSnSet'
    impute(object, method, ...)

### Arguments

`object` | An `MSnSet` object with missing values to be imputed.
`method` | `character(1)` defining the imputation method. See `MsCoreUtils::imputeMethods()` for available ones. See `MsCoreUtils::impute_matrix()` for details.
`...` | Additional parameters passed to the inner imputation function. See `MsCoreUtils::impute_matrix()` for details.

### Examples

    data(naset)

    ## table of missing values along the rows
    table(fData(naset)$nNA)

    ## table of missing values along the columns
    pData(naset)$nNA

    ## non-random missing values
    notna <- which(!fData(naset)$randna)
    length(notna)
    notna

    impute(naset, method = "min")

    if (require("imputeLCMD")) {
        impute(naset, method = "QRILC")
        impute(naset, method = "MinDet")
    }

    if (require("norm"))
        impute(naset, method = "MLE")

    impute(naset, "mixed",
           randna = fData(naset)$randna,
           mar = "knn", mnar = "QRILC")

    ## neighbour averaging
    x <- naset[1:4, 1:6]

    exprs(x)[1, 1] <- NA ## min value
    exprs(x)[2, 3] <- NA ## average
    exprs(x)[3, 1:2] <- NA ## min value and average
    ## 4th row: no imputation
    exprs(x)

    exprs(impute(x, "nbavg"))

[Package MSnbase version 2.18.0 Index]