plotSim {adjclust} | R Documentation

## Plot (dis)similarity matrix

### Description

Heatmap of the (dis)similarity matrix

### Usage

    plotSim(mat, type = c("similarity", "dissimilarity"), clustering = NULL,
      dendro = NULL, palette = heat.colors, breaks = 10, log = TRUE, h = p
      - 1, stats = c("R.squared", "D.prime"), main = NULL,
      col.clust = "darkblue", lwd.clust = 2, xaxis = FALSE, naxis = 10)

### Arguments

`mat` | matrix to plot. It can be of class `'matrix'`, `'dgCMatrix'`, `'dsCMatrix'`, `'dist'`, `'HTCexp'`, `'snpMatrix'`.
`type` | input matrix type. Can be either `"similarity"` or `"dissimilarity"` (kernels are supposed to be of type `"similarity"`).
`clustering` | vector of length the number of rows (columns) of the matrix that contains a contiguity constrained clustering (as provided by `select` for instance). If supplied the clustering is superimposed over the heatmap.
`dendro` | `chac` object as provided, e.g., by the function `adjClust` (or any of the other wrappers).
`palette` | color palette. Default to `heat.colors`
`breaks` | number of breaks used to set colors from the palette. Those are based on the quantiles of the matrix entries and for skewed distributions the actual number used to set the palette can be lower than `breaks`.
`log` | logical. Should the breaks be based on log-scaled values of the matrix entries. Default to `TRUE`.
`h` | if `mat` is of class `"snpMatrix"`, band parameter used to compute the linkage desiquilibrium (see `ld`).
`stats` | if `mat` is of class `"snpMatrix"`, type of linkage desiquilibrium measure (see `ld`).
`main` | graphic title.
`col.clust` | color for the borders of the clusters (if `clustering` is provided).
`lwd.clust` | line width for the borders of the clusters (if `clustering` is provided).
`xaxis` | logical. Should a x-axis be displayed? Default to `FALSE`
`naxis` | number of breaks to display on the x-axis. For `HTCexp` objects, the axis is displayed in terms of Mpb and for the other types of input, it is displayed in terms of bin number. Default to `10`.

### Details

This function produces a heatmap for the used (dis)similarity matrix that can be used as a diagnostic plot to check the consistency between the obtained clustering and the original (dis)similarity

### See Also

`select`, `adjClust`

### Examples

    # input as HiTC::HTCexp object
    ## Not run:
    if (require("HiTC", quietly = TRUE)) {
      load(system.file("extdata", "hic_imr90_40_XX.rda", package = "adjclust"))
      plotSim(hic_imr90_40_XX)

      # with a constrained clustering
      res <- hicClust(hic_imr90_40_XX, log = TRUE)
      selected.capushe <- select(res)
      plotSim(hic_imr90_40_XX, clustering = selected.capushe, xaxis = TRUE)
      plotSim(hic_imr90_40_XX, clustering = selected.capushe, dendro = res)
    }
    ## End(Not run)

    plotSim(dist(iris[ ,1:4]), log = FALSE)

[Package adjclust version 0.5.7 Index]