Description Usage Arguments Details Value Author(s) References Examples

View source: R/l2Transformer.R

Log based count transformation minimizing sum of sample-specific squared difference.

1 | ```
l2Transformer(mat, low = 1e-04, upp = 1000)
``` |

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

`low` |
lower bound for the model parameter |

`upp` |
upper bound for the model parameter |

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≤ft(x_{gi} + \frac{1}{δ}\right)*

. The optimal value for the parameter *δ* is to minimize the sum of the squared
difference between the sample mean and the sample median across *n* subjects

*∑_{i=1}^{n}≤ft(\bar{y}_i - \tilde{y}_i\right)^2*

,
*\bar{y}_i=∑_{g=1}^{G}y_{gi}/G* and
*\tilde{y}_i* is the median of *y_{1i}, …, y_{Gi}*, and
where *G* is the number of genes and *n* is the number of subjects.

A list with 3 elements:

`res.delta ` |
An object returned by |

`delta ` |
model parameter |

`mat2 ` |
transformed data matrix having the same dimension as |

Zeyu Zhang, Danyang Yu, Minseok Seo, Craig P. Hersh, Scott T. Weiss, Weiliang Qiu

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ```
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 = l2Transformer(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")
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.