## ----setup, include=FALSE----------------------------------------------------- knitr::opts_chunk$set(message=FALSE) knitr::opts_chunk$set(warning=FALSE) ## ----------------------------------------------------------------------------- invisible(lapply( c("ExpressionAtlas", "SummarizedExperiment", "SingleCellExperiment", "ggplot2"), function(pkg) suppressMessages(library(pkg, character.only = TRUE)) )) ## ----eval=FALSE--------------------------------------------------------------- # atlas_res <- searchAtlasExperiments( query = "salt", secondaryFilter = "oryza" ) # # Searching for experiments matching your query ... # # Query successful. # # Found 4 experiments matching your query. ## ----echo=FALSE--------------------------------------------------------------- data( "atlasRes" ) ## ----------------------------------------------------------------------------- atlasRes ## ----------------------------------------------------------------------------- searchAtlasExperiments( query = "lung" , detailed = FALSE ) ## ----------------------------------------------------------------------------- searchAtlasExperiments( query = "lung" , detailed = TRUE ) ## ----------------------------------------------------------------------------- searchAtlasExperiments( query = "lung", secondaryFilter = "human", detailed = FALSE ) searchAtlasExperiments( query = "lung", secondaryFilter = "human", detailed = TRUE ) ## ----eval=FALSE--------------------------------------------------------------- # allExps <- getAtlasData( atlasRes$Accession ) # # Downloading Expression Atlas experiment summary from: # # ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/atlas/experiments/E-GEOD-11175/E-GEOD-11175-atlasExperimentSummary.Rdata # # Successfully downloaded experiment summary object for E-GEOD-11175 # # Downloading Expression Atlas experiment summary from: # # ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/atlas/experiments/E-MTAB-1625/E-MTAB-1625-atlasExperimentSummary.Rdata # # Successfully downloaded experiment summary object for E-MTAB-1625 # # Downloading Expression Atlas experiment summary from: # # ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/atlas/experiments/E-MTAB-1624/E-MTAB-1624-atlasExperimentSummary.Rdata # # Successfully downloaded experiment summary object for E-MTAB-1624 ## ----echo=FALSE--------------------------------------------------------------- data( "allExps" ) ## ----------------------------------------------------------------------------- allExps ## ----eval=FALSE--------------------------------------------------------------- # rnaseqExps <- getAtlasData( # atlasRes$Accession[ # grep( # "rna-seq", # atlasRes$Type, # ignore.case = TRUE # ) # ] # ) # # Downloading Expression Atlas experiment summary from: # # ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/atlas/experiments/E-MTAB-1625/E-MTAB-1625-atlasExperimentSummary.Rdata # # Successfully downloaded experiment summary object for E-MTAB-1625 ## ----echo=FALSE--------------------------------------------------------------- data( "rnaseqExps" ) ## ----------------------------------------------------------------------------- rnaseqExps ## ----------------------------------------------------------------------------- mtab1624 <- allExps[[ "E-MTAB-1624" ]] mtab1625 <- allExps[[ "E-MTAB-1625" ]] ## ----------------------------------------------------------------------------- sumexp <- mtab1625$rnaseq sumexp ## ----------------------------------------------------------------------------- head( assays( sumexp )$counts ) ## ----------------------------------------------------------------------------- colData( sumexp ) ## ----------------------------------------------------------------------------- metadata( sumexp ) ## ----------------------------------------------------------------------------- names( mtab1624 ) affy126data <- mtab1624[[ "A-AFFY-126" ]] affy126data ## ----------------------------------------------------------------------------- head( exprs( affy126data ) ) ## ----------------------------------------------------------------------------- pData( affy126data ) ## ----------------------------------------------------------------------------- preproc( experimentData( affy126data ) ) ## ----eval=FALSE--------------------------------------------------------------- # mtab3007 <- getAtlasExperiment( "E-MTAB-3007" ) # # Downloading Expression Atlas experiment summary from: # # ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/atlas/experiments/E-MTAB-3007/E-MTAB-3007-atlasExperimentSummary.Rdata # # Successfully downloaded experiment summary object for E-MTAB-3007 ## ----eval=FALSE--------------------------------------------------------------- # mtab4045_tpm <- getNormalisedAtlasExpression( "E-MTAB-4045", "tpm" ) # # Downloading XML file from FTP... # # E-MTAB-4045 is rnaseq_mrna_baseline , will continue downloading data # # Downloading expression file from: # # ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/atlas/experiments/E-MTAB-4045/E-MTAB-4045-tpms.tsv # # Downloading XML file from FTP... ## ----eval=FALSE--------------------------------------------------------------- # mtab4045_cpm <- getNormalisedAtlasExpression( "E-MTAB-4045", "cpm" ) # # Downloading XML file from FTP... # # E-MTAB-4045 is rnaseq_mrna_baseline , will continue downloading data # # Downloading Expression Atlas experiment summary from: # # ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/atlas/experiments/E-MTAB-4045/E-MTAB-4045-atlasExperimentSummary.Rdata # # Successfully downloaded experiment summary object for E-MTAB-4045 ## ----eval=FALSE--------------------------------------------------------------- # mtab10104_dea <- getAnalyticsDifferentialAtlasExpression( "E-MTAB-10104" ) # # Downloading expression file from: # # ftp://ftp.ebi.ac.uk/pub/databases/microarray/data/atlas/experiments/E-MTAB-10104/E-MTAB-10104-analytics.tsv ## ----eval=TRUE, fig.width=7, fig.height=8------------------------------------- mtab4045_tpm <- getNormalisedAtlasExpression( "E-MTAB-4045", "tpm" ) mtab4045 <- heatmapAtlasExperiment( df = mtab4045_tpm, save_pdf = FALSE, show_plot = TRUE, palette = "viridis", top_n = 20, scaled = FALSE, show_heatmap_title = TRUE ) ## ----eval=TRUE, fig.width=7, fig.height=8------------------------------------- mtab4045_cpm <- getNormalisedAtlasExpression( "E-MTAB-4045", "cpm" ) mtab4045 <- heatmapAtlasExperiment( df = mtab4045_cpm, save_pdf = FALSE, show_plot = TRUE, palette = "viridis", top_n = 20, scaled = TRUE, show_heatmap_title = TRUE ) ## ----eval=TRUE, fig.width=7, fig.height=5------------------------------------- mtab10104_dea <- getAnalyticsDifferentialAtlasExpression( "E-MTAB-10104" ) head(mtab10104_dea) mtab10104 <- volcanoDifferentialAtlasExperiment( df = mtab10104_dea, save_pdf = FALSE, show_plot = TRUE, low_fc_colour = "Gray", high_fc_colour = "Blue", cutoff = 1, show_volcanoplot_title = TRUE ) ## ----------------------------------------------------------------------------- search_1 <- searchSCAtlasExperiments( query = "endoderm" ) print(search_1) search_2 <- searchSCAtlasExperiments( query = "endoderm", secondaryFilter = "human" ) print(search_2) search_3 <- searchSCAtlasExperiments( query = "endoderm", secondaryFilter = "mouse" ) print(search_3) search_4 <- searchSCAtlasExperiments( query = "arabidopsis" ) print(search_4) search_5 <- searchSCAtlasExperiments( query = "pluripotency" ) print(search_5) ## ----eval=FALSE--------------------------------------------------------------- # enad19 <- getAtlasSCExperiment( "E-ENAD-19" ) # # returns a SingleCellExperiment object # ## ----------------------------------------------------------------------------- egeod36552 <- getAtlasSCExperiment( "E-GEOD-36552" ) # returns a SingleCellExperiment object print("Reduced dimension names:") print(reducedDimNames(egeod36552)) print("Column data names:") print(colnames(colData(egeod36552))) plotDimRedSCAtlasExperiment(egeod36552, dimRed = "X_pca", colorby = "time" ) plotDimRedSCAtlasExperiment(egeod36552, dimRed = "X_umap_neighbors_n_neighbors_20", colorby = "cell_type") plotDimRedSCAtlasExperiment(egeod36552, dimRed = "X_umap_neighbors_n_neighbors_20", colorby = "louvain_resolution_2.0") + theme_classic() + theme(legend.position = "left") ## ----------------------------------------------------------------------------- egeod36552 <- getAtlasSCExperiment( "E-GEOD-36552" ) heatmapSCAtlasExperiment( egeod36552, genes=NULL, sel.K=NULL, scaleNormExp=TRUE, show_row_names=FALSE ) # heatmapSCAtlasExperiment( egeod36552, genes=NULL, sel.K=NULL, scaleNormExp=TRUE, show_row_names=FALSE ) heatmapSCAtlasExperiment( egeod36552, genes=NULL, sel.K=6, scaleNormExp=TRUE, show_row_names=FALSE ) ## ----------------------------------------------------------------------------- egeod36552 <- getAtlasSCExperiment( "E-GEOD-36552" ) heatmapSCAtlasExperiment( egeod36552, genes=c('ENSG00000151611','ENSG00000020577', 'ENSG00000188869' ), sel.K=NULL, scaleNormExp=FALSE, show_row_names=TRUE ) # heatmapSCAtlasExperiment( egeod36552, genes=c('ENSG00000151611','ENSG00000020577', 'ENSG00000188869' ), sel.K=NULL, scaleNormExp=TRUE, show_row_names=TRUE ) ## ----fig.width=7, fig.height=4------------------------------------------------ egeod36552 <- getAtlasSCExperiment( "E-GEOD-36552" ) # dotPlotSCAtlasExperiment(egeod36552, genes=c('ENSG00000166681','ENSG00000178928', 'ENSG00000142182' , 'ENSG00000160282' ), sel.K=4) dotPlotSCAtlasExperiment(egeod36552, genes=c('ENSG00000166681','ENSG00000178928', 'ENSG00000142182' , 'ENSG00000160282' ), sel.K=4, scaleNormExp=TRUE) + theme_classic() ## ----------------------------------------------------------------------------- sessionInfo()