This fuction is a wrapper for the hclust, dist, and cutree functions. It outputs a string of a concatenated vector of 1's and 2's indexed by column. This function is not meant to be run individually, but as a 'clustFunc' argument for running `K2preproc()`, `runK2Taxonomer()`, and `K2tax()`.

hclustWrapper(dataMatrix, clustList)

Arguments

dataMatrix

An P x N numeric matrix of data.

clustList

Named list of objects to use for clustering procedure. Or `NULL` to use Euclidean distance with Ward's method.

  • 'distMetric'Distance method to use. See ?dist.

  • 'aggMethod'Agglomerative method to use. See ?hclust.

Value

A character string of concatenated 1's and 2's pertaining to the cluster assignment of each column in dataMatrix.

References

Reed ER, Monti S (2020). “Multi-resolution characterization of molecular taxonomies in bulk and single-cell transcriptomics data.” Bioinformatics. doi: 10.1101/2020.11.05.370197 , http://biorxiv.org/lookup/doi/10.1101/2020.11.05.370197.

Examples

## Read in sample ExpressionSet require(Biobase) data('sample.ExpressionSet') ## Extrat subset of data matrix dm <- exprs(sample.ExpressionSet)[seq_len(50),] ## Create list of objects for clustering procedure. cL <- list(distMetric='euclidean', aggMethod='ward.D2') ## Generate K=2 split with hierarchical clustering hclustWrapper(dm, cL)
#> [1] "12111212212212121111112122"