ClusterHierarchy {scTreeViz} | R Documentation |
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
ClusterHierarchy(hierarchy, col_regex = NULL, columns = NULL)
hierarchy |
hierarchy as a dataFrame |
col_regex |
Regular Expression for choosing columns |
columns |
Vector containing list of columns to choose from with ordering |
'ClusterHierarchy“ return an object of class ClusterHierarchy containing cluster information that ensures a valid dataframe for treeviz input
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")