clusRelev: Reorder clusters generated from clusFigs() and replot.

View source: R/clusFigs.R

clusRelevR Documentation

Reorder clusters generated from clusFigs() and replot.

Description

Reorder clusters generated from clusFigs() and replot.

Usage

clusRelev(
  clusRes,
  cluslev,
  rename = TRUE,
  title = "Releveled Clusters",
  col = "Dark2",
  hmcol = NULL,
  labgenes = "",
  avgExp = FALSE,
  showStat = TRUE,
  retStat = FALSE
)

Arguments

clusRes

Results dataframe from clusRes()

cluslev

Numeric vector indicating the new order of clusters for clusRes

rename

Boolean indicating if clusteres should be renamed based on their new order. Default=TRUE

title

Character indicating the title for the plots. Default= "Releveled Clsuters"

col

Character indicating the RColorBrewer palette name or list of colours (hex, name, rgb()) to be used for the bar plot. Default is "Dark2"

hmcol

Colour Ramp Palette of length 100 indicating the colour palette of the heatmap. Leave NULL for default.

labgenes

Character vector corresponding to rownames in clusRes of genes to label in heatmap. Set to NULL to label all genes. Default is "" which labeles no genes.

avgExp

Boolean. Set to TRUE if clusRes was generated with 'avgExp=TRUE' in clusFigs().

showStat

Boolean. If set to TRUE, significance symbols will be shown for significant contrasts in boxplot.

retStat

Boolean. If set to TRUE, stats for contrasts (p-values and FDR) will be returned for each cluster along with results in a list object.

Value

A data frame of log2FoldChanges for each comparison as columns (rows are genes) and a column named "cluster" indicating the cluster each gene belongs to. Two figures: a Heatmap of log2FoldChange of each gene ordered into clusters and a bar plot of the average log2FoldChange in each cluster (+/- SD) by comparison.


kevincjnixon/BinfTools documentation built on July 10, 2024, 11:46 a.m.