ComplexHeatmap icon indicating copy to clipboard operation
ComplexHeatmap copied to clipboard

hclust size cannot be NA nor exceed 65536

Open zhanghaoipp opened this issue 2 years ago • 3 comments

my dataset is 77422*207 without NA, it showed error as:

Error in hclust(get_dist(submat, distance), method = method) : size cannot be NA nor exceed 65536 Calls: draw ... make_row_cluster -> .local -> make_cluster -> hclust Execution halted

it means can not handle more than 65536 rows?

Thank you!

zhanghaoipp avatar Dec 04 '22 08:12 zhanghaoipp

It is the limit of hclust(). You can sample e.g. 5000 rows from 70k rows. For the heatmap visualization, it is basically the same.

jokergoo avatar Dec 04 '22 19:12 jokergoo

@jokergoo Looks like: https://github.com/cran/fastcluster fastcluster::hclust could help with this issue: https://github.com/jcao89757/TESSA

hsiaoyi0504 avatar Jun 13 '23 19:06 hsiaoyi0504

Trying to change the clustering method solves this problem,here is my code:

Heatmap(matrix =mat,
           # cluster_columns = T,
           # cluster_rows = T,
           cluster_rows = function(x){genieclust::gclust(x,distance="euclidean")},
           cluster_columns = function(x){genieclust::gclust(x,distance="euclidean")}
)

BioLaoXu avatar Jul 06 '23 06:07 BioLaoXu