R/format_codex_to_spe.R
format_codex_to_spe.Rd
Reads in spatial data in the form of cell coordinates, cell phenotypes (if available), and marker intensities and transforms to a `SpatialExperiment` object. The assay stores the intensity level of every marker (rows) for every cell (columns). Cell phenotype is stored under colData. Cell x and y coordinates are stored under `spatialCoords()` field.
format_codex_to_spe(path = NULL, markers, path_to_codex_cell_phenotypes = NULL)
A SpatialExperiment object is returned
path <- system.file("extdata", "tiny_codex.csv.gz", package = "SPIAT")
path_to_codex_cell_phenotypes <- system.file("extdata",
"tiny_codex_phenotypes.txt.gz", package = "SPIAT")
markers <- c("CD45", "Ly6C", "CD27", "CD5", "CD79b")
formatted_codex <- format_codex_to_spe(path = path, markers = markers,
path_to_codex_cell_phenotypes = path_to_codex_cell_phenotypes)