heatmap_2(Heatplus)
heatmap_2()所属R语言包:Heatplus
Display Data as Heatmap
作为热图显示数据
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function displays an expression data matrix as a heatmap. It is based on an old version of heatmap in the stats package, but offers more flexibility (e.g. skipping dendrograms, skipping row/column labelling, adding a legend).
此功能显示热图作为表达数据矩阵。它是基于对旧版本的heatmapstats包,但提供了更多的灵活性(如跳绳聚类,跳绳行/列标签,添加一个传说)。
This function is just about to be deprecated. Please use regHeatmap for new projects.
此功能只是被废弃。请使用regHeatmap新项目。
用法----------Usage----------
heatmap_2(x, Rowv, Colv, distfun = dist, hclustfun = hclust, add.expr,
scale = c("row", "column", "none"), na.rm = TRUE,
do.dendro = c(TRUE, TRUE), legend = 0, legfrac = 8,
col = heat.colors(12), trim, ...)
参数----------Arguments----------
参数:x
the numerical data matrix to be displayed.
要显示的数值数据矩阵。
参数:Rowv
either a dendrogram or a vector of reordering indexes for the rows.
无论是树状图或行的重新排序指标的向量。
参数:Colv
either a dendrogram or a vector of reordering indexes for the columns.
无论是树状图或重新排序索引的列向量。
参数:distfun
function to compute the distances between rows and columns. Defaults to dist.
函数来计算行和列之间的距离。 dist默认。
参数:hclustfun
function used to cluster rows and columns. Defaults to hclust.
用于聚类的行和列的功能。 hclust默认。
参数:add.expr
Expression to be evaluated after the call to image. See Details.
进行评估调用image后表达。查看详细信息。
参数:scale
indicates whether values should be scaled by either by row, column, or not at all. Defaults to row.
指示值是否应要么缩减,由行,列,或根本没有。 row默认。
参数:na.rm
logical indicating whther to remove NAs.
逻辑表示whther删除NAS。
参数:do.dendro
logical vector of length two, indicating (in this order) whether to draw the row and column dendrograms.
逻辑矢量长度为二,说明(按此顺序)是否绘制的行和列的聚类。
参数:legend
integer between 1 and 4, indicating on which side of the plot the legend should be drawn, as in mtext.
之间的整数1和4,说明哪一方的图,应提请mtext传说。
参数:legfrac
fraction of the plot that is taken up by the legend; larger values correspond to smaller legends.
分数,采取了由传说的图;较大的值对应于较小的传说。
参数:col
the color scheme for image. The default sucks.
为image颜色方案。默认的吮吸。
参数:trim
Percentage of values to be trimmed. This helps to keep an informative color scale, see Details.
值的百分比来进行修整。这有助于保持一个内容丰富的色阶,看到详细信息。
参数:...
extra arguments to image.
image额外的参数。
Details
详情----------Details----------
With all parameters at their default, this gives the same result as a very old version of heatmap that was the base for the modifications. All parameters of the same name have the same function as in heatmap, though add.expr, which can be used for adding graphical elements after the call to image, will probably not produce useful results. Note also that row- and column labels are optional, i.e. if the corresponding dimname of x is NULL, no labels are displayed.
在其默认的所有参数,这给了相同的结果,很老的版本了heatmap这是修改的基础。名称相同的所有参数都相同的功能,虽然在heatmapadd.expr,它可以用于添加图形元素后调用image,可能会不会产生有用的结果。还要注意,行和列标签是可选的,即如果相应的dimnamexNULL显示,没有标签。
Note that setting Rowv or Colv to NA completely suppresses re-ordering of rows or columns as well as the corresponding dendrogram. Setting both to NA works basically like image (though you can still add a legend).
注意:该设置Rowv或ColvNA完全抑制重新排序的行或列,以及相应的聚类分析。同时设置NA基本上一样image(虽然你仍然可以添加图例)。
Setting trim to a number between 0 and 1 uses equidistant classes between the (trim)- and (1-trim)-quantile, and lumps the values below and above this range into separate open-ended classes. If the data comes from a heavy-tailed distribution, this can save the display from putting too many values into to few classes.
设置trim0和1之间的数字之间使用等距离类(trim) - (1 - trim)位数,肿块低于和高于这个范围的值将单独开放式课程。如果数据从一个重尾分布,这样可以节省显示,从投入到少数几类值太多。
值----------Value----------
Same as heatmap with keep.dendro=FALSE: an invisible list giving the reordered indices of the row- and column-elements as elements rowInd and colInd.
一样heatmapkeep.dendro=FALSE:一种无形的列表,让行的重新排序的指标和列元素为元素rowInd和colInd。
作者(S)----------Author(s)----------
Original by Andy Liaw, with revisions by Robert Gentleman and Martin Maechler.
Alexander Ploner for this version.
参见----------See Also----------
heatmap, hclust, heatmap_plus, regHeatmap, annHeatmap
heatmap,hclust,heatmap_plus,regHeatmap,annHeatmap
举例----------Examples----------
# create data[创建数据]
mm = matrix(rnorm(1000, m=1), 100,10)
mm = cbind(mm, matrix(rnorm(2000), 100, 20))
mm = cbind(mm, matrix(rnorm(1500, m=-1), 100, 15))
mm2 = matrix(rnorm(450), 30, 15)
mm2 = cbind(mm2, matrix(rnorm(900,m=1.5), 30,30))
mm=rbind(mm, mm2)
colnames(mm) = paste("Sample", 1:45)
rownames(mm) = paste("Gene", 1:130)
# similar to base heatmap[类似碱基热图]
heatmap_2(mm)
# remove column dendrogram[删除列树状]
heatmap_2(mm, do.dendro=c(TRUE, FALSE))
# add a legend under the plot[下添加一个传奇的图]
heatmap_2(mm, legend=1)
# make it smaller[使其变小]
heatmap_2(mm, legend=1, legfrac=10)
# ... on the left side[...在左侧]
heatmap_2(mm, legend=2, legfrac=10)
# remove the column labels by removing the column names[删除删除列名的列标签]
colnames(mm)=NULL
heatmap_2(mm, legend=1, legfrac=10)
# truncate the data drastically[彻底截断的数据]
heatmap_2(mm, legend=1, legfrac=10, trim=0.1)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|