aldex.makeScaleMatrix: Generate a differential scale matrix by group

View source: R/makeScaleMatrix.r

aldex.makeScaleMatrixR Documentation

Generate a differential scale matrix by group

Description

Takes as input the conditions vector, dispersion paramenter, starting scale values and the number of random instances. The ratio between the scale values is key; setting mu = c(1,1.2) will have the same effect on the analysis as a value of mu =(c(0.5,0.6). The function returns a matrix of scale values of the same dimension as the number of samples and the number of mc.samples used by the aldex() or aldex.clr() function.

Usage

aldex.makeScaleMatrix(gamma, mu, conditions, log = TRUE, mc.samples = 128)

Arguments

gamma

- the base gamma value for the sdlog parameter of rlnorm

mu

- pair of values, or a vector of values one for each sample

conditions

- the conditions vector for the dataset

log

- scale ratio in log2 (TRUE) or as simple ratio (FALSE)

mc.samples

- the number of Monte-Carlo instances used by aldex()

Value

returns a matrix of gamma values that are used as an estimate of the scale for the aldex.clr() function. This allows different scale and gamma values to be applied to each group and can move the centre of mass of the data if required. The example dataset has very extreme differences in scale. Most often these are likely in the range of 10-15

Author(s)

Greg Gloor, Michelle Pistner Nixon

References

Please use the citation given by citation(package="ALDEx").

See Also

aldex.clr, aldex

Examples


# conditions is a vector describing the data
data(selex)
# subset for efficiency
conds <- c(rep("NS", 7), rep("S", 7))
mu.in <- c(1,50) # 50-fold difference in scale between groups
mu.vec <- aldex.makeScaleMatrix(1, mu.in, conds, log=TRUE, mc.samples=128)


ggloor/ALDEx_bioc documentation built on Oct. 31, 2023, 1:13 a.m.