代码之家  ›  专栏  ›  技术社区  ›  Majid

如何在biclust热图中显示行和列名?

  •  1
  • Majid  · 技术社区  · 7 年前

    我已经用下面的代码在biclust包中绘制了热图,但是我找不到任何添加行和列名的选项。

    library(biclust)
    set.seed(1234)
    data(BicatYeast)
    resplaid <- biclust(BicatYeast, BCBimax(), verbose = FALSE)
    heatmapBC(x = BicatYeast, bicResult = resplaid)
    

    我怎么画呢?

    1 回复  |  直到 7 年前
        1
  •  2
  •   paoloeusebi    7 年前

    这里有一个解决方案。查看heatmapBC函数,您会看到默认情况下轴设置为FALSE! 我使用了BicatYeast数据的一个子集版本,以使绘图更清晰

     library(biclust)
     set.seed(1234)
     data(BicatYeast)
     d <- as.matrix(BicatYeast)[1:30, 1:20]; d
     resplaid <- biclust(d, BCBimax())
     par(mar=c(10, 6, 2, 2) + 0.1)
     heatmapBC(x = d, bicResult = resplaid, axes = F, xlab = "", ylab = "")
     axis(1, at=1:dim(d)[2], labels = colnames(d), las=2)
     axis(2, at=1:dim(d)[1], labels = rownames(d), las=2)
    

    enter image description here