plot_heatmap.expr {RVA}R Documentation

Plot Heatmap From Raw CPM

Description

Create a heatmap with either CFB or CPM averaged across individual samples.

Usage

plot_heatmap.expr(
  data = ~count,
  annot = ~meta,
  sample.id = "sample_id",
  annot.flags = c("day", "Treatment", "tissue"),
  ct.table.id.type = "ENSEMBL",
  gene.id.type = "SYMBOL",
  gene.names = NULL,
  gene.count = 10,
  title = "RVA Heatmap",
  fill = "CFB",
  baseline.flag = "day",
  baseline.val = "0",
  plot.save.to = NULL,
  input.type = "count"
)

Arguments

data

A wide-format dataframe with geneid rownames, sample column names, and fill data matching input.type.

annot

A long-format dataframe with any pertinent treatment data about the samples. The only required column is one titled the sample.id value with values matching the column names of sample IDs in data. Additional columns can contain information such as treament compounds, dates of sample collection, or dosage quantities.

sample.id

The column name to specify sample ID.

annot.flags

A vector of column names corresponding to column names in annot which will be used to define the x-axis for the heatmap. Default = c("day", "dose").

ct.table.id.type

The gene id format in data should be one of: ACCNUM, ALIAS, ENSEMBL, ENSEMBLPROT, ENSEMBLTRANS, ENTREZID, ENZYME, EVIDENCE, EVIDENCEALL, GENENAME, GO, GOALL, IPI, MAP, OMIM, ONTOLOGY, ONTOLOGYALL, PATH, PFAM, PMID, PROSITE, REFSEQ, SYMBOL, UCSCKG, UNIGENE, UNIPROT.

gene.id.type

The gene id format of gene.names, should be one of: ACCNUM, ALIAS, ENSEMBL, ENSEMBLPROT, ENSEMBLTRANS, ENTREZID, ENZYME, EVIDENCE, EVIDENCEALL, GENENAME, GO, GOALL, IPI, MAP, OMIM, ONTOLOGY, ONTOLOGYALL, PATH, PFAM, PMID, PROSITE, REFSEQ, SYMBOL, UCSCKG, UNIGENE, UNIPROT.

gene.names

A character vector or list of ensembl IDs for which to display gene information. If NULL, all genes will be included. Default = NULL.

gene.count

The number of genes to include, where genes are selected based on ranking by values in fill. Default = 10.

title

A title for the heatmap. Default = "RVA Heatmap".

fill

One of c("CPM", "CFB") to fill the heatmap cells with. Default = "CFB".

baseline.flag

A character vector of column names. If fill = "CFB", these columns in annot contain the values to compare across. Ignored if fill = "CPM". Default = "timepoint".

baseline.val

A character vector of values. This vector must be the same length as baseline.flag, and the value at each index must represent a value from the column given by the corresponding index in baseline.flag. The samples corresponding to these values will be used as a baseline when calculating CFB. Ignored if fill = "CPM". Default = "Week 0".

plot.save.to

The address to save the heatmap plot.

input.type

One of count or cpm indicating what the input data type is. If count, the CPM of the input data will be calculated using edgeR::cpm(). Default = count.

Details

The function takes raw CPM data and returns both a list containing a data frame with values based on the fill parameter and a heatmap plot.

Value

The function returns a list with 2 items:

df.sub

"A data frame of change from baselines values (fill = CFB in this example) for each gene id that is divided by a combination of treatment group and time point

gp

A Heatmap object from ComplexHeatmap which can be plotted

References

Xingpeng Li,Tatiana Gelaf Romer & Aliyah Olaniyan, RVA - RNAseq Visualization Automation tool.

Examples

plot <- plot_heatmap.expr(data = count_table[,1:20],annot = sample_annotation[1:20,])

[Package RVA version 0.0.5 Index]