featureCV {MSnbase}R Documentation

Calculates coeffivient of variation for features

Description

This function calculates the column-wise coefficient of variation (CV), i.e. the ration between the standard deviation and the mean, for the features in an "MSnSet". The CVs are calculated for the groups of features defined by groupBy. For groups defined by single features, NA is returned.

Usage

featureCV(x, groupBy, na.rm = TRUE, norm = c("sum", "max", "none",
  "center.mean", "center.median", "quantiles", "quantiles.robust"))

Arguments

x

An instance of class "MSnSet".

groupBy

An object of class factor defining how to summerise the features.

na.rm

A logical defining whether missing values should be removed.

norm

One of 'none' (default), 'sum', 'max', 'center.mean', 'center.median' 'quantiles' or 'quantiles.robust' defining if and how the data should be normalised prior to CV calculation. See normalise for more details.

Value

A matrix of dimensions length(levels(groupBy)) by ncol(x) with the respecive CVs.

Author(s)

Laurent Gatto <lg390@cam.ac.uk>, Sebastian Gibb <mail@sebastiangibb.de>

See Also

combineFeatures

Examples

data(msnset)
msnset <- msnset[1:4]
gb <- factor(rep(1:2, each = 2))
featureCV(msnset, gb)

[Package MSnbase version 2.4.2 Index]