VoltRon includes interactive applications to select and manually label spatial points by drawing polygons.
As an example, we will use a Spot-based spatial transcriptomic assay, specifically the Mouse Brain Serial Section 1/2 datasets, analyzed in the Niche Clustering tutorial. You can find the already analyzed data stored as a VoltRon object here
MBrain_Sec <- readRDS("Visium&Visium_data_decon_analyzed.rds")
Now we can start annotating the spatial assay. By passing arguments used by the vrSpatialPlot function to visualize labels (e.g. clusters), we can better select regions within tissue sections for annotation.
MBrain_Sec <- annotateSpatialData(MBrain_Sec, group.by = "clusters", label = "annotation")
In this section, we will transform VoltRon objects of Xenium data into zarr arrays, and use them for interactive visualization in Vitessce. We should first download the vitessceR package which incorporates wrapper function to visualize zarr arrays interactively in R.
install.packages("devtools")
devtools::install_github("vitessce/vitessceR")
You can find the clustered and annotated Xenium data using VoltRon here.
Xen_data <- readRDS("Xenium_data_clustered_annotated.rds")
SampleMetadata(Xen_data)
Assay Layer Sample
Assay1 Xenium Section1 XeniumR1
Assay2 Xenium Section1 XeniumR2
Now we can convert the VoltRon object into a zarr array using the as.Zarr function which will create the array in a specified location
Xendata_assay <- subset(Xen_data, assays = "Assay1")
as.Zarr(Xendata_assay, out_path = "data/xendata_clustered_annotated.zarr")
We can use the zarr file directly in the vrSpatialPlot function to visualize the zarr array interactively in Rstudio viewer. The reduction arguement allows the umap of the Xenium data to be visualized alongside with the spatial coordinates of the Xenium cells.
vrSpatialPlot("data/xendata_clustered_annotated.zarr",
group.by = "CellType", reduction = "umap")