Calculate the proportion of nearest neighbours within batches out of a knn graph
Usage
GetPropIntraBatch(
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
orNeighbor
instance stored inobject
. 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