Description Usage Arguments Value Examples
View source: R/helper-functions.R
Creates a 'TreeViz“ object from 'SingleCellExperiment'. Generates clusters based on Walktrap algorithm if no default is provided
1 2 3 4 5 6 7 | createFromSCE(
object,
check_coldata = FALSE,
col_regex = NULL,
columns = NULL,
reduced_dim = c("TSNE")
)
|
object |
'SingleCellExperiment' object to be visualized |
check_coldata |
whether to colData of 'SingeCellExperiment' object for cluster information or not |
col_regex |
common regular expression shared across all columns with cluster information |
columns |
vector containing columns with cluster information |
reduced_dim |
Vector of Dimensionality reduction information provided in 'SingeCellExperiment' object to be added in 'TreeViz' (if exists) |
'TreeViz' Object
1 2 3 4 5 6 7 8 9 10 11 12 | library(SingleCellExperiment)
library(scater)
sce <- mockSCE()
sce <- logNormCounts(sce)
sce <- runTSNE(sce)
sce <- runUMAP(sce)
set.seed(1000)
for (i in seq_len(5)) {
clust.kmeans <- kmeans(reducedDim(sce, "TSNE"), centers = i)
sce[[paste0("clust", i)]] <- factor(clust.kmeans$cluster)
}
treeviz <-createFromSCE(sce, check_coldata = TRUE, col_regex = "clust", reduced_dim = c("TSNE", "UMAP"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.