standardsFit: Standards model

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/norm.R

Description

Fit a model which describes the variation of the labeled internal standards from the biological factors.

Usage

1
standardsFit(object, factors, ncomp = NULL, lg = TRUE, fitfunc = lm, ...)

Arguments

object

an ExpressionSet or a matrix. Note that if you pass amatrix have to specify the identity of the standards by passing the appropriate argument to standards.

factors

the biological factors described in the pheno data slot if object is an ExpressionSet or a design matrix if object is a matrix.

ncomp

number of PCA components to use. Determined by cross-validation if left NULL

lg

logical indicating that the data should be log transformed

fitfunc

the function that creates the model fit for normalization, must use the same interfaces as lm.

...

passed on to Q2, pca (if pcaMethods > 1.26.0), standards and analytes

Details

There is often unwanted variation in among the labeled internal standards which is related to the experimental factors due to overlapping peaks etc. This function fits a model that describes that overlapping variation using a scaled and centered PCA / multiple linear regression model. Scaling is done outside the PCA model.

Value

a list containing the PCA/MLR model, the recommended number of components for that model, the standard deviations and mean values and Q2/R2 for the fit.

Author(s)

Henning Redestig

See Also

makeX, standardsPred

Examples

1
2
3
4
5
6
7
8
data(mix)
sfit <- standardsFit(mix, "type", ncomp=3)
slplot(sfit$fit$pc)
## same thing
Y <- exprs(mix)
G <- model.matrix(~-1+mix$type)
isIS <- fData(mix)$tag == 'IS'
sfit <- standardsFit(Y, G, standards=isIS, ncomp=3)

crmn documentation built on March 26, 2020, 8:35 p.m.