Extract spatial expression data and coordinates from a Seurat
spatial object.
Usage
extract_spatial_data(
seurat_obj,
assay = "Spatial",
image_name = NULL,
output_dir = NULL,
prefix = "",
sparse = FALSE
)
Arguments
- seurat_obj
A Seurat object with spatial data.
- assay
Assay to extract. Default is "Spatial".
- image_name
Name of the image. Default is first image.
- output_dir
Directory to save output files.
- prefix
File name prefix.
- sparse
Save as sparse matrix. Default is FALSE.
Value
If output_dir is NULL, returns a list. Otherwise saves files.