exprHeatmap: Expression heatmaps

Description Usage Arguments Details Value Author(s) Examples

View source: R/exprHeatmap.R

Description

Create gene-by-sample heatmap of expression values Needs plotly

Usage

1
2
3
4
5
6
exprHeatmap(exprDataFrame, genes = NULL, samples = NULL, L2 = FALSE,
  scaleGenes = FALSE, scaleByGroup = NULL, yticklabSize = 8,
  yticklabColor = NULL, figHeightPerGene = 20, figWidth = 300,
  colorsPlot = colorRamp(c("yellow", "red")), ncolors = 5,
  plotTitle = "Expression heatmap", minVal = NULL, maxVal = NULL,
  fileOut = NULL)

Arguments

exprDataFrame

Data frame - Gene x sample expression values (counts, tpm, whatever)

genes

Character - Gene symbols that appear as row names in exprDataFrame

L2

Logical - Whether to take log2 of values. Pseudocount of 1 is added.

scaleGenes

Logical - Whether to scale values within-gene

scaleByGroup

Vector? - Indexes (in exprDataFrame) of samples whose mean profile will be subtracted from each value

yticklabSize

Numeric - Font size for gene symbols

yticklabColor

Character vector

figHeightPerGene

Numeric -

figWidth

Numeric -

colorsPlot

Color ramp -

ncolors

Numeric -

plotTitle

String -

minVal

Numeric -

maxVal

Numeric -

fileOut

String - If given, save png to with this filename

Details

Given a gene-by-sample dataframe with expression values, and (optionally) a list of the genes and samples you want included, make an expression heatmap using plotly. Note that, probably because I'm not set up to do the paying thing, some stuff doesn't get incorporated into the output png. Log2: If TRUE, a pseudocount of 1 is added to all values. This means that genes with an original count of 0 get a log2(count) of 0 rather than an infinite value, and there are no negative values because there are no genes with count < 1. Within-gene scaling: If TRUE, the default scaling is to scale each gene's alues so they fall within 0 and 1. If TRUE and you also give this function a scaleByGroup value (a set of column indexes in exprDataFrame), within-gene scaling will instead be done by taking the gene's mean value for that group of samples and subtracting that from its value for all samples. Make scaleByGroup be the indexes of control samples to convey a sense of effect size.

Value

Plotly object

Author(s)

Emma Myers

Examples

1
2
3
4
5
exprData = read.table("Rorb_p2_TPM.csv", header=TRUE, row.names=1, sep=",")
colnames(exprDataFrame) = gsub("BF_RORb", "", colnames(exprDataFrame))
geneList = c("Rorb", "Plxnd1", "Has2", "Sparcl1", "Pde1a", "Has3")
sampleList = c("HTp2_1", "HTp2_2", "KOp2_1", "KOp2_2")
exprHeatmap(exprData, genes=geneList, samples=sampleList, fileOut="expr.png")

e-myers/rnaseq documentation built on May 20, 2019, 9:14 p.m.