colGeometries
are geometries that correspond to columns of the gene
count matrix, such as Visium spots or cells. Same as dimGeometry(x,
MARGIN = 2L, ...)
, with convenience wrappers for getters and setters of
special geometries:
- spotPoly
Polygons of spots from technologies such as Visium, ST, and slide-seq, which do not correspond to cells. Centroids of the polygons are stored in
spatialCoords
of the underlyingSpatialExperiment
object.- ROIPoly
Polygons of regions of interest (ROIs) from technologies such as laser capture microdissection (LCM) and GeoMX DSP. These should correspond to columns of the gene count matrix.
- cellSeg
Cell segmentation polygons. If the columns of the gene count matrix are single cells, then this is stored in
colGeometries
. Otherwise, this is stored inannotGeometries
.- nucSeg
Similar to
cellSeg
, but for nuclei rather than whole cell.
Usage
colGeometry(x, type = 1L, sample_id = 1L, withDimnames = TRUE)
colGeometry(
x,
type = 1L,
sample_id = 1L,
withDimnames = TRUE,
translate = TRUE
) <- value
colGeometries(x, withDimnames = TRUE)
colGeometries(x, withDimnames = TRUE, translate = TRUE) <- value
colGeometryNames(x)
colGeometryNames(x) <- value
spotPoly(x, sample_id = 1L, withDimnames = TRUE)
spotPoly(x, sample_id = 1L, withDimnames = TRUE, translate = TRUE) <- value
centroids(x, sample_id = 1L, withDimnames = TRUE)
centroids(x, sample_id = 1L, withDimnames = TRUE, translate = TRUE) <- value
ROIPoly(x, sample_id = 1L, withDimnames = TRUE)
ROIPoly(x, sample_id = 1L, withDimnames = TRUE, translate = TRUE) <- value
cellSeg(x, sample_id = 1L, withDimnames = TRUE)
cellSeg(x, sample_id = 1L, withDimnames = TRUE, translate = TRUE) <- value
nucSeg(x, sample_id = 1L, withDimnames = TRUE)
nucSeg(x, sample_id = 1L, withDimnames = TRUE, translate = TRUE) <- value
Arguments
- x
A
SpatialFeatureExperiment
object.- type
An integer specifying the index or string specifying the name of the *Geometry to query or replace. If missing, then the first item in the *Geometries will be returned or replaced.
- sample_id
Sample ID to get or set geometries.
- withDimnames
Logical. If
TRUE
, then the dimnames (colnames or rownames) of the gene count matrix should correspond to row names of thesf
data frames of interest.- translate
Logical. Only used if
removeEmptySpace
has been run of the SFE object. If that's the case, this argument indicates whether the new value to be assigned to the geometry is in the coordinates prior to removal of empty space so it should be translated to match the new coordinates after removing empty space. Default toTRUE
.- value
Value to set. For
dimGeometry
, must be asf
data frame with the same number of rows as size in the dimension of interest, or an ordinary data frame that can be converted to such asf
data frame (seedf2sf
). FordimGeometries
, must be a list of suchsf
or ordinary data frames.
Examples
library(SFEData)
sfe <- McKellarMuscleData(dataset = "small")
#> see ?SFEData and browseVignettes('SFEData') for documentation
#> loading from cache
cgs <- colGeometries(sfe)
spots <- spotPoly(sfe)