multi_cor_heat: Plot one heatmap per phenotype correlation

View source: R/multi_cor_heat.R

multi_cor_heatR Documentation

Plot one heatmap per phenotype correlation

Description

Plot one heatmap per phenotype correlation with ezheat, where features in object, e.g. genes, are reordered per comparison using tab. This function is based on multi_heat, even though that function should probably be called multi_contasts_heat.

Usage

multi_cor_heat(
  tab,
  object,
  pheno.tab = NULL,
  labrows = rownames(object),
  labcols = colnames(object),
  main = "Log2 Expression",
  name = "heats",
  sc = "ctr",
  clip = NA,
  color.v = NULL,
  unique.rows = FALSE,
  only.labrows = FALSE,
  ntop = 50,
  stat.tab = NULL,
  p.thresh = 1,
  fdr.thresh = 1,
  cutoff = 0.05,
  reorder_rows = TRUE,
  reorder_cols = FALSE,
  fontsize_row = 10,
  fontsize_col = 10,
  na.lab = c("---", ""),
  plot = TRUE,
  width = NA,
  height = NA,
  verbose = FALSE
)

Arguments

tab

Table of output from ezlimma.

object

Matrix-like object with features (e.g. genes) as rows and samples as columns.

pheno.tab

Matrix-like data object with columns as sample phenotypes, with nrow(pheno.tab)==ncol(object).

labrows

Labels for rows, e.g. gene symbols. This can be of length 1 (in which case it is recycled), of length nrow(object).

labcols

Labels for columns. This can be of length 1 (in which case it is recycled), of length ncol(object).

main

Main title of plot.

name

Name of file to create. Set to NA to plot to screen instead of to file.

sc

Row scaling. Should rows be centered ('ctr'), z-scored ('z'), or neither ('none').

clip

Values with magnitude > clip are reset to value clip. If given, must be > 0.

color.v

Color palette for heatmap. If NULL, it's set to colorRampPalette(rev(brewer.pal(n=9, name='RdYlBu')))(50).

unique.rows

Logical; remove duplicated row labels to make rows unique?

only.labrows

Logical; only include rows where labrows aren't missing (missing is defined by na.lab)?

ntop

Scalar number of rows to include.

stat.tab

Matrix-like object with statistics, such as p-values, per column, used to add "*". If given, its dimensions should match object and it cannot have NAs.

p.thresh

Only features with p-value at or below this will be plotted.

fdr.thresh

Only features with FDR at or below this will be plotted.

cutoff

Cutoff such that elements with stats.tab < cutoff show asterisk if stats.tab and cutoff are not NULL.

reorder_rows

Logical; should rows be reordered with hierarchical clustering?

reorder_cols

Logical; should columns be reordered with hierarchical clustering?

fontsize_row

Font size for row labels.

fontsize_col

Font size for column labels.

na.lab

Character vector of labels in lab.col to treat as missing, in addition to NA.

plot

Logical; should plot be generated?

width

Manual option for determining the output file width in inches.

height

Manual option for determining the output file height in inches.

verbose

Logical; print pruning messages to console?

Details

rownames(tab) and rownames(object) should overlap, labrows should correspond to object and some colnames(tab) should end in .p, so they can be identified. If fdr.thresh < 1, then the colnames(tab) that end in .p should be matched by colnames(tab) that end in .FDR instead of .p.

To prevent this function from being called with an unnamed labrows that corresponds to tab instead of object, which is incorrect, if labrows is not names(object) (the default) then it must be named.


jdreyf/ezlimmaplot documentation built on Feb. 8, 2025, 2:25 a.m.