Package 'bayefdr'

Title: Bayesian Estimation and Optimisation of Expected False Discovery Rate
Description: Implements the Bayesian FDR control described by Newton et al. (2004), <doi:10.1093/biostatistics/5.2.155>. Allows optimisation and visualisation of expected error rates based on tail posterior probability tests. Based on code written by Catalina Vallejos for BASiCS, see Beyond comparisons of means: understanding changes in gene expression at the single-cell level Vallejos et al. (2016) <doi:10.1186/s13059-016-0930-3>.
Authors: Alan O'Callaghan [aut, cre], Catalina Vallejos [aut]
Maintainer: Alan O'Callaghan <[email protected]>
License: GPL-3
Version: 0.2.0
Built: 2024-11-12 04:57:13 UTC
Source: https://github.com/vallejosgroup/bayefdr

Help Index


The 'nibbles' package.

Description

A DESCRIPTION OF THE PACKAGE

References

Detecting differential gene expression with a semiparametric hierarchical mixture method Michael A. Newton, Amine Noueiry, Deepayan Sarkar, Paul Ahlquist https://doi.org/10.1093/biostatistics/5.2.155


Plot the cumulative median, mean, and 95% high posterior density region.

Description

Plot the cumulative median, mean, and 95% high posterior density region.

Usage

cumplot(x, ylab = NULL, burn = 0, thin = 1, hpd_level = 0.95)

Arguments

x

An vector of MCMC draws.

ylab

An optional y-axis label.

burn

Integer specifying the number of initial iterations to be discarded.

thin

Integer specifying the thinning factor to be used on the MCMC steps.

hpd_level

Floating point specifying the desired HPD level.

Value

A ggplot showing the cumulative mean, median and HPD.

Examples

x <- rnorm(1000)
cumplot(x)

EFDR and EFNR estimation

Description

Calculate the Expected False Discovery Rate (EFDR) or Expected False Negative Rate (EFNR) in a vector of probabilities, given a specified evidence threshold.

Usage

efdr(evidence_threshold, probs)

efnr(evidence_threshold, probs)

Arguments

evidence_threshold

Scalar value specifying the evidence threshold at which the EFDR or EFNR should be evaluated.

probs

Vector of probabilities.


Retrieve the index of the optimal probability threshold.

Description

Retrieve the index of the optimal probability threshold.

Usage

optimal(x)

Arguments

x

An object of class "bayefdr".

Value

The integer index of the optimal probability threshold.

Examples

probs <- runif(100)
 e <- efdr_search(probs, target_efdr = 0.1)
 optimal(e)
 e[optimal(e), ]

Plot the EFDR, EFNR grids of a bayefdr object.

Description

Plot the EFDR, EFNR grids of a bayefdr object.

Usage

## S3 method for class 'bayefdr'
plot(x, ...)

Arguments

x

An object of class bayefdr.

...

Unused.

Value

A ggplot.


Print methods for bayefdr objects.

Description

Print methods for bayefdr objects.

Usage

## S3 method for class 'bayefdr'
print(x, ...)

## S3 method for class 'bayefdr'
head(x, ...)

Arguments

x

An object of class bayefdr.

...

Unused.


Trace, marginal density histogram, and autocorrelation plot of MCMC draws.

Description

Trace, marginal density histogram, and autocorrelation plot of MCMC draws.

Usage

traceplot(x, ylab = NULL, log = FALSE)

Arguments

x

A vector of MCMC draws.

ylab

An optional y-axis label.

log

Logical scalar controlling whether the y-axis should be logged.

Value

A plot created using plot_grid showing the trace, marginal density histogram, and autocorrelation function of the MCMC draws in x.

Examples

x <- rnorm(1000)
traceplot(x)