Description Usage Arguments Value Examples
View source: R/helper-functions.R
Provided with a count matrix and a dataframe or 'ClusterHierarchy' object, this module runs the necessary checks on the dataframe and tries to convert it to a tree by making necessary changes. Returns the 'TreeViz' object if a tree is successfully generated from dataframe, throws error otherwise
1 | createTreeViz(clusters, counts)
|
clusters |
'ClusterHierarchy' object or a dataframe containing cluster information at different resolutions |
counts |
matrix Dense or sparse matrix containing the count matrix |
'TreeViz“ Object
1 2 3 4 5 6 7 8 9 10 11 | n=64
# create a hierarchy
df<- data.frame(cluster0=rep(1,n))
for(i in seq_len(5)){
df[[paste0("cluster",i)]]<- rep(seq(1:(2**i)),each=ceiling(n/(2**i)),len=n)
}
# generate a count matrix
counts <- matrix(rpois(6400, lambda = 10), ncol=n, nrow=100)
colnames(counts)<- seq_len(64)
# create a `TreeViz` object
treeViz <- createTreeViz(df, counts)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.