choose_k {FunChIP} | R Documentation

## Choice of the final classification of peaks

### Description

Selection of the final classification of the peaks, given the desired number of clusters and the presence or absence of the alignment procedure chosen. This choice is usually driven by the graph returned by cluster_peak.

### Usage

    ## S4 method for signature 'GRanges'
    choose_k(object, k = NULL, shift.peak = NULL, cleaning = TRUE)

### Arguments

`object` | GRanges object. It must contain the metadata columns associated to the chosen classification. Further details are provided in `shift.peak`.
`k` | integer. Number of chosen clusters.
`shift.peak` | logical. If `TRUE`, the clustering with alignment is chosen, if `FALSE`, the classification without alignment is selected. If `shift.peak = TRUE`, `object` must contain the metadata columns `labels_shift`, `coef_shift`, `dist_shift`; if `shift.peak = FALSE` it must contain the columns `labels_NOshift` and `dist_NOshift`.
`cleaning` | logical. If `TRUE`, all metadata columns generated by FunChIP on the GRanges object are removed, and one new column containing the classification result is added: `cluster`. If `FALSE`, the metadata columns generated by FunChIP are kept. Default is `TRUE`. See Value for further details on the metadata column added.

### Details

The choice of the optimal number of clusters and the presence of alignment can be guided by the graph plotted in the cluster_peak method. In particular, for the optimal number of clusters k the distance significantly decreases with respect to the lower values of k, and negligibly increases with respect to higher values of k (elbow in the line). The introduction of the alignment leads to better clustering of the data if if the global distance is significantly lowered. registration.

### Value

if `cleaning = FALSE`, the GRanges `object` with a new metadata column:

- `cluster` integer. The label correspondent to the classification chosen

If `cleaning = TRUE`, all the metadata columns added through all the analysis are removed and `object` is returned with just the metadata column `cluster`

### Author(s)

Alice Parodi, Marco J. Morelli, Laura M. Sangalli, Piercesare Secchi, Simone Vantini

### See Also

cluster_peak

### Examples

    # load the data
    data(peaks)

    # k = 3 clusters with the alignment
    # with integer shifts are chosen

    peaks.classified <- choose_k(peaks.data.cluster, k = 3,
    shift.peak = TRUE, cleaning = FALSE)

[Package FunChIP version 1.16.0 Index]