简体   繁体   English

circos.heatmap():rowMeans(m) 中的错误:'x' 必须是至少有两个维度的数组

[英]circos.heatmap(): Error in rowMeans(m) : 'x' must be an array of at least two dimensions

I'm following the tutorial to make circular plots in R .我正在按照教程在 R 中制作圆形图 Suppose I have this dataset:假设我有这个数据集:

set.seed(123)
    mat1 = rbind(cbind(matrix(rnorm(50*5, mean = 1), nr = 50), 
                   matrix(rnorm(50*5, mean = -1), nr = 50)),
                cbind(matrix(rnorm(50*5, mean = -1), nr = 50), 
                   matrix(rnorm(50*5, mean = 1), nr = 50))
                )
    rownames(mat1) = paste0("R", 1:100)
    colnames(mat1) = paste0("C", 1:10)
    mat1 = mat1[sample(100, 100), ] # randomly permute rows
    split = sample(letters[1:5], 100, replace = TRUE)
    split = factor(split, levels = letters[1:5])

I tried using Heatmap and it returns appropriately.我尝试使用Heatmap并正确返回。

library(ComplexHeatmap)
Heatmap(mat1, row_split = split)

enter image description here在此处输入图片说明

However, when I try to use circos.heatmap() , it returns error:但是,当我尝试使用circos.heatmap() ,它返回错误:

library(circlize)
col_fun1 = colorRamp2(c(-2, 0, 2), c("blue", "white", "red"))
circos.heatmap(mat = mat1, split = split, col = col_fun1)
circos.heatmap(mat = mat1, col = col_fun1)
> Error in rowMeans(m) : 'x' must be an array of at least two dimensions

The matrix itself has a dimension of 100 x 10. Is there anything I'm missing?矩阵本身的尺寸为 100 x 10。有什么我遗漏的吗?

Had the same issue with CRAN version, but it was rectified after installing the dev version CRAN版本有同样的问题,但在安装开发版本后得到纠正

devtools::install_github("jokergoo/circlize")

-testing -测试

> library(circlize)
========================================
circlize version 0.4.13
CRAN page: https://cran.r-project.org/package=circlize
Github page: https://github.com/jokergoo/circlize
Documentation: https://jokergoo.github.io/circlize_book/book/

If you use it in published research, please cite:
Gu, Z. circlize implements and enhances circular visualization
  in R. Bioinformatics 2014.

This message can be suppressed by:
  suppressPackageStartupMessages(library(circlize))
========================================

> col_fun1 = colorRamp2(c(-2, 0, 2), c("blue", "white", "red"))
> ?circos.heatmap
starting httpd help server ... done
> 
> set.seed(123)
> mat1 = rbind(cbind(matrix(rnorm(50*5, mean = 1), nr = 50), 
+                    matrix(rnorm(50*5, mean = -1), nr = 50)),
+              cbind(matrix(rnorm(50*5, mean = -1), nr = 50), 
+                    matrix(rnorm(50*5, mean = 1), nr = 50))
+             )
> rownames(mat1) = paste0("R", 1:100)
> colnames(mat1) = paste0("C", 1:10)
> mat1 = mat1[sample(100, 100), ] # randomly permute rows
> split = sample(letters[1:5], 100, replace = TRUE)
> spilt = factor(split, levels = letters[1:5])
> col_fun1 = colorRamp2(c(-2, 0, 2), c("blue", "white", "red"))
> circos.heatmap(mat1, split = split, col = col_fun1)
> circos.clear()

-output -输出

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 rowMeans() 进行故障排除 - 'x' 必须是至少有两个维度的数组 - Troubleshooting with rowMeans() - 'x' must be an array of at least two dimensions 错误:在大型数据框中使用rowMeans()时,“x”必须是至少包含两个维度的数组 - Error:'x' must be an array of at least two dimensions when using rowMeans() in a large dataframe R:“ x”中的colSums必须是至少二维的数组 - colSums in R: 'x' must be an array of at least two dimensions 'x'必须是至少二维的数组| SoFUN和溢出 - 'x' must be an array of at least two dimensions | SoFUN & Overflow rowSums(Qf)出错:'x'必须是至少两个维度的数组(msm :: msm2surv) - Error in rowSums(Qf) : 'x' must be an array of at least two dimensions (msm::msm2surv) rowSums(out_pathway) 中的错误:“x”必须是至少有两个维度的数组 - Error in rowSums(out_pathway) : 'x' must be an array of at least two dimensions DifR:rowSums(data,na.rm = TRUE)中的错误:“ x”必须为至少二维数组 - DifR : Error in rowSums(data, na.rm = TRUE) : 'x' must be an array of at least two dimensions 'x' 必须是至少包含两个维度的数组: 运行 textmineR package 以在 R 中进行文档聚类时出错 - 'x' must be an array of at least two dimensions: Error while running textmineR package for document clustering in R 'X' 作为至少二维数组 - 'X' as an array of at least two dimensions circlize::circos.heatmap 添加单元格之间的间隙 - circlize::circos.heatmap Add gaps between cells
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM