Description Usage Arguments Author(s) Examples
mcheatmaps serves to visualize multiple different symmetric matrices and matrix clusters in a single figure using a dendogram, two half heatmaps and various color labels.
1 2 3 4 5 | mcheatmaps(matA = NULL, matB = NULL, matC = NULL, pdfname = "a", flabels = NULL,
aliases = NULL, datapts = TRUE, hminB = NULL, hmaxB = NULL, hminC = NULL, hmaxC = NULL,
ncolors = 10, legA = "", legB = "", legC = "", switchcls = FALSE, cmet = NULL,
ccol = NULL, cellines = FALSE, Bwhole = FALSE, Cwhole = FALSE, diag = NULL,
inverseColorScaleB = 0, inverseColorScaleC = 0)
|
matA |
Symetric matrix used to create the dendrogram and order the data. This matrix needs to be a distance matrix to create the correct dendrogram. The column and row names must be the same between all three matrices. Order of columns and row must also be the same. |
matB |
Symetric matrix used to create the bottom half of the heatmap. If matC is not used, a complete heatmap will be created from matB. The column and row names must be the same between all three matrices. Order of columns and row must also be the same. |
matC |
Symetric matrix used to create the top half of the heatmap. If matB is not used, a complete heatmap will be created from matC. The column and row names must be the same between all three matrices. Order of columns and row must also be the same. |
pdfname |
Name of the image you want to create without extensions, can include path. Default ("a"). |
flabels |
Matrix of the same length as the matrices and of n rows. n being the number of supplementary information you want to add to the matrix. Each row corresponds to a row of colored labels between the dendogram and the heatmaps. Data in this matrix can be text or numbers and a color will be assigned to each different information. Columns must be in the same order as those in the matrices, row names should be a short name giving information on the annotation. Using this argument will create a second image called pdfname_labels.pdf containing the correspondances between color labels and information. |
aliases |
A two column matrix with n rows. Same n as for flabels. The first column is the short name used in flabels while the second is a longer name for the same row. Rows must be in the same order as the flabels matrix. |
datapts |
Set to false if the data values should not be printed in the heatmaps. (Default TRUE) |
hminB |
sets the minimal value of the heatscale of matB |
hmaxB |
sets the maximal value of the heatscale of matB |
hminC |
sets the minimal value of the heatscale of matC |
hmaxC |
sets the maximal value of the heatscale of matC |
ncolors |
Number of colors you want in the heatscales. (Default 10) |
legA |
Title associated with matA |
legB |
Title associated with matB |
legC |
Title associated with matC |
switchcls |
Switches the top and bottom heatscale colors |
cmet |
list of methods you want to use to calculate the dendogram. It uses the one that gives the best correlation. (By default it uses c('ward','single','complete','average','mcquitty')) |
ccol |
Is a vector and it's length must be equal to the number of different colors necessary to show flabels. It must contain a list of colors in a format recognizable by R. |
cellines |
Set to true if the cells of the heatmap should be outlined (Default FALSE) |
Bwhole |
Set to true if all values from matB should be printed as whole numbers (Default FALSE) |
Cwhole |
Set to true if all values from matC should be printed as whole numbers (Default FALSE) |
diag |
Vector containing the elements to be printed in the diagonal between the heatmaps |
inverseColorScaleB |
Set to true to inverse the order of the heatscale of matB. |
inverseColorScaleC |
Set to true to inverse the order of the heatscale of matC. |
Thierry Chenard thierry.chenard@usherbrooke.ca, Rafael Najmanovich rafael.najmanovich@usherbrooke.ca
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | library(mcheatmaps)
mpg=matrix(nrow=nrow(mtcars),ncol=nrow(mtcars))
rownames(mpg)=rownames(mtcars)
colnames(mpg)=rownames(mtcars)
hp=matrix(nrow=nrow(mtcars),ncol=nrow(mtcars))
rownames(hp)=rownames(mtcars)
colnames(hp)=rownames(mtcars)
wt=matrix(nrow=nrow(mtcars),ncol=nrow(mtcars))
rownames(wt)=rownames(mtcars)
colnames(wt)=rownames(mtcars)
for(i in 1:nrow(mtcars)){
for(j in 1:nrow(mtcars)){
mpg[i,j]=abs(mtcars$mpg[i]-mtcars$mpg[j])
hp[i,j]=abs(mtcars$hp[i]-mtcars$hp[j])
wt[i,j]=abs(mtcars$wt[i]-mtcars$wt[j])
}
}
label=t(mtcars[,colnames(mtcars) == "cyl" | colnames(mtcars) == "gear", drop=FALSE])
aliases=matrix(c("cyl","gear","number of cylinders","number of gears"),2,2)
mcheatmaps(matA=mpg,matB=hp,matC=wt,flabels=label,aliases=aliases,pdfname="CarStats",
legA="Difference in gas consumtion (mpg)",legB="Difference in HorsePower",
legC="Weight Difference (tonne)")
|
Loading required package: gridBase
Loading required package: grid
The "ward" method has been renamed to "ward.D"; note new "ward.D2"
[1] "Clustering method = average ; cophenetic corr. = 0.805"
[1] "Lower hmin= 0 hmax= 283"
[1] "correlation between lower triangle and matA = -0.464"
[1] "Upper hmin= 0 hmax= 3.911"
[1] "correlation between upper triangle and matA = -0.686"
[1] "correlation between upper and lower triangles = 0.307"
[1] "image is saved as /work/tmp/CarStats.pdf"
[1] "legend is saved as /work/tmp/CarStats_labels.pdf"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.