clusterRanges {profileplyr} | R Documentation

## Cluster Ranges

### Description

Cluster the ranges in a deepTools object based on signal within each range

### Usage

    clusterRanges(object = "profileplyr", fun = "function",
      scaleRows = "logical", kmeans_k = "integer",
      clustering_callback = "function", clustering_distance_rows = "ANY",
      cluster_method = "function", cutree_rows = "integer",
      silent = "logical", show_rownames = "logical")

    ## S4 method for signature 'profileplyr'
    clusterRanges(object = "profileplyr",
      fun = rowMeans, scaleRows = TRUE, kmeans_k = NULL,
      clustering_callback = function(x, ...) {     return(x) },
      clustering_distance_rows = "euclidean", cluster_method = "complete",
      cutree_rows = NULL, silent = TRUE, show_rownames = FALSE)

### Arguments

`object` | A profileplyr object
`fun` | The function used to summarize the ranges (e.g. rowMeans or rowMax)
`scaleRows` | If TRUE, the rows of the matrix containing the signal in each bin that is used as the input for clustering will be scaled (as specified by pheatmap)
`kmeans_k` | The number of kmeans groups used for clustering
`clustering_callback` | Clustering callback function to be passed to pheatmap
`clustering_distance_rows` | distance measure used in clustering rows. Possible values are "correlation" for Pearson correlation and all the distances supported by dist, such as "euclidean", etc. If the value is none of the above it is assumed that a distance matrix is provided.
`cluster_method` | clustering method used. Accepts the same values as hclust
`cutree_rows` | The number of clusters for hierarchical clustering
`silent` | Whether or not a heatmap (from pheatmap) is shown with the output. This will not change what is returned with the function as it will always be a profileplyr object. If silent = FALSE, the heatmap will be shown which may be helpful in quick evaluation of varying numbers of clusters before proceeding with downstream analysis. The default is silent = TRUE, meaning no heatmap will be shown.
`show_rownames` | for any heatmaps printed while running this function, set to TRUE if rownames should be displayed. Default is FALSE.

### Details

tbd

### Value

A profileplyr object

### Methods (by class)

- `profileplyr`: Cluster Ranges

### Examples

    example <- system.file("extdata", "example_deepTools_MAT", package = "profileplyr")
    object <- import_deepToolsMat(example)

    # k-means clustering
    clusterRanges(object, fun = rowMeans, kmeans_k = 3)

    # hierarchical clustering, print heatmap, yet still return profileplyr object
    clusterRanges(object, fun = rowMeans, cutree_rows = 3, silent = FALSE)

[Package profileplyr version 1.2.0 Index]