---
title: "`SpatialData.data`"
date: "`r format(Sys.Date(), '%B %d, %Y')`"
package: "`r BiocStyle::pkg_ver('SpatialData.data')`"
author: 
  - name: Helena Lucia Crowell
  - name: Artür Manukyan
  - name: Hugo Gruson
  - name: Vince Carey
output:
  BiocStyle::html_document
vignette: |
  %\VignetteIndexEntry{SpatialData.data}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(cache=FALSE, message=FALSE, warning=FALSE)
```

`r BiocStyle::Biocpkg("SpatialData.data")` package provides utilities for accessing, reading and generating SpatialData datasets. Data from a variety 
of spatial omics technologies has been made available as `SpatialData` (zipped) .zarr stores.

These *scverse* SpatialData examples are available through sources 

1.  **biocOSN:** Bioc’s NSF OSN bucket,
3.  **sandbox:** scverse’s spatialdata-sandbox
    (<https://spatialdata.scverse.org/en/latest/tutorials/notebooks/datasets/README.html>)

## Installation

You can install `r BiocStyle::Biocpkg("SpatialData.data")` using: 

```{r eval=FALSE}
if(!requireNamespace("spatialdataR"))
    BiocManager::install("spatialdataR")
if(!requireNamespace("SpatialData.data"))
    BiocManager::install("SpatialData.data")
```

You can also install the development version like so:

```{r install-pak, eval=FALSE}
if(!requireNamespace("pak"))
    install.packages("pak")
pak::pak("HelenaLC/SpatialData.data")
```

To *interrogate* our S3 bucket you will need [paws.storage](https://cran.r-project.org/web/packages/paws.storage/index.html) 
installed.

```{r load-libs}
library(spatialdataR)
library(SpatialData.data)
library(paws.storage)
Sys.setenv(AWS_REGION = "us-east-1") 
```

## Load SpatialData (.zarr) from Archives

Any SpatialData dataset can be retrieved (once) into some location, and
read into R.

```{r load-data}
(x <- SD.data_load("ColorectalCarcinomaMIBITOF"))
```

You can also install the same data from different sources, including the scverse's `spatialdata` sandbox where SpatialData stores are saved as Zarr v3.

```{r load-data-sandbox}
(x <- SD.data_load("ColorectalCarcinomaMIBITOF", src ="sandbox"))
```

We can check all available datasets and their sources with:

```{r load-data-list}
SD.data_list()
```

or as below for a detailed overview and metadata on all datasets: 

```{r view-data-list, eval=FALSE}
View(SD.data_list(metadata = TRUE))
```

You can also interrogate the sources (S3 buckets) for available (zipped) .zarr archives:

```{r avail}
SD.data_available("biocOSN")
```

# Session info

```{r sessionInfo, echo=FALSE}
sessionInfo()
```
