Skip to contents

Tailor a SpatialExperiment object to focus on specific areas by defining ranges in the spatial coordinates. This function narrows down the dataset to include only those spots that fall within user-defined x and y coordinate boundaries.

Usage

subsetSPE(spe, colRange = NULL, rowRange = NULL)

Arguments

spe

The SpatialExperiment object representing spatially resolved transcriptomics data.

colRange

a numeric vector of length two specifying the minimum and maximum x-coordinates (pxl_col_in_fullres) to include in the subset. If NULL, the full range of x-coordinates is used.

rowRange

a numeric vector of length two specifying the minimum and maximum y-coordinates (pxl_row_in_fullres) to include in the subset. If NULL, the full range of y-coordinates is used.

Value

Returns a SpatialExperiment object subsetted to include only spots within the defined x and y coordinate ranges.