Split either a SFE object or sf or sfc by graph component of a
spatial neighborhood graph.
Usage
# S4 method for class 'SpatialFeatureExperiment'
splitComponent(x, colGraphName = 1L, min_cells = 100)
# S4 method for class 'sf'
splitComponent(
x,
min_cells = 100,
distance_cutoff = 50,
BNPARAM = NULL,
BPPARAM = SerialParam()
)
# S4 method for class 'sfc'
splitComponent(
x,
min_cells = 100,
distance_cutoff = 50,
BNPARAM = NULL,
BPPARAM = SerialParam()
)Arguments
- x
A SFE object, or
sforsfc.- colGraphName
Name of graph to use for
splitComponent. We recommend distance based neighbors (`dnearneigh` infindSpatialNeighbors), and recommend NOT using k nearest neighbors (`knearneigh`) or triangulation (`tri2nb`).- min_cells
Minimum number of cells per graph component; components with fewer than this number of cells are considered debris and removed.
- distance_cutoff
For the
sfandsfcmethods, the distance cutoff used to construct a distance-based spatial neighborhood graph, in the same unit as the spatial coordinates. Anything within this distance is considered a neighbor.- BNPARAM
A
BiocNeighborParamobject specifying the algorithm to find k nearest neighbors and distance based neighbors withnn_method = "bioc". For distance based neighbors, onlyKmknnParamandVptreeParamare applicable.- BPPARAM
A
BiocParallelParamobject for multithreading. Only used for k nearest neighbor and distance based neighbor withnn_method = "bioc".