Skip to contents

Calculate the proportion of nearest neighbours between batches out of a knn graph

Usage

GetPropInterBatch(
  object,
  batch.var,
  graph.name = "RNA_nn",
  count.self = TRUE,
  per.batch = TRUE
)

Arguments

object

a Seurat object

batch.var

name of a column in the Seurat object's metadata containing batch information

graph.name

name of a Graph or Neighbor instance stored in object. When available, prefer the distance based network to the connectivities graph (especially when computed with the UMAP method).

count.self

whether to include self-to-self vertices in the calculation

per.batch

whether to keep proportions per batch or to aggregate everything

Value

a vector of length 1 or number of batches, depending on per.batch argument value