vsn2trsf {vsn} | R Documentation

## Apply the vsn transformation to data

### Description

Apply the vsn transformation to data.

### Usage

    ## S4 method for signature 'vsn':
    predict(object, newdata, log2scale=TRUE)
    vsn2trsf(x, p, strata)

### 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` | Numeric `matrix`, `vector` or `ExpressionSet` with the data to which an existing fit is to be applied to. A typical use case is when the fit is made to a set of control features and then the transformation is to be applied to the full set of data. If `newdata` is a vector, it is considered a matrix with one column and `nrow(newdata)` rows.
`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.
`x` | Numeric matrix.
`p` | An array with the transformation parameters. If `strata` is specified, `p` is expected to be a 3d array, the first dimension corresponds to the levels of `strata`, the second dimension to the columns of `x` and the third dimension must be 2, corresponding to offsets and factors. If `strata` is missing, then the first dimension may be omitted and `p` can be a 2d array. `NA` values are not allowed.
`strata` | optional, a factor whose length is `nrow(x)`. Can be used for stratified normalization (i.e. separate offsets `a` and factors `b` for each level of `strata`).

### Value

For `vsn2trsf`, a matrix of the same size as `x`. For `predict`, a matrix if `newdata` was a matrix, and an `ExpressionSet`, `newdata` was an `ExpressionSet`. Dimnames and metadata are preserved.

### Author(s)

Wolfgang Huber http://www.ebi.ac.uk/huber

### Examples

    data("kidney")
    param = array(c(-0.1, -0.1, 0.003, 0.003), dim=c(1,2,2))
    tk = vsn2trsf(exprs(kidney), param)
    plot(tk, pch=".")

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

[Package vsn version 2.2.0 Index]