Skip to contents

Internal helper for computeNearestNeighbors().

Usage

computeNearestNeighbors.Region(
  object,
  method,
  representation,
  k = 5,
  eps = 100,
  kt = NULL,
  jp = FALSE,
  name = NULL,
  data.slot = NULL,
  query = NULL,
  ...
)

Arguments

object

A Region object.

method

'knn', 'frnn', 'snn', or 'del'. The vignette on advanced spatial analyses contains an in-depth description (vignette("Tutorial_Advanced_spatial")) although this functionality can be more general!

representation

Which representation's embeddings should be used to compute the graph?

k

The number of K-nearest neighbors

eps

The radius for fixed-radius nearest neighbors

kt

minimum threshold on the number of shared nearest neighbors to build the shared nearest neighbor graph. Edges are only preserved if kt or more neighbors are shared.

jp

In regular sNN graphs, two points that are not neighbors can have shared neighbors. Javis and Patrick (1973) requires the two points to be neighbors, otherwise the count is zeroed out. TRUE uses this behavior.

name

A custom name for the graph. By default, will be named according to the representation, method, and parameter specified (e.g. umap_knn_5, pca_frnn_50, spatial_del).

data.slot

A data slot to use (i.e. look for nearest neighbors in raw or normalized biomarker expression space). See Data() for details. Pass NULL to representation to use this parameter. Currently only supported for "knn".

query

Another matrix to compute NNs against (optional, currently only supported for createFixedRadiusNNGraph.Region)

...

Additional parameters passed to the NN methods.

Scroll to top