nn_clust: nn_clust

nn_clustR Documentation

nn_clust

Description

performs nearest neighbor clustering on tsne coordinates.

Usage

nn_clust(
  tsne_res,
  nsamp = Inf,
  nn = 100,
  tall_var = "tall_var",
  id_var = "id",
  show_plot = FALSE,
  return_plot = FALSE
)

Arguments

tsne_res

data.table with tsne results. (needs tx, ty, tall_var, id)

nsamp

Downsample profile values down to this value. Default of Inf skips downsampling.

nn

Number of neighbors to use for clustering. Default of 100.

show_plot

If TRUE, print plot to graphics device. Default is FALSE.

return_plot

If TRUE, return plot in list with cluster results. Default is FALSE.

Value

data.table mapping id_var entries to clusters ("cluster_id")

Examples

data("profile_dt")
data("tsne_dt")
setalloccol(tsne_dt)
setalloccol(profile_dt)
clust_res = chiptsne:::nn_clust(tsne_dt, nn = 5, return_plot = TRUE)
clust_res$plot
clust_res$data

#just data by default
chiptsne:::nn_clust(tsne_dt, nn = 5)

jrboyd/seqtsne documentation built on Nov. 5, 2022, 6:37 a.m.