Learn R Programming

SLICER (version 0.2.0)

conn_knn_graph: Construct a k-nearest neighbor graph that is fully connected

Description

This function constructs a k-nearest neighbor graph using an LLE embedding, then adds the minimum number of edges needed to make the graph fully connected.

Usage

conn_knn_graph(embedding, k)

Arguments

embedding

Low-dimensional LLE embedding of cells

k

Number of nearest neighbors

Value

An igraph object corresponding to the k-NN graph

Examples

Run this code
# NOT RUN {
genes=1:200
cells=sample(1:500,30)
k=10
traj_lle = lle::lle(traj[cells,genes],m=2,k)$Y
traj_graph = conn_knn_graph(traj_lle,5)
# }

Run the code above in your browser using DataLab