Convert SpatialExperiment Object to Seurat Object
0
1
Entering edit mode
cathalgking ▴ 10
@0dc78e90
Last seen 21 months ago
Australia

I have a 10x Visium experiment that was aligned with Space Ranger. There is 4 images/samples and each output contains the standard ''/outs/'' folder with image, matrix, tissue positions etc. I read the data into a SpatialExperiment (spe) with the below code.

  1. I would like to convert my SpatialExperiment object to a Seurat object for some downstream analyses. I know that there is functionality to convert a SingleCellExperiment object to a Seurat object with as.SingleCellExperiment(x) but does something similar exist for a Spatial experiment conversion to a Seurat object? When I try to use that function on my spe I get the Error shown below.
  2. Or, is there a way to read in my multiple image/sample experiment into a Seurat object at once as is done with the read10xVisium() function below for a SpatialExperiment?
samples <- c("~/A1count/outs",
             "~/B1count/outs",
             "~/C1count/outs",
             "~/D1count/outs")

sample_ids = c("A1count", "B1count", "C1count", "D1count")

spe <- read10xVisium(
  samples = samples,
  sample_id = sample_ids,
  type = "sparse",
  data = "raw",
  images = "lowres",
  load = TRUE
)

Error in UseMethod(generic = "as.SingleCellExperiment", object = x) : no applicable method for 'as.SingleCellExperiment' applied to an object of class "c('SpatialExperiment', 'SingleCellExperiment', 'RangedSummarizedExperiment', 'SummarizedExperiment', 'RectangularData', 'Vector', 'Annotated', 'vector_OR_Vector')"

scuttle scater seurat SpatialExperiment • 1.9k views
ADD COMMENT

Login before adding your answer.

Traffic: 498 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6