3 Getting Started
If you are new to spatial omics data and would like to jump into some analysis, this page is a great place to start.
3.1 What technologies is our software applicable to?
Our suite of packages is geared towards analysing single-cell resolution assays, and the workflow described here focuses on single-cell resolution assays that have spatial context, i.e., each of the cells has an x-y coordinate. Technologies that generate this type of data include Imaging Mass Cytometry, MIBI-TOF, Xenium, CosMx, and MERFISH.
Please check out our scdney suite of packages for how to analyse many different types of single cell resolution assays.
3.2 Using our packages
It is important to know that our packages are interoperable with many other awesome packages out there. We highly recommend that you reflect on your needs or what you would like to find in your data, and then choose the analytical methods that will be most appropriate for your data.
To get started with our packages, we recommend that you read the descriptions of our packages on the Software page. Clicking on the beautiful hex stickers will take you to the package vignettes that will explain their functionality in depth.
We also recommend that you browse our analysis examples in the case studies chapter. Here, you will find the application of combinations of our packages to answer multi-component questions on a diverse range of spatially-resolved single-cell assays. While reading this, keep the specific assay in mind for context, but also recognize that most of the demonstrated analytical approaches can be applied to a wide range of assays.
3.3 SpatialExperiment
In keeping with interoperability, we use the SpatialExperiment
object from the SpatialExperiment package as the central linking framework across many of the packages.
3.3.1 Creating a SpatialExperiment object
The vignette for the SpatialExperiment package explains how to turn a
matrix
ordata.frame
into aSpatialExperiment
.If you have a .csv file or a .xlsx file, this can be read into R using
read_csv()
andread_xlsx()
from thereadxl
package and converted into amatrix
ordata.frame
. You could also useread.csv()
orread.delim()
in base R.If you have a
Seurat
object, you can convert this to aSingleCellExperiment
using theas.SingleCellExperiment()
function or back again usingas.Seurat()
.A
SpatialExperiment
object is very similar to aSingleCellExperiment
but with spatial coordinates stored in thespatialCoords()
slot. Many people analyse spatial data using aSingleCellExperiment
object with the spatial coordinates stored incolData
. Most of our packages are accepting of this approach.For visualisations, we recommend duplicating your
spatialCoords()
in thereducedDim()
slot and in thecolData
.
3.3.2 Installing packages
To get started with the workflow, you can install the following Bioconductor packages:
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install(version = "3.20")
# Bioconductor packages
BiocManager::install(c("SingleCellExperiment",
"SpatialExperiment",
"tidySingleCellExperiment",
"SpatialDatasets",
"cytomapper",
"EBImage",
"simpleSeg",
"scater",
"FuseSOM",
"STexampleData",
"scuttle",
"scClassify",
"spicyR",
"Statial",
"imcRtools",
"treekoR",
"lisaClust",
"ClassifyR"))
# other packages
install.packages(c("dplyr",
"ggplot2",
"MLmetrics",
"survival",
"tibble",
"ggsurvfit",
"ggpubr"))
We can now move on to the first stage of the spatial analysis pipeline.