vsn2trsf: Apply the vsn transformation to data

Description Usage Arguments Value Author(s) Examples

View source: R/vsn2.R

Description

Apply the vsn transformation to data.

Usage

1
2
## S4 method for signature 'vsn'
predict(object, newdata, strata=object@strata, log2scale=TRUE, useDataInFit=FALSE)

Arguments

object

An object of class vsn that contains transformation parameters and strata information, typically this is the result of a previous call to vsn2.

newdata

Object of class ExpressionSet, NChannelSet, AffyBatch (from the affy package), RGList (from the limma package), matrix or numeric, with the data to which the fit is to be applied to.

strata

Optional, a factor or integer that aligns with the rows of newdata; see the strata argument of vsn2.

log2scale

If TRUE, the data are returned on the glog scale to base 2, and an overall offset c is added (see Value section of the vsn2 manual page). If FALSE, the data are returned on the glog scale to base e, and no offset is added.

useDataInFit

If TRUE, then no transformation is attempted and the data stored in object is transferred appropriately into resulting object, which otherwise preserves the class and metadata of newdata. This option exists to increase performance in constructs like

       fit = vsn2(x, ...)
       nx = predict(fit, newdata=x)
  

and is used, for example, in the justvsn function.

Value

An object typically of the same class as newdata. There are two exceptions: if newdata is an RGList, the return value is an NChannelSet, and if newdata is numeric, the return value is a matrix with 1 column.

Author(s)

Wolfgang Huber

Examples

1
2
3
4
5
6
data("kidney")

## nb: for random subsampling, the 'subsample' argument of vsn
##   provides an easier way to do this
fit = vsn2(kidney[sample(nrow(kidney), 500), ])
tn = predict(fit, newdata=exprs(kidney))

vsn documentation built on Nov. 8, 2020, 8:03 p.m.