convertToSeurat | R Documentation |
This function converts our slide object of class
SummarizedExperiment
to Seurat object of class Seurat
so that
users can directly proceed with Seurat spatial analyses pipelines.
Built based on Seurat's Load10X_Spatial()
.
convertToSeurat(slide_obj, image_dir, slice = "slice1", filter_matrix = TRUE)
slide_obj |
A slide object created or inherited from
|
image_dir |
(chr) Path to directory with 10X Genomics visium image data;
should include files |
slice |
(chr) Name for the stored image of the tissue slice. Default: "slice1" |
filter_matrix |
(logical) If |
A Seurat object with spatial information.
# load count matrix and slide metadata
data(mbrain_raw)
spatial_dir <- system.file(file.path("extdata",
"V1_Adult_Mouse_Brain_spatial"),
package = "SpotClean")
mbrain_slide_info <- read10xSlide(tissue_csv_file=file.path(spatial_dir,
"tissue_positions_list.csv"),
tissue_img_file = file.path(spatial_dir,
"tissue_lowres_image.png"),
scale_factor_file = file.path(spatial_dir,
"scalefactors_json.json"))
# Create slide object
mbrain_obj <- createSlide(mbrain_raw,
mbrain_slide_info)
# Convert to Seurat object
seurat_obj <- convertToSeurat(mbrain_obj, spatial_dir, "raw")
str(seurat_obj)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.