Learn R Programming

countTransformers (version 0.0.6)

lvTransformer: Log and VOOM Transformation

Description

Log and VOOM Transformation.

Usage

lvTransformer(mat, lib.size=NULL, low=0.001, upp=1000)

Arguments

mat

G x n data matrix, where G is the number of genes and n is the number of subjects

lib.size

By default, lib.size is a vector of column sums of mat

low

lower bound for the model parameter

upp

upper bound for the model parameter

Value

A list with 3 elements:

res.delta

An object returned by optimize function

delta

model parameter

mat2

transformed data matrix having the same dimension as mat

Details

Denote \(x_{gi}\) as the expression level of the \(g\)-th gene for the \(i\)-th subject. We perform the log transformation $$y_{gi}=\log_2\left(t_{gi} + \frac{1}{\delta}\right)$$, where $$t_{gi}=\frac{\left(x_{gi}+0.5\right)}{X_i+1}\times 10^6$$ and \(X_i=\sum_{g=1}^{G} x_{gi}\) is the column sum for the \(i\)-th column of the matrix mat. The optimal value for the parameter \(\delta\) is to minimize the squared difference between the sample mean and the sample median of the pooled data \(y_{gi}\), \(g=1, \ldots, G\), \(i=1, \ldots, n\), where \(G\) is the number of genes and \(n\) is the number of subjects.

References

Zhang Z, Yu D, Seo M, Hersh CP, Weiss ST, Qiu W. Novel Data Transformations for RNA-seq Differential Expression Analysis. (2019) 9:4820 https://rdcu.be/brDe5

Examples

Run this code
# NOT RUN {
library(Biobase)

data(es)
print(es)

# expression set
ex = exprs(es)
print(dim(ex))
print(ex[1:3,1:2])

# mean-median before transformation
vec = c(ex)
m = mean(vec)
md = median(vec)
diff = m - md
cat("m=", m, ", md=", md, ", diff=", diff, "\n")

res = lvTransformer(mat = ex)

# estimated model parameter
print(res$delta)

# mean-median after transformation
vec2 = c(res$mat2)
m2 = mean(vec2)
md2 = median(vec2)
diff2 = m2 - md2
cat("m2=", m2, ", md2=", md2, ", diff2=", diff2, "\n")
# }

Run the code above in your browser using DataLab