Skip to contents

Plot the pairwise correlations between pairs of samples in a matrix. Histograms, correlation values, and smooth scatters with loess fits are visualized in each panel. Inspired by `methylKit::getCorrelation(..., plot=TRUE)` and examples in `pairs()`

Usage

plot_cor_pairs(
  m,
  hist_breaks = 30,
  hist_col = "grey50",
  cor_method = c("pearson", "kendall", "spearman"),
  cor_use = "everything",
  cor_digits = 2,
  cor_cex = 2,
  scatter_colramp = hcl.colors,
  scatter_ab_col = "red2",
  scatter_ab_lty = 2,
  scatter_ab_lwd = 1,
  scatter_crv_col = "red3",
  scatter_crv_lwd = 2,
  scatter_crv_lty = 1,
  cex_labels = 2,
  font_labels = 1
)

Arguments

m

Matrix with features in rows and Samples in columns

hist_breaks

Number of breaks to use in histogram

hist_col

Color of the histogram bars

cor_method

Method to use for calculating correlations. One of "pearson" (default), "kendall", or "spearman": can be abbreviated

cor_use

an optional character string giving a method for computing covariances in the presence of missing values. This must be (an abbreviation of) one of the strings "everything", "all.obs", "complete.obs", "na.or.complete", or "pairwise.complete.obs".

cor_digits

Number of digits to report in correlations

cor_cex

Character expansion size for correlation values

scatter_colramp

function accepting an integer n as an argument and returning n colors used in the smoothScatter plots

scatter_ab_col

Color of the abline of the smoothScatter plots

scatter_ab_lty

Line type of the abline of the smoothScatter plots

scatter_ab_lwd

Line weight of the abline of the smoothScatter plots

scatter_crv_col

Color of the lowess lines of the smoothScatter plots

scatter_crv_lwd

Line weight of the lowess lines of the smoothScatter plots

scatter_crv_lty

Line type of the lowess lines of the smoothScatter plots

cex_labels

Text panel graphics parameters passed to `pairs()`

font_labels

Text panel graphics parameters passed to `pairs()`

Value

pairs plot

Examples


plot_cor_pairs(GSE161650_lc)