
Spatial cellular network graph
spatialNearestNeighbors.Rd
Create a cellular nearest neighbor graph from spatial Representation with a variety of methods. A
wrapper around computeNearestNeighbors()
.
Usage
spatialNearestNeighbors(
object,
representation = "spatial",
method = c("knn", "frnn", "snn", "del"),
k = 5,
eps = 50,
analyze = "regions",
name = NULL,
...
)
Arguments
- object
A SpatialMap or Region object
- representation
What Representation to use. Defaults to "spatial"
- method
'knn'
,'frnn'
,'snn'
, or'del'
. Seevignette("Tutorial_Advanced_spatial")
for more details.- k
How many nearest neighbors (knn and snn only)
- eps
How large a radius (frnn only)
- analyze
Passed to .smapply. Default "regions" ensures that separate samples are analyzed separately (ignores activeAnalysis). Any other setting may have unpredictable results.
- name
A custom name for the graph. By default, will be named according to the method and parameter specified (e.g.
spatial_knn_5
,spatial_frnn_50
,spatial_del
)- ...
Additional parameters passed to the NN methods.
Value
A SpatialMap or Region object with a new NN computed and added to each Region, with a name
determined by name
Details
See vignette("AnalysisGuide5_Cell_interactions")
for an example workflow that makes use of this
function, and vignette("Tutorial_Advanced_spatial")
for a detailed description of the different methods
available for use with this function, as well as some options for advanced work with the resulting NN objects.
method = "knn"
:createKNNGraph.Region()
method = "snn"
:createSharedNNGraph.Region()
method = "frnn"
:createFixedRadiusNNGraph.Region()
method = "del"
:createDelaunayTriangulation.Region()