MyNixOS website logo
Description

Bayesian Estimation and Optimisation of Expected False Discovery Rate.

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>.

bayefdr

R buildstatus CRANstatus downloads

The goal of bayefdr is to provide tools for the estimation and optimisation of Bayesian expected false discovery and expected false negative rates.

Installation

You can install the released version of bayefdr from CRAN with:

install.packages("bayefdr")
# development version:
## devtools::install_github("VallejosGroup/bayefdr")

Usage

The main functions in this package are efdr, efnr and efdr_search. efdr and efnr calculate the EFDR or EFNR for a vector of probabilities given a specified probability threshold. efdr_search finds the probability threshold that matches a target EFDR as closely as possible. The basic input to this function is a vector of probabilities and a target EFDR.

library("bayefdr")
set.seed(42)
probs <- runif(100)
efdr(0.7, probs)
#> [1] 0.1429126
efnr(0.7, probs)
#> [1] 0.3531349
efdr <- efdr_search(probs, target_efdr = 0.1)
efdr
#> An object of class 'bayefdr'.
#>  Optimal threshold: 0.768 EFDR: 0.0985 EFNR: 0.399

The output of this function is a data.frame with some extra attributes. There is a plot method too.

head(efdr)
#>   threshold     EFDR      EFNR
#> 1   0.50000 0.239581 0.2361073
#> 2   0.50025 0.239581 0.2361073
#> 3   0.50050 0.239581 0.2361073
#> 4   0.50075 0.239581 0.2361073
#> 5   0.50100 0.239581 0.2361073
#> 6   0.50125 0.239581 0.2361073
plot(efdr)
Metadata

Version

0.2.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD 13
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd13
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd13
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows