Accessing GTEX RNA-seq data from Expression Atlas

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.

suppressMessages( library( ExpressionAtlas ) )
suppressMessages( library( SummarizedExperiment ) )
# Search for experiment. 
atlasRes <- searchAtlasExperiments( query = "gtex" )
atlasRes
## DataFrame with 2 rows and 4 columns
##     Accession      Species        Type                  Title
##   <character>  <character> <character>            <character>
## 1    E-GTEX-8 Homo sapiens    Baseline The Genotype-Tissue ..
## 2 E-MTAB-5200 Homo sapiens    Baseline The International Ca..
# Download experiment. 
gtex <- getAtlasExperiment( experimentAccession = "E-MTAB-5200" )
gtex
## List of length 1
## names(1): rnaseq
gtex$rnaseq
## class: RangedSummarizedExperiment 
## dim: 57820 2013 
## metadata(4): pipeline filtering mapping quantification
## assays(1): counts
## rownames(57820): ENSG00000000003 ENSG00000000005 ... ENSGR0000266731
##   ENSGR0000270726
## rowData names(0):
## colnames(2013): SRR1068687 SRR1068855 ... SRR821666 SRR821690
## colData names(8): AtlasAssayGroup organism ... organism_part
##   clinical_information
assays( gtex$rnaseq )$counts[1:5,1:5]
##                 SRR1068687 SRR1068855 SRR1068929 SRR1068953 SRR1068977
## ENSG00000000003        303        132        293        616       1456
## ENSG00000000005          0         37          4          0         25
## ENSG00000000419        730        907        710        681       1087
## ENSG00000000457        651        275        368        485        935
## ENSG00000000460        199         34         59        173        204
dim( assays( gtex$rnaseq )$counts )
## [1] 57820  2013
colData( gtex$rnaseq )
## DataFrame with 2013 rows and 8 columns
##            AtlasAssayGroup     organism  individual         sex     disease
##                <character>  <character> <character> <character> <character>
## SRR1068687             g48 Homo sapiens   GTEX-XXEK        male      normal
## SRR1068855             g63 Homo sapiens   GTEX-XOTO        male      normal
## SRR1068929             g50 Homo sapiens   GTEX-PWN1      female      normal
## SRR1068953             g64 Homo sapiens   GTEX-PWN1      female      normal
## SRR1068977             g40 Homo sapiens   GTEX-XBED        male      normal
## ...                    ...          ...         ...         ...         ...
## SRR821602              g23 Homo sapiens   GTEX-OHPN      female      normal
## SRR821626              g22 Homo sapiens   GTEX-WZTO        male      normal
## SRR821653              g39 Homo sapiens   GTEX-WOFL        male      normal
## SRR821666              g59 Homo sapiens   GTEX-P4PP      female      normal
## SRR821690              g51 Homo sapiens   GTEX-NPJ8        male      normal
##              histology          organism_part clinical_information
##            <character>            <character>          <character>
## SRR1068687             esophagogastric junc..                     
## SRR1068855             skeletal muscle tissue                     
## SRR1068929             esophagus muscularis..                     
## SRR1068953                            stomach                     
## SRR1068977                             breast                     
## ...                ...                    ...                  ...
## SRR821602              Brodmann (1909) area 9                     
## SRR821626              Brodmann (1909) area..                     
## SRR821653                               blood                     
## SRR821666                            pancreas                     
## SRR821690                  hippocampus proper
metadata( gtex$rnaseq )
## $pipeline
## [1] "PCAWG version RNA-seq analysis (https://dcc.icgc.org/pcawg)pipeline"
## 
## $filtering
## [1] "Discard reads below minimum quality threshold"                                 
## [2] "Check of bacterial contamination; discard offending reads"                     
## [3] "Discard reads with common uncalled characters (e.g. N)"                        
## [4] "Remove reads from pair-end libraries that were orphaned by filtering steps 1-3"
## 
## $mapping
## [1] "Against genome reference (Ensembl release: 75) <!-- TopHat version -->"
## 
## $quantification
## [1] "htseq2 version: 0.6.1p1"
# Download normalised expression data for experiment. 
gtex_tpm <- getNormalisedAtlasExpression( experimentAccession = "E-MTAB-5200", normalisation = "tpm" )
head(gtex_tpm)
##            GeneID Gene.Name B-cell non-Hodgkin lymphoma; blood
## 1 ENSG00000000003    TSPAN6                                  4
## 2 ENSG00000000005      TNMD                                0.1
## 3 ENSG00000000419      DPM1                                118
## 4 ENSG00000000457     SCYL3                                 10
## 5 ENSG00000000460  C1orf112                                 10
## 6 ENSG00000000938       FGR                                 32
##   endometrial adenocarcinoma; uterus esophageal adenocarcinoma; esophagus
## 1                                 83                                  108
## 2                                0.1                                    0
## 3                                 59                                  185
## 4                                  5                                   15
## 5                                  4                                    8
## 6                                  4                                    9
##   follicular thyroid carcinoma; thyroid gland gastric adenocarcinoma; stomach
## 1                                          61                              40
## 2                                         0.1                               0
## 3                                          77                              95
## 4                                           7                               7
## 5                                           2                               4
## 6                                           6                               7
##   glioblastoma multiforme; brain glioma; brain
## 1                             93            51
## 2                            0.3           0.1
## 3                             76            46
## 4                              6             6
## 5                              5             2
## 6                             10             6
##   head and neck squamous cell carcinoma; mouth mucosa
## 1                                                  38
## 2                                                   0
## 3                                                  82
## 4                                                   6
## 5                                                   6
## 6                                                   8
##   hepatocellular carcinoma; liver invasive lobular carcinoma; breast
## 1                              92                                 51
## 2                               0                                0.5
## 3                              63                                114
## 4                               7                                 15
## 5                               3                                 10
## 6                               3                                  9
##   lung adenocarcinoma; lung
## 1                        65
## 2                         0
## 3                        72
## 4                         8
## 5                         4
## 6                        11
##   bladder transitional cell carcinoma; urinary bladder lymphoma; blood
## 1                                                  105               2
## 2                                                  0.1               0
## 3                                                  101             138
## 4                                                    8              12
## 5                                                    4              18
## 6                                                    5              30
##   melanoma; skin normal - Brodmann (1909) area 24 (GTEx); brain
## 1             45                                              7
## 2              0                                            0.3
## 3             81                                             37
## 4              7                                              3
## 5              6                                            0.8
## 6              6                                              6
##   normal - Brodmann (1909) area 9 (GTEx); brain
## 1                                             7
## 2                                           0.2
## 3                                            39
## 4                                             3
## 5                                           0.8
## 6                                             7
##   normal - C1 segment of cervical spinal cord (GTEx); brain
## 1                                                         7
## 2                                                       0.1
## 3                                                        27
## 4                                                         3
## 5                                                         2
## 6                                                        12
##   normal - adjacent to bladder transitional cell carcinoma; urinary bladder
## 1                                                                       101
## 2                                                                       0.2
## 3                                                                        72
## 4                                                                         5
## 5                                                                         2
## 6                                                                         7
##   normal - adjacent to breast adenocarcinoma; breast
## 1                                                 96
## 2                                                 14
## 3                                                 95
## 4                                                 14
## 5                                                  4
## 6                                                 10
##   normal - adjacent to cholangiocarcinoma; liver
## 1                                             61
## 2                                              0
## 3                                             45
## 4                                              6
## 5                                              1
## 6                                              6
##   normal - adjacent to chromophobe renal cell carcinoma; kidney
## 1                                                           145
## 2                                                             2
## 3                                                            76
## 4                                                             9
## 5                                                             1
## 6                                                             8
##   normal - adjacent to endometrial adenocarcinoma; uterus
## 1                                                     185
## 2                                                     0.1
## 3                                                      57
## 4                                                       8
## 5                                                       2
## 6                                                       2
##   breast adenocarcinoma; breast
## 1                            56
## 2                           0.3
## 3                           114
## 4                            12
## 5                             8
## 6                             7
##   normal - adjacent to follicular thyroid carcinoma; thyroid gland
## 1                                                               66
## 2                                                              0.1
## 3                                                               95
## 4                                                               10
## 5                                                                2
## 6                                                                5
##   normal - adjacent to gastric adenocarcinoma; stomach
## 1                                                   37
## 2                                                  0.1
## 3                                                   32
## 4                                                    4
## 5                                                  0.7
## 6                                                    3
##   normal - adjacent to head and neck squamous cell carcinoma; mouth mucosa
## 1                                                                       31
## 2                                                                      0.2
## 3                                                                       53
## 4                                                                        3
## 5                                                                        2
## 6                                                                        3
##   normal - adjacent to hepatocellular carcinoma; liver
## 1                                                   60
## 2                                                    0
## 3                                                   39
## 4                                                    4
## 5                                                    1
## 6                                                    5
##   normal - adjacent to lung adenocarcinoma; lung
## 1                                             32
## 2                                              0
## 3                                             61
## 4                                              7
## 5                                              1
## 6                                             53
##   normal - adjacent to prostate adenocarcinoma; prostate gland
## 1                                                           21
## 2                                                           44
## 3                                                           49
## 4                                                            6
## 5                                                            1
## 6                                                            2
##   normal - adjacent to renal cell carcinoma; kidney
## 1                                                66
## 2                                                 3
## 3                                                55
## 4                                                 4
## 5                                               0.8
## 6                                                 3
##   normal - adjacent to squamous cell lung carcinoma; lung
## 1                                                      54
## 2                                                     0.1
## 3                                                      76
## 4                                                       8
## 5                                                       2
## 6                                                      69
##   normal - amygdala (GTEx); brain normal - blood (GTEx); blood
## 1                              12                          0.3
## 2                             0.2                            0
## 3                              26                           16
## 4                               2                            3
## 5                             0.9                          0.7
## 6                               7                          708
##   cervical adenocarcinoma; uterine cervix normal - breast (GTEx); breast
## 1                                      71                             50
## 2                                     0.1                             14
## 3                                     159                             69
## 4                                       7                             11
## 5                                       9                              3
## 6                                       3                             24
##   normal - caudate nucleus (GTEx); brain
## 1                                     12
## 2                                    0.1
## 3                                     28
## 4                                      2
## 5                                    0.9
## 6                                      7
##   normal - cerebellar hemisphere (GTEx); brain
## 1                                            3
## 2                                            0
## 3                                           54
## 4                                            8
## 5                                            4
## 6                                            4
##   normal - cerebellum (GTEx); brain normal - cerebral cortex (GTEx); brain
## 1                                 4                                      6
## 2                                 0                                    0.3
## 3                                48                                     35
## 4                                 8                                      4
## 5                                 4                                      1
## 6                                 4                                      7
##   normal - cortex of kidney (GTEx); kidney
## 1                                       18
## 2                                      0.4
## 3                                       30
## 4                                        4
## 5                                      0.7
## 6                                        6
##   normal - ectocervix (GTEx); uterine cervix
## 1                                         52
## 2                                        0.2
## 3                                         75
## 4                                         10
## 5                                          4
## 6                                         16
##   normal - endocervix (GTEx); uterine cervix
## 1                                         67
## 2                                        0.1
## 3                                         80
## 4                                         13
## 5                                          4
## 6                                         22
##   normal - esophagogastric junction (GTEx); esophagus
## 1                                                  11
## 2                                                 0.2
## 3                                                  59
## 4                                                   7
## 5                                                   2
## 6                                                  12
##   normal - esophagus mucosa (GTEx); esophagus
## 1                                          60
## 2                                         0.1
## 3                                          60
## 4                                           7
## 5                                           2
## 6                                           7
##   cervical squamous cell carcinoma; uterine cervix
## 1                                               55
## 2                                                0
## 3                                              128
## 4                                                6
## 5                                                7
## 6                                                6
##   normal - esophagus muscularis mucosa (GTEx); esophagus
## 1                                                     10
## 2                                                    0.2
## 3                                                     59
## 4                                                      7
## 5                                                      2
## 6                                                     10
##   normal - hippocampus proper (GTEx); brain normal - hypothalamus (GTEx); brain
## 1                                         9                                  12
## 2                                       0.3                                 0.2
## 3                                        30                                  35
## 4                                         3                                   3
## 5                                       0.9                                   1
## 6                                         7                                   9
##   normal - liver (GTEx); liver normal - lower leg skin (GTEx); skin
## 1                           41                                   15
## 2                            0                                    4
## 3                           34                                   55
## 4                            5                                    8
## 5                            1                                    2
## 6                            8                                    9
##   normal - lung (GTEx); lung normal - minor salivary gland (GTEx); mouth mucosa
## 1                         20                                                 52
## 2                          0                                                  1
## 3                         63                                                 65
## 4                          8                                                  9
## 5                          2                                                  2
## 6                        164                                                 16
##   normal - nucleus accumbens (GTEx); brain normal - ovary (GTEx); ovary
## 1                                       12                          126
## 2                                      0.1                            2
## 3                                       31                           81
## 4                                        3                           11
## 5                                      0.9                            4
## 6                                        6                            5
##   normal - pancreas (GTEx); pancreas cholangiocarcinoma; liver
## 1                                 13                        53
## 2                                0.1                         0
## 3                                 37                        76
## 4                                  4                         9
## 5                                0.8                         4
## 6                                  3                        11
##   normal - prostate gland (GTEx); prostate gland normal - putamen (GTEx); brain
## 1                                             35                              7
## 2                                            0.4                              0
## 3                                             65                             22
## 4                                             10                              2
## 5                                              3                            0.7
## 6                                             13                              6
##   normal - sigmoid colon (GTEx); large intestine
## 1                                             22
## 2                                            0.3
## 3                                             57
## 4                                              8
## 5                                              2
## 6                                             13
##   normal - skeletal muscle tissue (GTEx); skeletal muscle tissue
## 1                                                              3
## 2                                                            0.3
## 3                                                             42
## 4                                                              4
## 5                                                            0.5
## 6                                                              3
##   normal - stomach (GTEx); stomach normal - substantia nigra (GTEx); brain
## 1                               20                                       9
## 2                              0.1                                     0.3
## 3                               51                                      28
## 4                                6                                       3
## 5                                2                                       1
## 6                                6                                      12
##   normal - suprapubic skin (GTEx); skin
## 1                                    13
## 2                                     3
## 3                                    54
## 4                                     8
## 5                                     2
## 6                                     8
##   normal - thyroid gland (GTEx); thyroid gland
## 1                                           30
## 2                                          0.3
## 3                                           70
## 4                                           11
## 5                                            3
## 6                                           16
##   normal - transverse colon (GTEx); large intestine
## 1                                                67
## 2                                               0.9
## 3                                                47
## 4                                                 7
## 5                                                 2
## 6                                                 8
##   normal - urinary bladder (GTEx); urinary bladder
## 1                                               43
## 2                                              0.3
## 3                                               65
## 4                                               12
## 5                                                3
## 6                                               13
##   chromophobe renal cell carcinoma; kidney normal - uterus (GTEx); uterus
## 1                                       31                             53
## 2                                      0.2                            0.3
## 3                                       55                             82
## 4                                        3                             10
## 5                                      0.6                              4
## 6                                        2                             19
##   ovarian adenocarcinoma; ovary pancreatic adenocarcinoma; pancreas
## 1                           219                                  61
## 2                           0.6                                   0
## 3                           392                                 139
## 4                            20                                  21
## 5                            15                                   8
## 6                            14                                  11
##   prostate adenocarcinoma; prostate gland renal cell carcinoma; kidney
## 1                                      78                           47
## 2                                     0.4                          0.3
## 3                                      66                           56
## 4                                       9                            5
## 5                                       2                            2
## 6                                       5                           14
##   sarcoma; skeletal muscle tissue squamous cell lung carcinoma; lung
## 1                              32                                 65
## 2                               2                                  0
## 3                              87                                124
## 4                               6                                  8
## 5                               4                                  8
## 6                               4                                 11
##   chronic lymphocytic leukemia; blood
## 1                                   0
## 2                                   0
## 3                                  73
## 4                                  12
## 5                                  11
## 6                                 441
##   colorectal adenocarcinoma; large intestine tissue marker_gene_rank
## 1                                        143   <NA>               NA
## 2                                          1   <NA>               NA
## 3                                         97   <NA>               NA
## 4                                          6   <NA>               NA
## 5                                          5   <NA>               NA
## 6                                          4   <NA>               NA
# 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 )

sessionInfo()
## R version 4.6.2 (2026-10-29)
## Platform: x86_64-pc-linux-gnu
## Running under: Ubuntu 26.04.1 LTS
## 
## Matrix products: default
## BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.32.so;  LAPACK version 3.12.0
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## time zone: Etc/UTC
## tzcode source: system (glibc)
## 
## attached base packages:
## [1] stats4    stats     graphics  grDevices utils     datasets  methods  
## [8] base     
## 
## other attached packages:
##  [1] SummarizedExperiment_1.43.0 GenomicRanges_1.65.4       
##  [3] Seqinfo_1.3.2               IRanges_2.47.5             
##  [5] S4Vectors_0.51.10           MatrixGenerics_1.25.0      
##  [7] matrixStats_1.5.0           ExpressionAtlas_2.5.0      
##  [9] Biobase_2.73.2              BiocGenerics_0.59.13       
## [11] generics_0.1.4             
## 
## loaded via a namespace (and not attached):
##   [1] DBI_1.3.0                   bitops_1.1-0               
##   [3] gridExtra_2.3.1             rlang_1.3.0                
##   [5] magrittr_2.0.5              clue_0.3-68                
##   [7] GetoptLong_1.1.1            otel_0.3.0                 
##   [9] compiler_4.6.2              RSQLite_3.53.3             
##  [11] dir.expiry_1.21.0           reshape2_1.4.5             
##  [13] png_0.1-9                   vctrs_0.7.3                
##  [15] stringr_1.6.0               pkgconfig_2.0.3            
##  [17] shape_1.4.6.1               crayon_1.5.3               
##  [19] fastmap_1.2.0               XVector_0.53.0             
##  [21] caTools_1.18.4              rmarkdown_2.32             
##  [23] purrr_1.2.2                 bit_4.6.0                  
##  [25] xfun_0.62                   cachem_1.1.0               
##  [27] jsonlite_2.0.0              blob_1.3.0                 
##  [29] rhdf5filters_1.25.5         DelayedArray_0.39.8        
##  [31] Rhdf5lib_2.1.0              cluster_2.1.8.3            
##  [33] parallel_4.6.2              R6_2.6.1                   
##  [35] stringi_1.8.9               bslib_0.12.0               
##  [37] RColorBrewer_1.1-3          limma_3.99.5               
##  [39] reticulate_1.47.0           genefilter_1.95.0          
##  [41] jquerylib_0.1.4             Rcpp_1.1.2                 
##  [43] iterators_1.0.14            knitr_1.52                 
##  [45] BiocBaseUtils_1.15.1        Matrix_1.7-6               
##  [47] splines_4.6.2               tidyselect_1.2.1           
##  [49] viridis_0.6.5               abind_1.4-8                
##  [51] yaml_2.3.12                 doParallel_1.0.17          
##  [53] gplots_3.3.0                codetools_0.2-20           
##  [55] curl_8.1.0                  zellkonverter_1.23.1       
##  [57] plyr_1.8.9                  lattice_0.23-1             
##  [59] tibble_3.3.1                KEGGREST_1.53.6            
##  [61] S7_0.2.2                    evaluate_1.0.5             
##  [63] survival_3.8-12             xml2_1.6.0                 
##  [65] circlize_0.4.18             Biostrings_2.81.9          
##  [67] pillar_1.11.1               BiocManager_1.30.27        
##  [69] filelock_1.0.3              KernSmooth_2.23-27         
##  [71] foreach_1.5.2               ggplot2_4.0.4              
##  [73] scales_1.4.0                BiocStyle_2.41.0           
##  [75] gtools_3.9.5                xtable_1.8-8               
##  [77] glue_1.8.1                  maketools_1.3.2            
##  [79] tools_4.6.2                 sys_3.4.3                  
##  [81] annotate_1.91.1             buildtools_1.0.0           
##  [83] XML_3.99-0.25               rhdf5_2.57.20              
##  [85] grid_4.6.2                  tidyr_1.3.2                
##  [87] AnnotationDbi_1.75.2        edgeR_4.99.13              
##  [89] colorspace_2.1-4            SingleCellExperiment_1.35.2
##  [91] basilisk_1.25.0             HDF5Array_1.41.7           
##  [93] cli_3.6.6                   viridisLite_0.4.3          
##  [95] S4Arrays_1.13.2             ComplexHeatmap_2.29.0      
##  [97] dplyr_1.2.1                 gtable_0.3.6               
##  [99] sass_0.4.10                 digest_0.6.39              
## [101] SparseArray_1.13.5          rjson_0.2.23               
## [103] farver_2.1.2                memoise_2.0.1              
## [105] htmltools_0.5.9             lifecycle_1.0.5            
## [107] h5mread_1.5.6               httr_1.4.9                 
## [109] GlobalOptions_0.1.4         statmod_1.5.2              
## [111] bit64_4.8.6