MiXcan: Statistical Models for Cell-type Specific Transcriptome-Wide Association Studies with Bulk Tissue Data
Considering the cell-type composition of a tissue, the goal of MiXcan is to
Provide the cell-type specific gene expression levels and improve the prediction accuracy for the tissue.
Boost the study power for gene identifications in TWAS and shed light on the functional cell type(s) of the associations.
A full description of the method can be found in our paper.
knitr::opts_chunk$set(echo = TRUE) library(MiXcan)
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")
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
MiXcan_weight_result <- MiXcan_extract_weight(MiXcan_model = MiXcan_result) MiXcan_weight_result
MiXcan_prediction_result <- MiXcan_prediction(weight = MiXcan_weight_result, new_x = new_X_example) MiXcan_prediction_result
MiXcan_association_result <- MiXcan_association(MiXcan_predicted_expr = MiXcan_prediction_result, covariates = covariates_example, outcome = outcome_example, family = "binomial") MiXcan_association_result
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.