MyNixOS website logo
Description
Multivariate Adaptive Shrinkage
Implements the multivariate adaptive shrinkage (mash) method of Urbut et al (2019) <DOI:10.1038/s41588-018-0268-8> for estimating and testing large numbers of effects in many conditions (or many outcomes). Mash takes an empirical Bayes approach to testing and effect estimation; it estimates patterns of similarity among conditions, then exploits these patterns to improve accuracy of the effect estimates. The core linear algebra is implemented in C++ for fast model fitting and posterior computation.

mashr: Multivariate Adaptive Shrinkage in R

CRAN_Status_Badge Travis Build Status codecov

This package implements methods to estimate and test many effects in many conditions (or many effects on many outcomes).

Empirical Bayes methods are used to estimate patterns of similarity among conditions, then exploit these patterns of similarity among conditions to improve accuracy of effect estimates. See Urbut et al for details.

Note: the R package used to generate the results for the manuscript is here.

Quick Start

  1. Install mashr from CRAN: install.packages("mashr"). For more detailed setup instructions, see below.

  2. See the introductory vignette for an introduction to mashr.

  3. Then walk through these vignettes to learn more about mashr: Introduction to mash: data-driven covariances and Simulation with non-canonical matrices.

Citing this work

If you find the mashr package or any of the source code in this repository useful for your work, please cite:

Sarah Urbut, Gao Wang, Peter Carbonetto and Matthew Stephens (2019). Flexible statistical methods for estimating and testing effects in genomic studies with multiple conditions.Nature Genetics51, 187-195.

Setup

The simplest and quickest to obtain mashr is to install it from CRAN:

install.packages("mashr")

For Mac and Windows, usually the package is precompiled, so no additional compiler setup is required. If you have Linux, and in some other rare cases, you will need to make sure that your R installation is properly set up to compile packages with C++ source; in particular, the C++ compiler programs supported by your version of R should be installed on your computer, and R should be correctly configured to call these compilers when installing packages from source. For more information, see the CRAN documentation.

Alternatively, you may use remotes to install the latest version of mashr from GitHub:

install.packages("remotes")
remotes::install_github("stephenslab/mashr")

This command should automatically install any missing dependencies that are available from CRAN and GitHub.

Developer notes

  • When any changes are made to roxygen2 markup or the C++ code in the src directory, run devtools::document() to update the RcppExports.cpp, the package namespaces (see NAMESPACE), and the package documentation files (in the "man" subdirectory),

  • These are the R commands to build the website (make sure you are connected to Internet while running these commands):

    pkgdown::build_site(lazy=TRUE, examples=FALSE)
    
  • After editing C++ code in the src directory, please use uncrustify to format the code using configuration file inst/misc/uncrustify_default.cfg. For example:

    uncrustify -c uncrustify_default.cfg --replace --no-backup -l CPP mash.cpp
    
  • Prior to submitting the package to CRAN, the following modifications need to be made: (1) remove the Remotes: entry in DESCRIPTION; and (2) remove the flash_mash.Rmd vignette.

Metadata

Version

0.2.79

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    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-freebsd
  • 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-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows