This function takes the limits of a confidence interval (95 a calculate a variance

calc_vi(
  diffexp,
  llcol = NULL,
  rlcol = NULL,
  vcol = NULL,
  foldchangecol = "log2FC",
  statcol = "stat"
)

Arguments

diffexp

data.frame/data.table containing differential expression results

llcol

column name of the fold change coinfidence interval left limit name <string>

rlcol

column name of the fold change coinfidence interval left limit name <string>

vcol

column name of a pre-computed variance column <string> (optional)

foldchangecol

column name of the fold change <string> (used as fallback)

statcol

column name of the test statistic <string> (used as fallback)

Value

data.table/data.frame with a new vi variable

Examples

data(diffexplist)
diffexp <- calc_vi(diffexplist[[1]], "CI.L", "CI.R")
head(diffexp, 3)
#>     Symbol      Log2FC      pvalue       CI.L        CI.R          vi
#> 1     A1BG -0.70126879 0.000140100 -1.0087857 -0.39375189 0.024616472
#> 2 A1BG-AS1 -0.25106351 0.008694757 -0.4304790 -0.07164803 0.008379299
#> 3     A1CF  0.03332573 0.615989488 -0.1036882  0.17033968 0.004886720