MiXcan: Statistical Models for Cell-type Specific Transcriptome-Wide Association Studies with Bulk Tissue Data

Introduction

Considering the cell-type composition of a tissue, the goal of MiXcan is to

A full description of the method can be found in our paper.

knitr::opts_chunk$set(echo = TRUE)
library(MiXcan)

Installation

You can install the latest version directly from GitHub with devtools:

install.packages("devtools")
devtools::install_github("songxiaoyu/MiXcan")
````

## Example of use

Below is an example of MiXcan analysis pipeline.  

### Data

The sample data are included in the Github page. We will load the data:

```r
library(MiXcan)
load("data/example_data.rda")

MiXcan analysis pipeline

Step 1 (option): Improving the estimation of the cell-type composition Pi.

library(doParallel)
library(tidyverse)
nCores=detectCores()-1; registerDoParallel(nCores) # use parallel computing but leave 1 core out. 
pi_estimation_result <- pi_estimation(expression_matrix = GTEx_epithelial_genes,
              prior = GTEx_prior,
              n_iteration = 5)

Step 2. Estimating cell-type specific (and non-specific) prediction weights for the expression levels of a gene using the MiXcan function

set.seed(111)
foldid_example <- sample(1:10, length(y_example), replace=T)
MiXcan_result <- MiXcan(y=y_example, x=x_example, cov = cov_example, pi= pi_estimation_result$mean_trim_0.05, foldid = foldid_example)
MiXcan_result$beta.SNP.cell1
MiXcan_result$beta.SNP.cell2
  1. Extract the weights from the output of MiXcan function.
MiXcan_weight_result <- MiXcan_extract_weight(MiXcan_model = MiXcan_result)
MiXcan_weight_result
  1. Predict the cell-type specific or non-specific expression levels of a gene with MiXcan model in new genetic data.
MiXcan_prediction_result <- MiXcan_prediction(weight = MiXcan_weight_result, new_x = new_X_example)
MiXcan_prediction_result
  1. Association analysis with MiXcan predicted gene expression levels
MiXcan_association_result <- MiXcan_association(MiXcan_predicted_expr = MiXcan_prediction_result,
                                                covariates = covariates_example, outcome = outcome_example, family  = "binomial")
MiXcan_association_result


JiayiJi/MiXcan documentation built on Dec. 18, 2021, 1:30 a.m.