jokergoo / EnrichedHeatmap

make enriched heatmap which visualizes the enrichment of genomic signals to specific target regions.
http://jokergoo.github.io/EnrichedHeatmap/
Other
187 stars 25 forks source link

Strange subscript out of bounds error #78

Open yimingsun12138 opened 1 year ago

yimingsun12138 commented 1 year ago

Hi, I got a strange error.

Here is my code: EnrichedHeatmap(mat = mat1,row_split = factor(group_list[rownames(mat1)],levels = c('level1','level2','level3')),use_raster = TRUE,raster_resize_mat = mean,col = col_fun,pos_line = FALSE,row_order = p@row_order,name = '1',width = unit(1.5,'inches'),height = unit(9,'inches'),show_heatmap_legend = FALSE) + EnrichedHeatmap(mat = mat2,row_split = factor(group_list[rownames(mat2)],levels = c('level1','level2','level3')),use_raster = TRUE,raster_resize_mat = mean,col = col_fun,pos_line = FALSE,row_order = p@row_order,name = '2',width = unit(1.5,'inches'),height = unit(9,'inches'),show_heatmap_legend = FALSE) + EnrichedHeatmap(mat = mat3,row_split = factor(group_list[rownames(mat3)],levels = c('level1','level2','level3')),use_raster = TRUE,raster_resize_mat = mean,col = col_fun,pos_line = FALSE,row_order = p@row_order,name = '3',width = unit(1.5,'inches'),height = unit(9,'inches'),show_heatmap_legend = TRUE)

And I get the error: Error in mat[seq(ind_r1[i], ind_r2[i]), seq(ind_c1[j], ind_c1[j]), drop = FALSE] : subscript out of bounds

But if I modify the height parameter to 10 inches, the error gone away and the plot generated perfectly. That's quite strange and I do not know how this error happened. Firstly I guess it may be because of I have too many rows (around 5w peaks), but when I use another peak set to generate the enriched heatmap with the same code, 10 inches lead to error and 9 inches worked well.

Can you look into this error and give me any clue about how to avoid it? Thank you so much for your amazing tools!

yimingsun12138 commented 1 year ago

Hi, I saw your update on wechat which says you were busy and didn't have time for github issues last year. So i wanna take a chance to see whether you can see this issue now LOL. Anyway, thank you for your time and amazing tools.