作者:Zuguang Gu8
    编译:Steven Shen
    原文:2.4 Set row and column orders


    Clustering is used to adjust row orders and column orders of the heatmap, but you can still set the order manually by row_order and column_order. If e.g. row_order is set, row clustering is turned off by default.
    聚类用于调整热图的行顺序和列顺序,但您仍可以通过 row_ordercolumn_order 手动设置顺序。如果是设置了 row_order ,默认情况下关闭行聚类。

    1. Heatmap(mat, name = "mat", row_order = order(as.numeric(gsub("row", "", rownames(mat)))),
    2. column_order = order(as.numeric(gsub("column", "", colnames(mat)))))

    2.4 设置行和列顺序 - 图1

    The orders can be character vectors if they are just shuffles of the matrix row names or column names.
    顺序可以是字符向量,如果它们只是矩阵行名称或列名称的混合。

    1. Heatmap(mat, name = "mat", row_order = sort(rownames(mat)),
    2. column_order = sort(colnames(mat)))

    2.4 设置行和列顺序 - 图2

    Note row_dend_reorder and row_order are two different things. row_dend_reorder is applied on the dendrogram. For any node in the dendrogram, rotating its two branches actually gives an identical dendrogram, thus, reordering the dendrogram by automatically rotating sub-dendrogram at every node can help to separate elements further from each other which show more difference. As a comparison, row_order is simply applied on the matrix and normally dendrograms should be turned off.
    注意 row_dend_reorderrow_order 是两回事。 row_dend_reorder 应用于树形图。对于树形图中的任何节点,旋转其两个分支实际上给出了相同的树形图,因此,通过在每个节点处自动旋转子树形图来重新排序树形图可以帮助将元素彼此进一步分离,这显示出更多的差异。作为比较, row_order 仅应用于矩阵,通常这时候树形图应该会被关闭。

    —— 本节完 ——