--- title: "Accessing GTEX RNA-seq data from Expression Atlas" author: "Pedro Madrigal, Anil Thanki" affiliation: "EMBL-EBI" date: "`r Sys.Date()`" output: html_document: toc: false toc_depth: 3 number_sections: false bibliography: references.bib keywords: ["gene expression", "RNA-seq", "ExpressionAtlas", "Bioconductor"] vignette: > %\VignetteEngine{knitr::rmarkdown} %\VignetteIndexEntry{Accessing GTEX RNA-seq data from Expression Atlas} %\VignetteEncoding{UTF-8} --- This vignette demonstrates how to access and analyze GTEX RNA-seq data from Expression Atlas. The example shows how to: 1. Search GTEX data. 2. Retrieve GTEX data. 3. Get raw counts and normalized expression data. 4. Create heatmaps for visualization of gene expression patterns. 5. Filter and analyze specific genes of interest across GTEX tissues. The following example uses the `ExpressionAtlas` package to access `E-MTAB-5200` dataset (2013 samples). Please note, you can also use the same workflow with a newer dataset such as E-GTEX-8. Larger datasets may take longer to download and load. ```{r setup, include=FALSE} knitr::opts_chunk$set(message=FALSE, warning=TRUE) ``` ```{r load-package} suppressMessages( library( ExpressionAtlas ) ) suppressMessages( library( SummarizedExperiment ) ) ``` ```{r search-and-download-gtex} # Search for experiment. atlasRes <- searchAtlasExperiments( query = "gtex" ) atlasRes ``` ```{r downolad-GTEX} # Download experiment. gtex <- getAtlasExperiment( experimentAccession = "E-MTAB-5200" ) gtex gtex$rnaseq assays( gtex$rnaseq )$counts[1:5,1:5] dim( assays( gtex$rnaseq )$counts ) colData( gtex$rnaseq ) metadata( gtex$rnaseq ) ``` ```{r normalise-GTEX} # Download normalised expression data for experiment. gtex_tpm <- getNormalisedAtlasExpression( experimentAccession = "E-MTAB-5200", normalisation = "tpm" ) head(gtex_tpm) ``` ```{r gtex-tpm-heatmap, fig.width=7, fig.height=8} # Default heatmap plot. gtex_heatmap <- heatmapAtlasExperiment( df = gtex_tpm, save_pdf= FALSE, show_plot = TRUE, palette = "viridis", markers = TRUE, gene_list = NULL, top_n = NULL, scaled = FALSE, show_heatmap_title = TRUE ) # With gene list of interest. gtex_heatmap_genes <- heatmapAtlasExperiment( df = gtex_tpm, save_pdf= FALSE, show_plot = TRUE, palette = "viridis", markers = FALSE, gene_list = c("TP53", "CDKN2A", "ARID1A", "KRAS", "PTEN", "TERT", "CDKN2B", "SMAD4", "PIK3CA", "RB1"), top_n = NULL, scaled = FALSE, show_heatmap_title = TRUE ) ``` ```{r session-info} sessionInfo() ```