Accessing data from Single-Cell Expression Atlas

This vignette demonstrates how to access and visualize dataset E-GEOD-81383 from the Single-Cell Expression Atlas using the ExpressionAtlas package.

library( ExpressionAtlas ) 
library( SingleCellExperiment )
library( ggplot2 )
sc_search_results <- searchSCAtlasExperiments( query = "hematopoietic", secondaryFilter = "old" )
print(sc_search_results)
## DataFrame with 1 row and 4 columns
##      Accession      Species        Type                  Title
##    <character>  <character> <character>            <character>
## 1 E-GEOD-87631 Mus musculus  smart-seq2 Single-cell RNA-seq ..
geod81383 <- getAtlasSCExperiment( "E-GEOD-81383" )
## Installing pyenv ...
## Done! pyenv has been installed to '/github/home/.local/share/r-reticulate/pyenv/bin/pyenv'.
## Using Python: /github/home/.pyenv/versions/3.9.23/bin/python3.9
## Creating virtual environment '/github/home/.cache/R/basilisk/1.25.0/zellkonverter/1.23.1/zellkonverterAnnDataEnv-0.7.6' ...
## Done!
## Installing packages: pip, wheel, setuptools
## Installing packages: 'anndata==0.7.6', 'h5py==3.14.0', 'natsort==8.4.0', 'numpy==1.26.4', 'pandas==1.5.3', 'scipy==1.13.1'
## Virtual environment '/github/home/.cache/R/basilisk/1.25.0/zellkonverter/1.23.1/zellkonverterAnnDataEnv-0.7.6' successfully created.
geod81383
## class: SingleCellExperiment 
## dim: 23944 226 
## metadata(21): hvg markers_louvain_resolution_0.1 ... neighbors pca
## assays(3): X filtered normalised
## rownames(23944): ENSG00000000003 ENSG00000000419 ... ENSG00000289697
##   ENSG00000289716
## rowData names(27): gene_symbols chromosome ... dispersions_norm varm
## colnames(226): group77 group78 ... group75 group76
## colData names(36): age cell_line ... louvain_resolution_4.0
##   louvain_resolution_5.0
## reducedDimNames(21): X_pca X_tsne_perplexity_1 ...
##   X_umap_neighbors_n_neighbors_5 X_umap_neighbors_n_neighbors_50
## mainExpName: E-GEOD-81383
## altExpNames(0):
print("Reduced dimension names:")
## [1] "Reduced dimension names:"
print(reducedDimNames(geod81383 ))
##  [1] "X_pca"                            "X_tsne_perplexity_1"             
##  [3] "X_tsne_perplexity_10"             "X_tsne_perplexity_15"            
##  [5] "X_tsne_perplexity_20"             "X_tsne_perplexity_25"            
##  [7] "X_tsne_perplexity_30"             "X_tsne_perplexity_35"            
##  [9] "X_tsne_perplexity_40"             "X_tsne_perplexity_45"            
## [11] "X_tsne_perplexity_5"              "X_tsne_perplexity_50"            
## [13] "X_umap_neighbors_n_neighbors_10"  "X_umap_neighbors_n_neighbors_100"
## [15] "X_umap_neighbors_n_neighbors_15"  "X_umap_neighbors_n_neighbors_20" 
## [17] "X_umap_neighbors_n_neighbors_25"  "X_umap_neighbors_n_neighbors_3"  
## [19] "X_umap_neighbors_n_neighbors_30"  "X_umap_neighbors_n_neighbors_5"  
## [21] "X_umap_neighbors_n_neighbors_50"
print("Column data names:")
## [1] "Column data names:"
print(colnames(colData(geod81383 )))
##  [1] "age"                             "cell_line"                      
##  [3] "disease"                         "genotype"                       
##  [5] "metastatic_site"                 "organism_part"                  
##  [7] "organism"                        "sex"                            
##  [9] "single_cell_identifier"          "age_ontology"                   
## [11] "cell_line_ontology"              "disease_ontology"               
## [13] "genotype_ontology"               "metastatic_site_ontology"       
## [15] "organism_part_ontology"          "organism_ontology"              
## [17] "sex_ontology"                    "single_cell_identifier_ontology"
## [19] "n_genes_by_counts"               "log1p_n_genes_by_counts"        
## [21] "total_counts"                    "log1p_total_counts"             
## [23] "total_counts_mito"               "log1p_total_counts_mito"        
## [25] "pct_counts_mito"                 "n_counts"                       
## [27] "n_genes"                         "louvain_resolution_0.1"         
## [29] "louvain_resolution_0.3"          "louvain_resolution_0.5"         
## [31] "louvain_resolution_0.7"          "louvain_resolution_1.0"         
## [33] "louvain_resolution_2.0"          "louvain_resolution_3.0"         
## [35] "louvain_resolution_4.0"          "louvain_resolution_5.0"
# Colour the same UMAP by Louvain cluster, genotype, age, and cell line.

plotDimRedSCAtlasExperiment(geod81383, dimRed = "X_umap_neighbors_n_neighbors_20", colorby = "louvain_resolution_0.1", save_pdf = FALSE, plot_layers = list(ggplot2::theme_classic()))

plotDimRedSCAtlasExperiment(geod81383, dimRed = "X_umap_neighbors_n_neighbors_20", colorby = "genotype", save_pdf = FALSE, plot_layers = list(ggplot2::theme_classic()))

plotDimRedSCAtlasExperiment(geod81383, dimRed = "X_umap_neighbors_n_neighbors_20", colorby = "age", save_pdf = FALSE, plot_layers = list(ggplot2::theme_classic(), ggplot2::scale_colour_brewer(palette = "Set2")))

plotDimRedSCAtlasExperiment(geod81383, dimRed = "X_umap_neighbors_n_neighbors_20", colorby = "cell_line", save_pdf = FALSE, plot_layers = list(ggplot2::theme_classic() , ggplot2::scale_colour_brewer(palette = "Accent")))

# Plot marker genes for K = 3 using unscaled normalized expression.
heatmapSCAtlasExperiment(geod81383, genes=NULL, sel.K=3, scaleNormExp=FALSE, show_row_names=FALSE, save_pdf = FALSE ) 

# Plot the same marker genes after scaling expression for each gene.
heatmapSCAtlasExperiment(geod81383, genes=NULL, sel.K=3, scaleNormExp=TRUE, show_row_names=FALSE, save_pdf = FALSE) 

# Plot unscaled expression and display Gene names. 
dotPlotSCAtlasExperiment(geod81383, genes=c('ENSG00000185664', 'ENSG00000205777', 'CD36'), sel.K=3, scaleNormExp=TRUE, geneLabel = 'name', save_pdf = FALSE, dot_theme = list(ggplot2::theme_classic()))

# Plot scaled expression and display Gene IDs. 
dotPlotSCAtlasExperiment(geod81383, genes=c('ENSG00000185664','ENSG00000205777', 'CD36'), sel.K=3, scaleNormExp=TRUE, geneLabel = 'id', save_pdf = FALSE, dot_theme = list(ggplot2::theme_classic()))

sessionInfo

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] ggplot2_4.0.4               SingleCellExperiment_1.35.2
##  [3] SummarizedExperiment_1.43.0 GenomicRanges_1.65.4       
##  [5] Seqinfo_1.3.2               IRanges_2.47.5             
##  [7] S4Vectors_0.51.10           MatrixGenerics_1.25.0      
##  [9] matrixStats_1.5.0           ExpressionAtlas_2.5.0      
## [11] Biobase_2.73.2              BiocGenerics_0.59.13       
## [13] generics_0.1.4             
## 
## loaded via a namespace (and not attached):
##   [1] DBI_1.3.0             bitops_1.1-0          gridExtra_2.3.1      
##   [4] rlang_1.3.0           magrittr_2.0.5        clue_0.3-68          
##   [7] GetoptLong_1.1.1      otel_0.3.0            compiler_4.6.2       
##  [10] RSQLite_3.53.3        dir.expiry_1.21.0     reshape2_1.4.5       
##  [13] png_0.1-9             vctrs_0.7.3           stringr_1.6.0        
##  [16] pkgconfig_2.0.3       shape_1.4.6.1         crayon_1.5.3         
##  [19] fastmap_1.2.0         XVector_0.53.0        labeling_0.4.3       
##  [22] caTools_1.18.4        rmarkdown_2.32        purrr_1.2.2          
##  [25] bit_4.6.0             xfun_0.62             cachem_1.1.0         
##  [28] jsonlite_2.0.0        blob_1.3.0            rhdf5filters_1.25.5  
##  [31] DelayedArray_0.39.8   Rhdf5lib_2.1.0        cluster_2.1.8.3      
##  [34] parallel_4.6.2        R6_2.6.1              stringi_1.8.9        
##  [37] bslib_0.12.0          RColorBrewer_1.1-3    limma_3.99.5         
##  [40] reticulate_1.47.0     genefilter_1.95.0     jquerylib_0.1.4      
##  [43] Rcpp_1.1.2            iterators_1.0.14      knitr_1.52           
##  [46] BiocBaseUtils_1.15.1  Matrix_1.7-6          splines_4.6.2        
##  [49] tidyselect_1.2.1      viridis_0.6.5         abind_1.4-8          
##  [52] yaml_2.3.12           doParallel_1.0.17     gplots_3.3.0         
##  [55] codetools_0.2-20      curl_8.1.0            zellkonverter_1.23.1 
##  [58] plyr_1.8.9            lattice_0.23-1        tibble_3.3.1         
##  [61] withr_3.0.3           KEGGREST_1.53.6       S7_0.2.2             
##  [64] evaluate_1.0.5        survival_3.8-12       xml2_1.6.0           
##  [67] circlize_0.4.18       Biostrings_2.81.9     pillar_1.11.1        
##  [70] BiocManager_1.30.27   filelock_1.0.3        KernSmooth_2.23-27   
##  [73] foreach_1.5.2         scales_1.4.0          BiocStyle_2.41.0     
##  [76] gtools_3.9.5          xtable_1.8-8          glue_1.8.1           
##  [79] maketools_1.3.2       tools_4.6.2           sys_3.4.3            
##  [82] annotate_1.91.1       buildtools_1.0.0      XML_3.99-0.25        
##  [85] rhdf5_2.57.20         grid_4.6.2            tidyr_1.3.2          
##  [88] AnnotationDbi_1.75.2  edgeR_4.99.13         colorspace_2.1-4     
##  [91] basilisk_1.25.0       HDF5Array_1.41.7      cli_3.6.6            
##  [94] rappdirs_0.3.4        viridisLite_0.4.3     S4Arrays_1.13.2      
##  [97] ComplexHeatmap_2.29.0 dplyr_1.2.1           gtable_0.3.6         
## [100] sass_0.4.10           digest_0.6.39         SparseArray_1.13.5   
## [103] rjson_0.2.23          farver_2.1.2          memoise_2.0.1        
## [106] htmltools_0.5.9       lifecycle_1.0.5       h5mread_1.5.6        
## [109] httr_1.4.9            GlobalOptions_0.1.4   statmod_1.5.2        
## [112] bit64_4.8.6