我正在尝试使用Seurat中的DoHeatmap函数来显示一些定义的簇中的一些基因的表达。B_cells是我的Seurat对象。
tfs <- c("PRDM1", "PAX5", "BACH2")
DoHeatmap(B_cells, features=tfs)我正在找回这个错误;
Error in data.frame(group = sort(x = group.use), x = x.divs) :
arguments imply differing number of rows: 10411, 0当我查看Seurat对象中的行数和列数时;
nrow(B_cells) = 19651
ncol(B_cells) = 10151抱歉,如果这是一个愚蠢的问题,但我已经被困了一段时间了。
编辑回溯():
3: stop(gettextf("arguments imply differing number of rows: %s",
paste(unique(nrows), collapse = ", ")), domain = NA)
2: data.frame(group = sort(x = group.use), x = x.divs)
1: DoHeatmap(B_cells, features = genes)发布于 2020-03-29 22:11:22
可以在https://github.com/satijalab/seurat/blob/develop/R/visualization.R中找到DoHeatmap()函数的源代码。traceback()显示visualization.R的第363行导致了错误:
if (label) {
x.max <- max(pbuild$layout$panel_params[[1]]$x.range)
# Attempt to pull xdivs from x.major in ggplot2 < 3.3.0; if NULL, pull from the >= 3.3.0 slot
x.divs <- pbuild$layout$panel_params[[1]]$x.major %||% pbuild$layout$panel_params[[1]]$x$break_positions()
x <- data.frame(group = sort(x = group.use), x = x.divs)
...
} 作为绕过该错误的解决方法,请尝试:
DoHeatmap(B_cells, features=tfs, label=FALSE)https://stackoverflow.com/questions/60869986
复制相似问题