Estimate KNN density on 2d embedding.

EstimateKnnDensity(emb.mat, k = 10, n.bins = 50, n.mesh = 2, do.plot = TRUE)

Arguments

emb.mat

a embedding matrix, rows are cells, columns are dimensions.

k

Number of neighbors. Default: 10

n.bins

number of bins for density resampling. Default: 50

n.mesh

in each bin, density will be calculated around (n.mesh^2) points. Default: 3

do.plot

whether plot results. Default: TRUE.

Value

a GridDensity object