QFeatures-missing-data: Managing missing data

missing-dataR Documentation

Managing missing data

Description

This manual page describes the handling of missing values in QFeatures objects. In the following functions, if object is of class QFeatures, an optional assay index or name i can be specified to define the assay (by name of index) on which to operate.

The following functions are currently available:

  • zeroIsNA(object, i) replaces all 0 in object by NA. This is often necessary when third-party software assume that features that weren't quantified should be assigned an intensity of 0.

  • infIsNA(object, i) replaces all infinite values in object by NA. This is necessary when third-party software divide expression data by zero values, for instance during custom normalization.

  • nNA(object, i) returns a list of missing value summaries. The first element nNA gives a DataFrame with the number and the proportion of missing values for the whole assay; the second element nNArows provides a DataFrame with the number and the proportion of missing values for the features (rows) of the assay(s); the third element nNAcols provides the number and the proportions of missing values in each sample of the assay(s). When object has class QFeatures and additional column with the assays is provided in each element's DataFrame.

  • filterNA(object, pNA, i) removes features (rows) that contain a proportion of more missing values of pNA or higher.

See the Processing vignette for examples.

Usage

## S4 method for signature 'SummarizedExperiment,missing'
zeroIsNA(object, i)

## S4 method for signature 'QFeatures,integer'
zeroIsNA(object, i)

## S4 method for signature 'QFeatures,numeric'
zeroIsNA(object, i)

## S4 method for signature 'QFeatures,character'
zeroIsNA(object, i)

## S4 method for signature 'SummarizedExperiment,missing'
infIsNA(object, i)

## S4 method for signature 'QFeatures,integer'
infIsNA(object, i)

## S4 method for signature 'QFeatures,numeric'
infIsNA(object, i)

## S4 method for signature 'QFeatures,character'
infIsNA(object, i)

## S4 method for signature 'SummarizedExperiment,missing'
nNA(object, i)

## S4 method for signature 'QFeatures,integer'
nNA(object, i)

## S4 method for signature 'QFeatures,numeric'
nNA(object, i)

## S4 method for signature 'QFeatures,character'
nNA(object, i)

## S4 method for signature 'SummarizedExperiment'
filterNA(object, pNA = 0)

## S4 method for signature 'QFeatures'
filterNA(object, pNA = 0, i)

Arguments

object

An object of class QFeatures or SummarizedExperiment.

i

One or more indices or names of the assay(s) to be processed.

pNA

numeric(1) providing the maximum proportion of missing values per feature (row) that is acceptable. Feature with higher proportions are removed. If 0 (default), features that contain any number of NA values are dropped.

Value

An instance of the same class as object.

See Also

The impute() for QFeautres instances.

Examples

data(ft_na)

## Summary if missing values
nNA(ft_na, 1)

## Remove rows with missing values
assay(filterNA(ft_na, i = 1))

## Replace NAs by zero and back
ft_na <- impute(ft_na, i = 1, method = "zero")
assay(ft_na)
ft_na <- zeroIsNA(ft_na, 1)
assay(ft_na)

rformassspectrometry/Features documentation built on Sept. 25, 2024, 11:30 a.m.