Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

featureCV

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 = "none", suffix = NULL)

Arguments

x

An instance of class MSnSet.

groupBy

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

na.rm

A logical(1) defining whether missing values should be removed.

norm

One of normalisation methods applied prior to CV calculation. See normalise() for more details. Here, the default is 'none', i.e. no normalisation.

suffix

A character(1) to be used to name the new CV columns. Default is NULL to ignore this. This argument should be set when CV values are already present in the MSnSet feature variables.

Value

A matrix of dimensions length(levels(groupBy)) by ncol(x) with the respecive CVs. The column names are formed by pasting CV. and the sample names of object x, possibly suffixed by .suffix.

Author(s)

Laurent Gatto and Sebastian Gibb

See Also

Examples

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

MSnbase

Base Functions and Classes for Mass Spectrometry and Proteomics

v2.16.1
Artistic-2.0
Authors
Laurent Gatto, Johannes Rainer and Sebastian Gibb with contributions from Guangchuang Yu, Samuel Wieczorek, Vasile-Cosmin Lazar, Vladislav Petyuk, Thomas Naake, Richie Cotton, Arne Smits, Martina Fisher, Ludger Goeminne, Adriaan Sticker and Lieven Clement.
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.