Get tissue boundary from concave hull of cell geometries
Source:R/tissue_boundary.R
getTissueBoundaryConcave.RdThe concave hull will be a smoothed outline, and the smoothness can be
adjusted with the ratio parameter. Run findDebrisCells
to remove small bits outside the main piece tissue before running this
function.
Usage
# S4 method for class 'SpatialFeatureExperiment'
getTissueBoundaryConcave(
x,
sample_id = NULL,
colGeometryName = 1L,
ratio = 0.01,
allow_holes = TRUE,
multiple_pieces = FALSE,
min_cells = 100,
distance_cutoff = 50,
BNPARAM = NULL,
BPPARAM = SerialParam()
)
# S4 method for class 'sfc'
getTissueBoundaryConcave(
x,
ratio = 0.01,
allow_holes = TRUE,
multiple_pieces = FALSE,
min_cells = 100,
distance_cutoff = 50,
BNPARAM = NULL,
BPPARAM = SerialParam()
)
# S4 method for class 'sf'
getTissueBoundaryConcave(
x,
ratio = 0.01,
allow_holes = TRUE,
multiple_pieces = FALSE,
min_cells = 100,
distance_cutoff = 50,
BNPARAM = NULL,
BPPARAM = SerialParam()
)Arguments
- x
object of class
sfg,sfcorsf- sample_id
Sample id(s) whose tissue boundaries are to be found.
- colGeometryName
Name of the
colGeometryto use to infer the concave hull.- ratio
numeric; fraction convex: 1 returns the convex hulls, 0 maximally concave hulls
- allow_holes
logical; if
TRUE, the resulting concave hull may have holes- multiple_pieces
Logical, whether there are multiple pieces of tissue in the same sample.
- 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".