plotCorr | R Documentation |
Visualizes correlations between samples or features with a SummarizedExperiment or matrix-like object where rows represent features and columns represent samples. A correlation matrix is visualized using a heatmap with dendrograms.
plotCorr(
x,
i,
type = c("sample", "feature"),
log2 = FALSE,
use = c("everything", "all.obs", "complete.obs", "na.or.complete",
"pairwise.complete.obs"),
method = c("pearson", "kendall", "spearman"),
dendrogram = TRUE,
colors = (scales::viridis_pal())(256),
label = FALSE,
digits = 2,
widths = c(0.8, 0.2),
heights = c(0.2, 0.8),
hide_colorbar = FALSE,
showticklabels = c(TRUE, TRUE),
row_dend_left = FALSE,
k_row = 1,
k_col = 1,
...
)
x |
A matrix-like object or SummarizedExperiment object. |
i |
A string or integer value specifying which assay values to use
when |
type |
A string specifying whether a correlation matrix is computed based on samples or features. |
log2 |
A logical specifying whether feature intensities needs to be log2-transformed before calculating a correlation matrix. |
use |
A string specifying which method to compute correlations in the
presence of missing values. Refer to |
method |
A string specifying which correlation coefficient is to be
computed. See |
dendrogram |
A logical specifying whether dendogram is computed and reordering is performed. |
colors |
A vector of colors for the heatmap. |
label |
A logical specifying whether cell values are shown. |
digits |
A numeric value specifying the desired number of digits when
|
widths |
A numeric vectors specifying relative widths of heatmap and dendrogram. |
heights |
A numeric vectors specifying relative heights of heatmap and dendrogram. |
hide_colorbar |
A logical specifying whether the color bar (legend) is hidden. |
showticklabels |
A logical vector of length 2 (x-axis, y-axis) specifying whether the ticks are removed from the sides of the plot. |
row_dend_left |
A logical controlling whether the row dendrogram is placed on the left on the plot. |
k_row |
A numeric value specifying the desired number of groups by
which to color the dendrogram's branches in the rows. If |
k_col |
A numeric value specifying the desired number of groups by
which to color the dendrogram's branches in the columns. If |
... |
Additional arguments passed to heatmaply::heatmaply. |
A patchwork object of aligned ggplots.
Tal Galili, Alan O'Callaghan, Jonathan Sidi, Carson Sievert; heatmaply: an R package for creating interactive cluster heatmaps for online publishing, Bioinformatics, btx657, https://doi.org/10.1093/bioinformatics/btx657
data(faahko_se)
## Sample group
g <- colData(faahko_se)$sample_group
## SummarizedExperiment object
plotCorr(faahko_se, i = "knn_vsn", method = "spearman", k_col = 4)
## Matrix
m <- assay(faahko_se, "knn_vsn")
plotCorr(m[1:50, ], type = "feature", method = "spearman")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.