plot.DesignContrast | R Documentation |
The function plots a ComplexHeatmap containing two matrices, one of the design matrix and the other of the contrast matrix.
## S3 method for class 'DesignContrast'
plot(
x,
y = NULL,
title = NULL,
clusterDesign = FALSE,
clusterSamples = FALSE,
clusterContrasts = FALSE,
designRange = NULL,
contrastRange = NULL,
designParams = NULL,
contrastParams = NULL,
...
)
x |
A |
y |
NULL, ignored |
title |
Title of the object, used in the title of the heatmaps |
clusterDesign |
Logical, cluster rows of the design matrix |
clusterSamples |
Logical, cluster columns of the design matrix |
clusterContrasts |
Logical, cluster rows of the contrast matrix (notice that the contrast matrix required by limma is the transposed contrast matrix) |
designRange |
NULL or a vector of length 2, giving range of the design matrix to be visualized. If NULL, the whole range is used. |
contrastRange |
NULL or a vector of length 2, giving range of the contrast matrix to be visualized. If NULL, a symmetric range of the largest absolute value and its negate is used. |
designParams |
Other parameters passed to |
contrastParams |
Other parameters passed to |
... |
Ignored |
Heatmap object
myFac <- gl(3,3, labels=c("baseline", "treat1", "treat2"))
myDesign <- model.matrix(~myFac)
colnames(myDesign) <- c("baseline", "treat1", "treat2")
myContrast <- limma::makeContrasts(contrasts=c("treat1", "treat2"), levels=myDesign)
res1 <- DesignContrast(myDesign, myContrast, groups=myFac)
res2 <- DesignContrast(myDesign, myContrast, groups=myFac, dispLevels=c("C", "T1", "T2"))
plot(res1, title="DesCon 1")
plot(res2, title="DesCon 1 (identical)")
plot(res2, title="DesCon 1 (identical)", designRange=c(-2,2),
contrastRange=c(-2,1),
designParams=list(row_names_gp=grid::gpar(fontsize=8)),
contrastParams=list(column_names_gp=grid::gpar(fontsize=12, color="red")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.