Description Usage Arguments Details Value Author(s) Examples

View source: R/bending_index.R

Given a GRanges object with metadata columns related to the classification performed with the cluster_peak method, this function quantifies the elbow rule. See Details for a short presentation of the method and the Vignette of the package for a complete defintion of the index.

1 | ```
bending_index(object, plot.graph.k = FALSE)
``` |

`object` |
GRanges object. It must contain the metadata columns associated to the classification to be analyzed.
Specifically it must contain the |

`plot.graph.k` |
logical. If |

This function consists of the computation for each feasible value of k (from 2 to K ??? 1, with K the maximum number of clusters) of an index that quantifies the magnitude of the elbow. As higher is this index, as the correspondent value of k is meaningful. Specifically it is computed as the distance of the point in k of the global distance function (normalized with the maximum value it assumes) from the line passing by the point in k ??? 1 and in k + 1. For further details, see the Vignette.

The function returns

a data.frame (or a list with two data.frames, in case of

`object`

with classification with and without alignment) containing the bending index for different values of the parameter*k*.if

`plot.graph.k = TRUE`

the graphical representation of the distances (normalized with the total number of peaks*n*), varying the classification type and the number of clusters.

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

1 2 3 4 5 6 7 8 | ```
# load the data
data(peaks)
# compute the bending index
index <- bending_index(peaks.data.cluster, plot.graph.k = FALSE)
# from the analysis of this results, a choice of k=3 for
# the classification with shift and k=2 for the classification
# without shift is suggested.
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.