Learn R Programming

lfc

R package for modelling count ratio data

How to get started

Install the R package using the following commands on the R console:

install.packages("lfc")
library(lfc)

Alternatively, you can install from github:

install.packages("devtools")
devtools::install_github("erhard-lab/lfc")
library(lfc)

Brief introduction

Digital expression measurements (e.g. RNA-seq) are often used to determine the change of quantities upon some treatment or stimulus. The resulting value of interest is the fold change (often logarithmized).

This effect size of the change is often treated as a value that can be computed as lfc(A,B) = log2 A/B. However, due to the probabilistic nature of the experiments, the effect size rather is a random variable that must be estimated. This fact becomes obvious when considering that A or B can be 0, even if the true abundance is non-zero.

We have shown that this can be modelled in a Bayesian framework. The intuitively computed effect size is the maximum likelihood estimator of a binomial model, where the effect size is not represented as fold change, but as proportion (of note, the log fold change simply is the logit transformed proportion). The Bayesian prior corresponds to pseudocounts frequently used to prevent infinite fold changes by A or B being zero. Furthermore, the Bayesian framework offers more advanced estimators (e.g. interval estimators or the posterior mean, which is the optimal estimator in terms of squared errors).

This R package offers the implementation to harness the power of this framework.

Copy Link

Version

Install

install.packages('lfc')

Monthly Downloads

255

Version

0.2.3

License

Apache License (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Florian Erhard

Last Published

April 19th, 2023

Functions in lfc (0.2.3)

PsiLFC

Psi LFC effect size estimator
CenterMedian

Subtract the median of the given vector (for normalizing log2 fold changes).
results

Psi LFC effect size estimator for DESeq2
ltop

Inverse logit transformation to obtain proportion representation from the log fold change representation.
ptol

Logit transformation to obtain the log fold change representation from the proportion representation.
EmpiricalBayesPrior

Computes the prior parameters (i.e. pseudocounts incremented by 1) for the log2 fold change distribution
NormLFC

Standard LFC effect size estimator
dlfc

The log2 fold change distribution
PsiLFC.se

Psi LFC effect size estimator