Skip to contents

Function to convert SpatialExperiment object to a data frame

Usage

.SPE2df(spe, imageCol, marks = NULL)

Arguments

spe

SpatialExperiment; a object of class SpatialExperiment

imageCol

character; name of a column in colData that corresponds to the image

marks

character; name of column in colData with categorical marks

Value

data.frame with x, y coordinates, image, and categorical mark information

Examples

data(sostaSPE)
.SPE2df(sostaSPE, marks = "cellType", imageCol = "imageName") |> head()
#>            x         y imageName cellType
#> 1 113.964828  79.72171    image1        A
#> 2  18.828120  51.33354    image1        A
#> 3 119.718375  57.28533    image1        A
#> 4  38.557299 119.77972    image1        A
#> 5   7.772233  87.46652    image1        A
#> 6  18.213670  63.46682    image1        A