bbox-SpatialFeatureExperiment-method: Find bounding box of SFE objects

bbox,SpatialFeatureExperiment-methodR Documentation

Find bounding box of SFE objects

Description

Find bounding box of the union of all colGeometries and annotGeometries of each sample in the SFE object. This can be used to remove empty space so the tissue and geometries have one corner at the origin so all samples will be on comparable coordinates.

Usage

## S4 method for signature 'SpatialFeatureExperiment'
bbox(sfe, sample_id = NULL)

Arguments

sfe

A SpatialFeatureExperiment object.

sample_id

Sample(s) whose bounding box(es) to find. The bounding box would be for the union of all colGeometries and annotGeometries associated with each sample.

Value

For one sample, then a named vector with names xmin, ymin, xmax, and ymax specifying the bounding box. For multiple samples, then a matrix whose columns are samples and whose rows delineate the bounding box.

Examples

library(SFEData)
sfe <- McKellarMuscleData("small")
bbox(sfe, sample_id = "Vis5A")

pachterlab/SpatialFeatureExperiment documentation built on March 11, 2024, 11:11 p.m.