addCluster | R Documentation |
This function returns a SummarizedExperiment
with clustering
information in its colData or rowData
addCluster(
x,
BLUSPARAM,
assay.type = assay_name,
assay_name = "counts",
by = MARGIN,
MARGIN = "rows",
full = FALSE,
name = "clusters",
clust.col = "clusters",
...
)
## S4 method for signature 'SummarizedExperiment'
addCluster(
x,
BLUSPARAM,
assay.type = assay_name,
assay_name = "counts",
by = MARGIN,
MARGIN = "rows",
full = FALSE,
name = "clusters",
clust.col = "clusters",
...
)
x |
A
|
BLUSPARAM |
A BlusterParam object specifying the algorithm to use. |
assay.type |
|
assay_name |
Deprecated. Use |
by |
|
MARGIN |
Deprecated. Use |
full |
Logical scalar indicating whether the full clustering statistics should be returned for each method. |
name |
|
clust.col |
|
... |
Additional parameters to use altExps for example |
This is a wrapper for the clusterRows
function from the
bluster
package.
When setting full = TRUE
, the clustering information will be stored in
the metadata of the object.
By default, clustering is done on the features.
addCluster
returns an object of the same type as the x
parameter
with clustering information named clusters
stored in colData
or rowData
.
library(bluster)
data(GlobalPatterns, package = "mia")
tse <- GlobalPatterns
# Cluster on rows using Kmeans
tse <- addCluster(tse, KmeansParam(centers = 3))
# Clustering done on the samples using Hclust
tse <- addCluster(tse,
by = "samples",
HclustParam(metric = "bray", dist.fun = vegan::vegdist))
# Getting the clusters
colData(tse)$clusters
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.