Entering edit mode
cathalgking ▴ 10@0dc78e90
Last seen 5 days ago
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.
- 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.
- 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')"