Skip to contents

The approximate nature of the nearest neighbour search algorithm used to compute the knn graph makes the resulting adjacency matrix asymmetric. Those functions symmetrize a Graph or a Neighbor object.

Usage

SymmetrizeKnn(object, graph.name = "RNA_nn", use.max = TRUE, assay = NULL)

# S4 method for class 'Seurat'
SymmetrizeKnn(object, graph.name = "RNA_nn", use.max = TRUE, assay = NULL)

# S4 method for class 'Matrix'
SymmetrizeKnn(object, use.max = TRUE)

# S4 method for class 'Graph'
SymmetrizeKnn(object, use.max = TRUE)

# S4 method for class 'Neighbor'
SymmetrizeKnn(object, use.max = TRUE)

Arguments

object

a Seurat, Graph or Neighbor object

graph.name

name of a Graph or Neighbor instance stored in the Seurat object.

use.max

by default, use the maximum value in case of discrepancy between m[i,j] and m[j,i]. Set to FALSE to use the minimum value.

assay

name of the assay to store in the output Graph

Value

the Seurat object with a new Graph instance or a dgCMatrix representing the Graph itself

See also