This function downloads from ExperimentHub Visium, Visium Spatial Proteogenomics (Visium-SPG), or single nucleus RNA-seq (snRNA-seq) data and results analyzed by LIBD from multiple projects. If ExperimentHub is not available, this function will download the files from Dropbox using BiocFileCache::bfcrpath() unless the files are present already at destdir. Note that ExperimentHub and BiocFileCache will cache the data and automatically detect if you have previously downloaded it, thus making it the preferred way to interact with the data.

fetch_data(
  type = c("sce", "sce_layer", "modeling_results", "sce_example", "spe",
    "spatialDLPFC_Visium", "spatialDLPFC_Visium_example_subset",
    "spatialDLPFC_Visium_pseudobulk", "spatialDLPFC_Visium_modeling_results",
    "spatialDLPFC_Visium_SPG", "spatialDLPFC_snRNAseq",
    "Visium_SPG_AD_Visium_wholegenome_spe", "Visium_SPG_AD_Visium_targeted_spe",
    "Visium_SPG_AD_Visium_wholegenome_pseudobulk_spe",
    "Visium_SPG_AD_Visium_wholegenome_modeling_results"),
  destdir = tempdir(),
  eh = ExperimentHub::ExperimentHub(),
  bfc = BiocFileCache::BiocFileCache()
)

Arguments

type

A character(1) specifying which file you want to download. It can either be: sce for the SingleCellExperiment object containing the spot-level data that includes the information for visualizing the clusters/genes on top of the Visium histology, sce_layer for the SingleCellExperiment object containing the layer-level data (pseudo-bulked from the spot-level), or modeling_results for the list of tables with the enrichment, pairwise, and anova model results from the layer-level data. It can also be sce_example which is a reduced version of sce just for example purposes. The initial version of spatialLIBD downloaded data only from https://github.com/LieberInstitute/HumanPilot. As of BioC version 3.13 spe downloads a SpatialExperiment-class object. As of version 1.11.6, this function also allows downloading data from the http://research.libd.org/spatialDLPFC/ project. As of version 1.11.12, data from https://github.com/LieberInstitute/Visium_SPG_AD can be downloaded.

destdir

The destination directory to where files will be downloaded to in case the ExperimentHub resource is not available. If you already downloaded the files, you can set this to the current path where the files were previously downloaded to avoid re-downloading them.

eh

An ExperimentHub object ExperimentHub-class.

bfc

A BiocFileCache object BiocFileCache-class. Used when eh is not available.

Value

The requested object: sce, sce_layer, ve or modeling_results that you have to assign to an object. If you didn't you can still avoid re-loading the object by using .Last.value.

Details

The data was initially prepared by scripts at https://github.com/LieberInstitute/HumanPilot and further refined by https://github.com/LieberInstitute/spatialLIBD/blob/master/inst/scripts/make-data_spatialLIBD.R.

Examples


## Download the SingleCellExperiment object
## at the layer-level
if (!exists("sce_layer")) sce_layer <- fetch_data("sce_layer")
#> 2024-02-21 18:00:12.507649 loading file /github/home/.cache/R/BiocFileCache/108e7c23f8e5_Human_DLPFC_Visium_processedData_sce_scran_sce_layer_spatialLIBD.Rdata%3Fdl%3D1

## Explore the data
sce_layer
#> class: SingleCellExperiment 
#> dim: 22331 76 
#> metadata(0):
#> assays(2): counts logcounts
#> rownames(22331): ENSG00000243485 ENSG00000238009 ... ENSG00000278384
#>   ENSG00000271254
#> rowData names(10): source type ... is_top_hvg is_top_hvg_sce_layer
#> colnames(76): 151507_Layer1 151507_Layer2 ... 151676_Layer6 151676_WM
#> colData names(13): sample_name layer_guess ...
#>   layer_guess_reordered_short spatialLIBD
#> reducedDimNames(6): PCA TSNE_perplexity5 ... UMAP_neighbors15 PCAsub
#> mainExpName: NULL
#> altExpNames(0):

## How to download and load "spatialDLPFC_snRNAseq"
if (FALSE) {
sce_path_zip <- fetch_data("spatialDLPFC_snRNAseq")
sce_path <- unzip(sce_path_zip, exdir = tempdir())
sce <- HDF5Array::loadHDF5SummarizedExperiment(
    file.path(tempdir(), "sce_DLPFC_annotated")
)
sce
#> class: SingleCellExperiment
#> dim: 36601 77604
#> metadata(3): Samples cell_type_colors cell_type_colors_broad
#> assays(2): counts logcounts
#> rownames(36601): MIR1302-2HG FAM138A ... AC007325.4 AC007325.2
#> rowData names(7): source type ... gene_type binomial_deviance
#> colnames(77604): 1_AAACCCAAGTTCTCTT-1 1_AAACCCACAAGGTCTT-1 ... 19_TTTGTTGTCTCATTGT-1 19_TTTGTTGTCTTAAGGC-1
#> colData names(32): Sample Barcode ... cellType_layer layer_annotation
#> reducedDimNames(4): GLMPCA_approx TSNE UMAP HARMONY
#> mainExpName: NULL
#> altExpNames(0):
lobstr::obj_size(sce)
#> 172.28 MB
}