M3DropGetHeatmapClusters {M3Drop} | R Documentation

## Extracts clusters/ordered names from heatmap output

### Description

Extracts the groupings correponding to the given number of clusters from heatmap output.

### Usage

    M3DropGetHeatmapClusters(heatout, k, type="cell")
    	M3DropGetHeatmapNames(heatout, type="cell")

### Arguments

`heatout` | Output from a gene-expression heatmap.
`k` | Number of clusters.
`type` | One of "cell" or "gene" indicating whether to get clusters or names of cells(columns) or genes(rows).

### Details

`M3DropGetHeatmapClusters` : Traverses down the row or column dendrogram and cuts at the first point where there are at least k clusters. `M3DropGetHeatmapNames`: gets the names of the cells/genes in the order that they appear on the dendrogram.

### Value

A vector of cluster labels for each cell.

### Examples

      library(M3DExampleData)
      genes <- rownames(Mmus_example_list$data)[1:20]
      heatmap_out <- M3DropExpressionHeatmap(genes, Mmus_example_list$data)
      clusters <- M3DropGetHeatmapClusters(heatmap_out, k=5)
      heatmap_gene_labels <- M3DropGetHeatmapNames(heatmap_out, type="gene")

[Package M3Drop version 1.20.0 Index]