Git Product home page Git Product logo

pebblets / gsa.tissue.celltype.enrich Goto Github PK

View Code? Open in Web Editor NEW

This project forked from anacristina0914/gsa.tissue.celltype.enrich

0.0 0.0 0.0 21.32 MB

Repository containing source code, data, etc necessary to run Gene Set Analysis, Celltyping using MAGMA/Celltyping and Tissue Enrichment Analysis. Some of the formulas have been adapted from: NathanSkene/ALS_Human_EWCE, neurogenomics/EWCE, NathanSkene/MAGMA_Celltyping and jbryois/scRNA_disease github repositories.

R 100.00%

gsa.tissue.celltype.enrich's Introduction

GSA.Tissue.Celltype.Enrich

Ana Cristina Gonzalez Sanchez
University of Bologna / Karolinska Institutet
Contact

Introduction

GSA_Tissue_Celltype_Enrich is an R library intented to carry out in an easy manner Tissue enrichment analysis using data from GTEX, Celltype Enrichment Analysis using MAGMA-Celltyping or Geneset Enrichment Analysis for list of genes coming from differential expression analysis. Over representation of list of genes is tested in GWAS summary statistics.

Installation

if(!"devtools" %in% row.names(installed.packages())){
  install.packages("devtools")
}
library(devtools)

if(!"GSA_Tissue_Celltype_Enrich" %in% row.names(installed.packages())){
  install_github("Anacristina0914/GSA.Tissue.Celltype.Enrich")
}
library(GSA_Tissue_Celltype_Enrich) 

Gene Set Enrichment Analysis (GSA)

GWAS Summary Statistics Formatting

GWAS summary statistics must be formatted as specified in the MAGMA guidance. Briefly, the first three columns have to correspond to the SNP, CHR and BP (see example below):

SNP CHR BP P
rs1345 2 100123 0.01
rs18667 3 30566921 0.5611
rs145 16 9992021 0.173

This can be achieved either manually or using the formula format_sumstats_for_magma.r from the MAGMA_Celltyping package.

GSA Enrichment for up and down regulated genes in GTEx data

# Load required libraries for the package
load_required_libraries()

# Load GTEx gene expression data from Soma and Axon in human Motor Neurons. Only controls are loaded (C*).  
Human_SomaAxon_data <- GSA.Tissue.Celltype.Enrich::load_GTEx_data_conditional(path = "/Soma_Axon_RNA-Seq/GSE121069_GEO_rpkms_human.txt",pattern = "C*",sep = "\t")

# Load GTEx data annotation
Human_SomaAxon_annot <- GSA.Tissue.Celltype.Enrich::load_GTEx_annot_conditional(path = "/Soma_Axon_RNA-seq/", data = Human_SomaAxon, data_type = "Soma-Axon")

# Run Differential Expression analysis 
tt_human_SomaAxon <- GSA.Tissue.Celltype.Enrich::run_diffExp_analysis(annot = Human_SomaAxon_annot, data = Human_SomaAxon_data, expr_path = "/Soma_Axon_RNA-seq/", analysis_type = "D_Soma-Axon", species = "human")

# Map snps to genes and generate gene level p-value from summary statistics
genes.raw_path <- GSA.Tissue.Celltype.Enrich::map_snps_to_genes(gwas_path = "/ALS_sumstats.txt", N=NULL, genloc_filepath = "/genloc_files/NCBI37.3.gene.loc", genome_ref_path = "/g1000/g1000_eur",analysis_type = "D_Soma-Axon", species = "human")

# Run Gene Set Analysis (GSA) using MAGMA and up/down regulated genes from expression data and GWAS summary statistics.
GSA.Tissue.Celltype.Enrich::MAGMA_GSA(tt_filename = tt_human_SomaAxon, analysis_type = "D_Soma-Axon", genes.raw_path = genes.raw_path, species = "human", gene_n = 250)

Tissue Enrichment Analysis

Tissue Dataset Preparation

GTEx analysis v8 2017-06-05 gene-level median TPM by tissue dataset was retrieved from the GTEx database and further processed as described in Bryois et al. 2020[1] and its corresponding github repository jbryois/scRNA_disease. The final file used for the tissue enrichment analysis (top10.txt) contains the 10% most specific genes by tissue, where specificity is calculated dividiving the expression of each gene in a tissue divided by total expression of that gene in all tissues.

GWAS Summary Statistics and Genloc file Prepation

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

References

[1] Bryois, J., Skene, N. G., Hansen, T. F., Kogelman, L. J., Watson, H. J., Liu, Z., ... & Sullivan, P. F. (2020). Genetic identification of cell types underlying brain complex traits yields insights into the etiology of Parkinson’s disease. Nature genetics, 52(5), 482-493.

License

MIT

gsa.tissue.celltype.enrich's People

Contributors

anacristina0914 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.