format_colData_to_spe: format_colData_to_spe

View source: R/format_colData_to_spe.R

format_colData_to_speR Documentation

format_colData_to_spe

Description

Format a data frame into a SpatialExperiment class where the count assay is empty every cell (columns), cell phenotypes are stored under colData() and cell coordinates are stored under spatialCoords().

Usage

format_colData_to_spe(df)

Arguments

df

Data frame that contains cell coordinates, phenotypes (if available) and other cell properties. The rownames should be cell ID

Value

An SpatialExperiment object

Examples

df <- data.frame(row.names = c("Cell_1", "Cell_2"), Cell.X.Position = c(2,5),
Cell.Y.Position = c(3.3, 8), Phenotypes = c("CD3", "CD3,CD8"))
spe <- format_colData_to_spe(df)

TrigosTeam/SPIAT documentation built on Aug. 22, 2024, 7:50 p.m.