Description Usage Arguments Value Examples
Computes a spectral graph-based clustering, either on principal components or
diffusion components. A k-nearest neighbor graph is computed, its edges are
optionally weighted by the Jaccard overlap of cells' neighborhoods, and then
a clustering is computed with either the Louvain or Infomap algorithms. The
resultant clustering is stored as a column in the slot @group.ids
. The
number of detected clusters is sensitive to the nearest neighbor parameter,
and several should be investigated.
1 2 3 4 5 6 7 8 9 10 |
object |
An URD object |
dim.use |
(Character) Calculate on principal components ( |
cells.use |
(Character vector) Which cells to include in the clustering (default is NULL, which uses all cells) |
which.dims |
(Numeric vector) Which PCs (or diffusion components) to use. Defaults to the significant PCs. (The default will probably work with diffusion components, though it is non-sensical in that case.) |
num.nn |
(Numeric or numeric vector) How many nearest-neighbors to use in the k-nn graph. (If multiple values are provided, multiple clusterings are calculated.) |
do.jaccard |
(Logical) Weight edges in the k-nn graph according to their Jaccard overlap? |
method |
(Character) Clustering method to use ( |
group.id |
(Character) Prefix to use for clustering name (Default is method). Number of nearest neighbors is appended. |
An URD object with cluster identities saved in @group.ids
in the column named group.id
.
1 2 3 4 5 6 7 8 | # Try several different nearest neighbor parameters
# Output will be stored as Infomap-10, Infomap-15, ... in object.6s.mnn@group.ids
object.6s.mnn <- graphClustering(object.6s.mnn, num.nn = c(10,15,20,30,40),
method="Infomap", do.jaccard = T)
# Cluster on the diffusion map instead of PCA
# Output will be stored as Louvain-DM-10, Louvain-DM-20, Louvain-DM-30, etc.
object <- graphClustering(object, dim.use="dm", num.nn = c(10,20,30,40), method="Louvain", do.jaccard=T, group.id="Louvain-DM")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.