createOrderedSimMat {MetCirc} | R Documentation

## Update colnames and rownames of a similarity matrix according to order m/z, retention time and clustering

### Description

Internal function for shiny application. May also be used outside of shiny to reconstruct figures.

### Usage

    createOrderedSimMat(similarityMatrix, order = c("retentionTime", "mz", "clustering"))

### Arguments

`similarityMatrix` | `matrix`, `similarityMatrix` contains pair-wise similarity coefficients which give information about the similarity between precursors
`order` | `character`, one of "retentionTime", "mz" or "clustering"

### Details

`createOrderSimMat` takes a similarity matrix and a `character` vector as arguments. It will then reorder rows and columns of the similarityMatrix object such, that it orders rows and columns of similarityMatrix according to m/z, retention time or clustering in each group. `createOrderSimMat` is employed in the shinyCircos function to create `similarityMatrix` objects which will allow to switch between different types of ordering in between groups (sectors) in the circos plot. It may be used as well externally, to reproduce plots outside of the reactive environment (see vignette for a workflow).

### Value

`createOrderedSimMat` returns a similarity matrix with ordered rownames according to the `character` vector given to order

### Author(s)

Thomas Naake, thomasnaake@googlemail.com

### Examples

    data("binnedMSP", package = "MetCirc")
    data("similarityMat", package = "MetCirc")
    ## order according to retention time
    createOrderedSimMat(similarityMatrix = similarityMat, order = "retentionTime")

[Package MetCirc version 1.10.0 Index]