rescale_values: Rescales rows of data to be between 0 and 1

Description Usage Arguments Details Value Examples

Description

Rescales rows of data to be between 0 and 1

Usage

1
2
3
4
5
6
7
8
## S4 method for signature 'Moanin'
rescale_values(object, data = NULL, use_group = FALSE)

## S4 method for signature ''NULL''
rescale_values(object, data)

## S4 method for signature 'missing'
rescale_values(object, ...)

Arguments

object

a object of class Moanin, only needed if choose to rescale by grouping variable in the moanin object. If NULL, then data will be rescaled jointly across all observations.

data

The matrix to rescale by row. If NULL, and object is given, data will be taken as assay(object) Each row should correspond to a gene or a centroid, and columns to samples.

use_group

If true, then the data will be rescaled such that, for each row, all values associated to each group (defined by grouping variable of object) is between 0 and 1. For example, if column

...

arguments passed to the matrix or Moanin method.

Details

If the user set log_transform=TRUE in the creation of the Moanin object, the data will be log transformed before rescaling

Value

rescaled y, such that for each row, the values are comprised between 0 and 1. Note that if use_group=TRUE and object is not NULL, the values associated to the columns of unique values of the grouping variable of object will be rescaled separately.

Examples

1
2
3
4
5
6
data(exampleData)
moanin <- create_moanin_model(data=testData, meta=testMeta)
# Can rescale data in Moanin object
allData <- rescale_values(moanin)
# Or provide different data and/or rescale within grouping variable
smallData <- rescale_values(moanin, data=testData[1:10,], use_group=TRUE)

NelleV/moanin documentation built on July 28, 2021, 7:34 p.m.