guhjy / mashr

An R package for multivariate adaptive shrinkage.

Home Page:https://stephenslab.github.io/mashr

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mashr: Multivariate Adaptive Shrinkage in R

Travis Build Status Appveyor Build status codecov

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

The methods use Empirical Bayes methods to estimate patterns of similarity among conditions, and then exploit those patterns of similarity among conditions to improve accuracy of effect estimates. See Urbut et al for details of the model and methods.

Note that this R package is a refactoring of the code originally used to create results for the paper. The original package code is here.

Quick Start

  1. Follow the setup instructions below.

  2. See the Introductory Vignette for an introduction to mashr.

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

Setup

Please follow these steps to install the latest version of the mashr package:

  1. In R, install these three R packages from CRAN:

    install.packages(c("assertthat","mvtnorm","rmeta"))
  2. Optionally, install the package used for memory profiling:

    install.packages("profmem")
  3. Optionally, install MOSEK and the Rmosek package, for faster optimization in the ashr package. See the ashr Github repository for details.

  4. Install the ExtremeDeconvolution R package. Note that you will need to link to the GNU Scientific Library to build this package.

  5. Once you have installed all these packages, you can install and load the latest release of the mashr package:

    library(devtools)
    install_github("stephenslab/mashr@v0.2-6")
    library(mashr)

    This command should automatically retrieve and install the ashr package from Github. If it does not, install ashr separately using devtools:

    library(devtools)
    install_github("stephens999/ashr")

    Alternatively, if you have cloned the repository locally, you can install the package by following these steps:

    R CMD build mashr
    R CMD INSTALL mashr_0.2-6.tar.gz
    

Developer notes

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

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

library(pkgdown)
build_site(mathjax = FALSE)

Citation

If the data or code in this repository are useful for your research project, please cite our preprint:

S M Urbut, G Wang, M Stephens. Flexible statistical methods for estimating and testing effects in genomic studies with multiple conditions. bioRxiv doi:10.1101/096552.

About

An R package for multivariate adaptive shrinkage.

https://stephenslab.github.io/mashr

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:R 63.1%Language:C 19.9%Language:C++ 16.0%Language:Shell 1.0%