Seurat object internally store spot coordinates (see Seurat::GetTissueCoordinates()). However, at least in the case of Visium, data are flipped and rotated before SpatialDimPlot. This function return the rotated/flipped tissue Coordinates from a Seurat object.

getFlippedTissueCoordinates(seurat_obj, as_data_frame = FALSE)

Arguments

seurat_obj

a seurat object with tissue coordinates.

as_data_frame

return x/y coords as data.frame. Default to SeuratObject.

Value

a seurat object with slots/metadata $x_coord and $y_coord (or a dataframe if as_data_frame is TRUE).

See also

display_visium_hull

Examples

load_example_dataset("7870305/files/lymph_node_tiny_2")
#> |-- INFO :  Dataset 7870305/files/lymph_node_tiny_2 was already loaded. 
lymph_node_tiny <- getFlippedTissueCoordinates(lymph_node_tiny_2)
df <- getFlippedTissueCoordinates(lymph_node_tiny_2, as_data_frame=TRUE)