plotSpectraHeatmap: generates heatmap plots of spectra vs mutational signatures

Description Usage Arguments Value Author(s) See Also Examples

View source: R/plotSpectraHeatmap.R

Description

This function generates a heatmap plot of associations between spectra (columns) and mutational signatures (rows), which may include statistical significance annotations based on shot noise modeling. By default, all spectra and signatures are plotted, but the user can provide custom subsets. Options are provided to plot only samples and/or signatures that satisfy statistical significance. A variety of association metrics can be chosen via type; numerical results are returned.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
plotSpectraHeatmap(x, spectra.set=NULL, sig.set=NULL, 
type=c("weights","cosine","entropy","correlation"), 
cor.method = c("pearson","kendall","spearman"), signif=TRUE, pval=0.05, 
signif.sig.only=FALSE, signif.sample.only=FALSE, xlab=NULL, ylab=NULL, 
color=NULL, breaks=NULL, breaks.scale.adj=TRUE, 
breaks.scale.adj.max=c("q99","q95","max"), scale="none", Rowv=FALSE, Colv=TRUE, 
na.color=NULL, cexRow=NULL, srtRow=0, cexCol=NULL, srtCol=45, margins=c(5,5), 
key=TRUE, key.title=NA, dendrogram="none", trace="none", notecol="red", 
cor.notecol="white", notecex=1.5, main.title=NULL, col.title="black", 
line.title=1, cex.title=0.95, subtitle=NULL, col.subtitle="red", 
line.subtitle=-1, cex.subtitle=0.65, ...)

Arguments

x

mutSigMapper object.

spectra.set

Vector of sample names. If NULL, all samples are included.

sig.set

Vector of signature names. If NULL, all signatures are included.

type

Type of signature vs spectra matrix to show: "weights" (signature contributions calculated for each sample), "cosine" (cosine similarity), "entropy" (Jensen-Shannon divergence) and "correlation". Default is "weights".

cor.method

Correlation method (if type="correlation"). Default is "pearson".

signif

Logical to display statistical significance annotations. Default is TRUE.

pval

P-value threshold for statistical significance. Default is 0.05.

signif.sig.only

Logical to only display statistically significant signatures. Default is FALSE.

signif.sample.only

Logical to only display statistically significant samples. Default is FALSE.

xlab

Label for x axis.

ylab

Label for y axis.

color

Heatmap color vector. Length must be one less than number of breaks.

breaks

Color breaks vector.

breaks.scale.adj

(If breaks is NULL) Logical to automatically adjust the breaks scale to the data being plotted. Default is TRUE.

breaks.scale.adj.max

(If breaks is NULL and breaks.scale.adj is TRUE) Breaks maximum: "q99" (99-th percentile), "q95" (95-th percentile), or "max" (maximum). Default is "q99".

scale

Logical to scale the data for heatmap in either the row or column direction. Default is "none".

Rowv

Logical to reorder rows (signatures) by hierarchical clustering. Default is FALSE.

Colv

Logical to reorder columns (samples) by hierarchical clustering. Default is TRUE.

na.color

Color to use for missing values.

cexRow

Size of row labels.

srtRow

Angle of row labels, in degrees from horizontal.

cexCol

Size of column labels.

srtCol

Angle of column labels, in degrees from horizontal.

margins

Numeric vector of length 2 containing the margins for column and row names, respectively.

key

Logical to display key. Default is TRUE.

key.title

Main title of the color key.

dendrogram

To draw dendrograms. Default is "none".

trace

To display trace lines. Default is "none".

notecol

Color of statistical significance annotations for type="weights", "cosine" or "entropy".

cor.notecol

Color of statistical significance annotations for type="correlation".

notecex

Size of significance annotations.

main.title

Custom title.

col.title

Title color.

line.title

Title line position.

cex.title

Title size.

subtitle

Custom subtitle.

col.subtitle

Subtitle color.

line.subtitle

Subtitle line position.

cex.subtitle

Subtitle size.

...

Additional plotting parameters to be passed to gplots::heatmap.2()

Value

A list with:

sig_spectra

Numerical data frame with the values plotted in the heatmap across signatures (rows) and samples (columns).

Author(s)

Julian Candia
Maintainer: Julian Candia julian.candia@nih.gov

See Also

mutSigMapper, plotSpectraCaterpillar

Examples

1
2
3
4

juliancandia/mutSigMapper documentation built on Oct. 19, 2020, 3:58 a.m.