optimalDS: Cut clustered tree at varying heights and overlay with...

View source: R/utility_functions.R

optimalDSR Documentation

Cut clustered tree at varying heights and overlay with dendrogram to find optimal parameter set.

Description

WGCNA::cutreeDynamic is run for varying levels of deepSplit parameter (0:4), and cluster membership is assigned for each parameter set. Default cut method is 'hybrid'.

Usage

optimalDS(
  tree,
  d.mat,
  genes = NULL,
  cut.height = 0.998,
  pam.respects.dendro = FALSE,
  ...
)

Arguments

tree

h.clust object generated by dist2hclust.

d.mat

distance matrix used to generate tree.

genes

vector of gene names corresponding rows/col of distance matrix (d.mat). If specified, additional "genes" column is provided in output.

cut.height

Maximum joining heights that will be considered. Default is 0.998.

pam.respects.dendro

Logical, only used for method "hybrid". If TRUE, the PAM stage will respect the dendrogram in the sense that objects and small clusters will only be assigned to clusters that belong to the same branch that the objects or small clusters being assigned belong to. Default is FALSE.

...

additional arguments passed to dynamicTreeCut::cutreeDynamic()

Value

mColorh, matrix specfying module membership at varying deep split parameter specifications (0:4)

See Also

cutreeDynamic

Examples


geneTree <- dist2hclust(d.mat)
# determine number of modules based on refrence dataset
print2hide <- capture.output(mColorh <- optimalDS(tree = geneTree, d.mat = d.mat, genes  = rownames(a.mat)))


NMikolajewicz/scMiko documentation built on June 28, 2023, 1:41 p.m.