stephenslab / mashr-paper

Multivariate adaptive shrinkage methods used for analysis GTEx data in Urbut et al (2017).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mashr-paper

This repository contains R source code implementing Empirical Bayes methods for simultaneously testing many effects in many conditions or outcomes. For more information on these methods and their application to the the Genotype-Tissue Expression (GTEx) study, please see Urbut et al, 2017.

Note: The primary purpose of this repository is to implement the analyses presented in the Urbut et al manuscript. We are also developing R and Julia packages for broader application; these packages can be found here and here.

Using the code

Although this repository has the standard structure of an R package, this package is in development, so it is recommended that you load the function definitions directly into your R environment rather than attempting to install this repository as a package. For example, this can be done by cloning or downloading this repository, setting your working directory to this repository on your computer, then running the following commands in R:

library(devtools)
load_all(export_all = TRUE)

This will load all the mashr functions into your environment without actually installing the package.

To start, we recommend walking through a small demonstration of mashr on simulated data, as well as a more advanced demonstration of mashr for estimating tissue-specific effects on gene expression.

Overview

A typical mashr analysis will include the following steps:

  • Generate a list of covariance matrices to capture patterns of sharing in the data. This may be done with predetermined matrices, or using a method that adapts the matrices to the data (e.g, using Extreme Deconvoluion.

  • Estimate weights reflecting the relative frequency of each pattern of sharing in the data.

  • (Optionally) Assess the model fit on a held-out test set, which is useful for comparing across models.

  • Compute the J x P conditional likelihood matrix, where J is the number of estimated effects and P is the number of mixture components.

  • Compute intermediate posterior quantities; e.g., means, tail probabilities, marginal subgroup-specific posterior variances.

  • Compute posterior quantities of interest; e.g., posterior mean, local false sign rate, marginal variance for the effect size in each condition.

License

Copyright (C) 2017, Sarah Urbut.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purchase. See the GNU General Public License for more details.

About

Multivariate adaptive shrinkage methods used for analysis GTEx data in Urbut et al (2017).

License:GNU General Public License v3.0


Languages

Language:HTML 97.7%Language:R 2.3%