ClusterHierarchy: Creates a new ClusterHierarchy object.

Description Usage Arguments Value Examples

View source: R/ClusterHierarchy-class.R

Description

Works as a validation check for multiple issues user passed dataframe might have. For example, multiple root nodes, incompatible naming, multiple parents of a single node, etc This function performs all this checks and tries to resolve the issues by making changes in cluster assignment User can give either col_regex or columns option to filter the columns or specify the column order

Usage

1
ClusterHierarchy(hierarchy, col_regex = NULL, columns = NULL)

Arguments

hierarchy

hierarchy as a dataFrame

col_regex

Regular Expression for choosing columns

columns

Vector containing list of columns to choose from with ordering

Value

'ClusterHierarchy“ return an object of class ClusterHierarchy containing cluster information that ensures a valid dataframe for treeviz input

Examples

1
2
3
4
5
6
7
n=64
# create a hierarchy
df<- data.frame(cluster0=rep(1,n))
for(i in seq(1,5)){
  df[[paste0("cluster",i)]]<- rep(seq(1:(2**i)),each=ceiling(n/(2**i)),len=n)
}
clus_hier<-ClusterHierarchy(df, col_regex = "clus")

HCBravoLab/scTreeViz documentation built on Dec. 17, 2021, 10:26 p.m.