computeInfRV: Compute inferential relative variance (InfRV)

View source: R/helper.R

computeInfRVR Documentation

Compute inferential relative variance (InfRV)


InfRV is a useful quantity for comparing groups of features (transcripts, genes, etc.) by inferential uncertainty. This function provides computation of the mean InfRV over samples, per feature, stored in mcols(y)$meanInfRV.


computeInfRV(y, pc = 5, shift = 0.01, meanVariance, useCounts = FALSE)



a SummarizedExperiment


a pseudocount parameter for the denominator


a final shift parameter


logical, use pre-computed inferential mean and variance assays instead of counts and computed variance from infReps. If missing, will use pre-computed mean and variance when present


logical, whether to use the MLE count matrix for the mean instead of mean of inferential replicates. this argument is for backwards compatability, as previous versions used counts. Default is FALSE


InfRV is defined in Zhu et al. (2019) as: \max(s^2 - \mu, 0) / \mu, using the inferential sample variance and sample mean. This formulation takes the non-Poisson part of the inferential variance and scales by the mean, which effectively stabilizes inferential uncertainty over mean count. In practice, we also add pc to the denominator and shift to the final quantity, to facilitate visualization.

This function also computes and adds the mean and variance of inferential replicates, which can be useful ahead of plotInfReps. Note that InfRV is not used in the swish statistical method (for generating test statistics, p-values or q-values), it is just for visualization.


a SummarizedExperiment with meanInfRV in the metadata columns


Anqi Zhu, Avi Srivastava, Joseph G Ibrahim, Rob Patro, Michael I Love "Nonparametric expression analysis using inferential replicate counts" Nucleic Acids Research (2019).

mikelove/fishpond documentation built on Aug. 29, 2023, 2:45 p.m.