按列和行划分不适用于'ComplexHeatmap'-即使使用其自己的示例?

时间:2019-04-15 16:46:02

标签: r matrix heatmap bioinformatics

我目前正在尝试使用ComplexHeatmap来组装热图。但是,当我尝试按列和行划分热图时,它不起作用。

当我回到ComplexHeatmap附带的documentation时,我发现他们自己的示例将不起作用,并返回错误消息unused arguments。我想知道是否有人能够阐明可能发生的情况。

这是示例矩阵:

set.seed(123)
nr1 = 4; nr2 = 8; nr3 = 6; nr = nr1 + nr2 + nr3
nc1 = 6; nc2 = 8; nc3 = 10; nc = nc1 + nc2 + nc3
mat = cbind(rbind(matrix(rnorm(nr1*nc1, mean = 1,   sd = 0.5), nr = nr1),
                  matrix(rnorm(nr2*nc1, mean = 0,   sd = 0.5), nr = nr2),
                  matrix(rnorm(nr3*nc1, mean = 0,   sd = 0.5), nr = nr3)),
            rbind(matrix(rnorm(nr1*nc2, mean = 0,   sd = 0.5), nr = nr1),
                  matrix(rnorm(nr2*nc2, mean = 1,   sd = 0.5), nr = nr2),
                  matrix(rnorm(nr3*nc2, mean = 0,   sd = 0.5), nr = nr3)),
            rbind(matrix(rnorm(nr1*nc3, mean = 0.5, sd = 0.5), nr = nr1),
                  matrix(rnorm(nr2*nc3, mean = 0.5, sd = 0.5), nr = nr2),
                  matrix(rnorm(nr3*nc3, mean = 1,   sd = 0.5), nr = nr3))
)
mat = mat[sample(nr, nr), sample(nc, nc)] # random shuffle rows and columns
rownames(mat) = paste0("row", seq_len(nr))
colnames(mat) = paste0("column", seq_len(nc))

哪些可以给您以下内容?

enter image description here

这是演示如何使用行和列拆分的命令:

install.packages('ComplexHeatmap')


Heatmap(mat, name = "mat", 
        row_split = rep(c("A", "B"), 9), column_split = rep(c("C", "D"), 12))

这是ComplexHeatmap的创建者说我应该期望的输出,正如您所看到的,它被很好地分为四个图块。

enter image description here

但是我得到的只是以下错误消息:

Error in Heatmap(mat, name = "mat", row_split = rep(c("A", "B"), 9), column_split = rep(c("C",  : 
  unused arguments (row_split = rep(c("A", "B"), 9), column_split = rep(c("C", "D"), 12))

即使他们提供的示例也不起作用,我也在努力取得进展。

由于某种原因,heatmap.2开始表现异常,我已经交换过一次软件包,为此我在其他地方提出了another question

1 个答案:

答案 0 :(得分:0)

尽管具有最新版本,但运行以下命令似乎可以解决我一直遇到的问题。

library(devtools)
install_github("jokergoo/ComplexHeatmap", force = TRUE)

即使正在运行,

library(devtools)
install_github("jokergoo/ComplexHeatmap")

产生了以下内容,

Skipping install of 'ComplexHeatmap' from a github remote, the SHA1 (c79aaf9e) has not changed since last install.

完全是我自己的错,因为实际上并没有强制重新安装。