
Update a Seurat object for compatibility with semla
UpdateSeuratForSemla.RdIn order to make a Seurat object with semla,
you can use AddSemlaToSeurat to add the required
data to the Seurat object. This assumes that
the Seurat object contains one or more "VisiumV1"
object(s) in the images slot. Alternatively, you
can convert a Seurat object with "SlideSeq" data.
Usage
UpdateSeuratForSemla(
object,
image_type = c("tissue_lowres", "tissue_hires"),
verbose = TRUE
)VisiumV1
Note that you need to specify what H&E image was loaded, one of "tissue_lowres" or "tissue_hires". If this argument is incorrect, the tissue coordinates will be misplaced.
Visit the getting started
tutorial on our package website for an example on how to convert a Seurat object with
VisiumV1 data.
VisiumV2
Note that you need to specify what H&E image was loaded, one of "tissue_lowres" or "tissue_hires". If this argument is incorrect, the tissue coordinates will be misplaced.
The getting started
tutorial applies also for VisiumV2 assays. If you are working with VisiumHD data however,
we recommend loading the data using semla's own functions, as detailed in the
VisiumHD tutorial.
Note also that when adapting the object from hexagonal grid VisiumV2 to semla's
object structure, array coordinates are not available. Thus, some plotting methods
will not work.
SlideSeq
For SlideSeq data, there's no additional H&E image provided. If you convert
a Seurat object containing SlideSeq data, all image related functionality
of semla will be inaccessible.
Examples
if (FALSE) { # \dontrun{
library(semla)
library(SeuratData)
# Load example Seurat object with VisiumV1/VisiumV2 data (depends on your Seurat version)
InstallData("stxBrain")
brain <- LoadData("stxBrain", type = "anterior1")
# Make Seurat object compatible with semla
brain_semla <- UpdateSeuratForSemla(brain)
# Load example Seurat object with SlideSeq data
InstallData("ssHippo")
slide_seq <- LoadData("ssHippo")
# Make Seurat object compatible with semla
slide_seq <- UpdateSeuratForSemla(slide_seq)
} # }