1.热图
r package ComplexHeatmap
https://github.com/jokergoo/ComplexHeatmap
install
if(!requireNamespace("BiocManager",quietly=TRUE))
install.packages("BiocManager")BiocManager::install("ComplexHeatmap")
library(devtools)996
install_github("jokergoo/ComplexHeatmap")
usage
Make a single heatmap:
Heatmap(mat,...)
A single Heatmap with column annotations:
ha=HeatmapAnnotation(df=anno1,anno_fun=anno2,...)Heatmap(mat,...,top_annotation=ha)
Make a list of heatmaps:
Heatmap(mat1,...)+Heatmap(mat2,...)
Make a list of heatmaps and row annotations:
ha=HeatmapAnnotation(df=anno1,anno_fun=anno2,...,which="row")Heatmap(mat1,...)+Heatmap(mat2,...)+ha
R package superheat
install
install.packages("devtools")
devtools::install_github("rlbarter/superheat")
usage
superheat(mtcars,
# normalize variables
scale = T,
# order rows/cols based on heirarchical clustering
pretty.order.rows = TRUE,
pretty.order.cols = TRUE,
# plot miles per gallon next to the rows
yr = mtcars$mpg,
yr.axis.name = "miles per gallon",
# plot correlation with mpg above columns
yt = cor(mtcars)[, "mpg"],
yt.plot.type = "bar",
yt.axis.name = "correlation with mpg",
# increase size of left labels
left.label.size = 0.45)
网友评论