GreenleafLab / ArchR

ArchR : Analysis of Regulatory Chromatin in R (www.ArchRProject.com)
MIT License
384 stars 137 forks source link

Viewport not found for plotEnrichHeatmap result #1601

Closed chuyaowang closed 2 years ago

chuyaowang commented 2 years ago

Attach your log file ArchR-addReproduciblePeakSet-3912e6e2aaa-Date-2022-09-02_Time-06-30-34.log ArchR-getMarkerFeatures-52ae2d2c7232-Date-2022-09-03_Time-13-26-55.log ArchR-peakAnnoEnrichment-52ae41e06424-Date-2022-09-03_Time-13-51-24.log ArchR-plotEnrichHeatmap-52ae6835165f-Date-2022-09-03_Time-14-07-05.log

Describe the bug The error "ERROR while rich displaying an object: Error in grid.Call.graphics(C_downvppath, name$path, name$name, strict): Viewport 'Norm. Enrichment -log10(P-adj) [0-Max]_heatmap_body_1_1' was not found" is returned when trying to display the output of plotEnrichHeatmap

To Reproduce I have not yet, but I am following a tutorial to learn scATAC analysis in a class, and others have not encountered this problem

Expected behavior A heatmap be generated

Additional context I am analyzing a mouse brain scATAC dataset. After creating pseudo-bulks, peak calling using MACS2, getting marker peaks for each cell type, annotating motifs, now I want a heatmap of motif enrichment for each cell type. It might be useful to know I annotated the cells using annotated scRNA data from https://signac-objects.s3.amazonaws.com/allen_brain.rds

rcorces commented 2 years ago

Hi @chuyaowang! Thanks for using ArchR! Please make sure that your post belongs in the Issues section. Only bugs and error reports belong in the Issues section. Usage questions and feature requests should be posted in the Discussions section, not in Issues.
Before we help you, you must respond to the following questions unless your original post already contained this information: 1. If you've encountered an error, have you already searched previous Issues to make sure that this hasn't already been solved? 2. Can you recapitulate your error using the tutorial code and dataset? If so, provide a reproducible example. 3. Did you post your log file? If not, add it now. 4. Remove any screenshots that contain text and instead copy and paste the text using markdown's codeblock syntax (three consecutive backticks). You can do this by editing your original post.

rcorces commented 2 years ago

I dont have any insight on this error. sorry. Most of what comes up on google seems to be related to jupyter notebooks but I'm not sure if you are using one.

QianhuiXu commented 1 year ago

Hello! I had similar errors with the example data. code: ComplexHeatmap::draw(heatmapEM, heatmap_legend_side = "bot", annotation_legend_side = "bot") error: Error in grid.Call.graphics(C_downvppath, name$path, name$name, strict): Viewport 'Norm. Enrichment -log10(P-adj) [0-Max]_heatmap_body_1_1' was not found Traceback:

  1. ComplexHeatmap::draw(heatmapEM, heatmap_legend_side = "bot", . annotation_legend_side = "bot")
  2. ComplexHeatmap::draw(heatmapEM, heatmap_legend_side = "bot", . annotation_legend_side = "bot")
  3. .local(object, ...)
  4. draw(ht_list, ...)
  5. draw(ht_list, ...)
  6. .local(object, ...)
  7. grid.draw(p)
  8. grid.draw.gTree(p)
  9. recordGraphics(drawGTree(x), list(x = x), getNamespace("grid"))
  10. drawGTree(x)
  11. grid.draw(x$children[[i]], recording = FALSE)
  12. grid.draw.grob(x$children[[i]], recording = FALSE)
  13. recordGraphics(drawGrob(x), list(x = x), getNamespace("grid"))
  14. drawGrob(x)
  15. preDraw(x)
  16. preDraw.grob(x)
  17. pushvpgp(x)
  18. pushgrobvp(x$vp)
  19. pushgrobvp.vpPath(x$vp)
  20. downViewport(vp, strict = TRUE, recording = FALSE)
  21. downViewport.vpPath(vp, strict = TRUE, recording = FALSE)
  22. grid.Call.graphics(C_downvppath, name$path, name$name, strict)

Have you solved this problem? I'm really at a loss as to how to proceed, and any guidance would be much appreciated! Thank you for your kind help!

MoritzTh commented 1 year ago

Hi @chuyaowang @QianhuiXu, I am having the exact same issue. Did you find a way to solve it yet? Thanks in advance!

rcorces commented 1 year ago

I'm happy to reopen this if someone can provide a reproducible example

zhijunyuu commented 1 year ago

Hi all,

I had exactly the same error when using plotEnrichHeatmap in jupyternotebook interface:

Error in grid.Call.graphics(C_downvppath, name$path, name$name, strict): Viewport 'Norm. Enrichment -log10(P-adj) [0-Max]_heatmap_body_1_1' was not found

And I could work around it by submitting a job to run the data. So seems it's en issue related with jupyter. I have R 4.2.2 and ArchR 1.0.2 Hope this helps.

Best, Zhijun

ajinocean commented 10 months ago

Hi everyone, I also happened to this issue. Dose anyone have solve this problem ? Thanks! Eco

ERROR while rich displaying an object: Error in grid.Call.graphics(C_downvppath, name$path, name$name, strict): Viewport 'Relative strength_heatmap_body_1_1' was not found

Traceback:
1. tryCatch(withCallingHandlers({
 .     if (!mime %in% names(repr::mime2repr)) 
 .         stop("No repr_* for mimetype ", mime, " in repr::mime2repr")
 .     rpr <- repr::mime2repr[[mime]](obj)
 .     if (is.null(rpr)) 
 .         return(NULL)
 .     prepare_content(is.raw(rpr), rpr)
 . }, error = error_handler), error = outer_handler)
2. tryCatchList(expr, classes, parentenv, handlers)
3. tryCatchOne(expr, names, parentenv, handlers[[1L]])
4. doTryCatch(return(expr), name, parentenv, handler)
5. withCallingHandlers({
 .     if (!mime %in% names(repr::mime2repr)) 
 .         stop("No repr_* for mimetype ", mime, " in repr::mime2repr")
 .     rpr <- repr::mime2repr[[mime]](obj)
 .     if (is.null(rpr)) 
 .         return(NULL)
 .     prepare_content(is.raw(rpr), rpr)
 . }, error = error_handler)
6. repr::mime2repr[[mime]](obj)
7. repr_text.default(obj)
8. paste(capture.output(print(obj)), collapse = "\n")
9. capture.output(print(obj))
10. withVisible(...elt(i))
11. print(obj)
12. print.default(obj)
Cheyujlee commented 10 months ago

I was only able to resolve it by downgrading the ComplexHeatmap version to v2.10.0 (current is v2.16.0). To do so, you also need to downgrade your Bioconductor BiocManager version, which also means you need to downgrade your R version. For me, the combination of R (v4.1.3)–Bioconductor (v3.14)–ComplexHeatmap (v2.10.0) worked. It may work for other combinations, but just this one worked for me.

I think the main problem is that they are still trying to make packages compatible with the newest version of R (v4.3.2).

alekseybelikov commented 1 day ago

Same problem

ComplexHeatmap::draw(heatmapEM, heatmap_legend_side = "bot", annotation_legend_side = "bot")

debugging in: ComplexHeatmap::draw(heatmapEM, heatmap_legend_side = "bot", annotation_legend_side = "bot") debug: standardGeneric("draw") debugging in: draw(ht_list, ...) debug: standardGeneric("draw") debugging in: draw(object, newpage = newpage, background = background, row_title = row_title, row_title_side = row_title_side, row_title_gp = row_title_gp, column_title = column_title, column_title_side = column_title_side, column_title_gp = column_title_gp, heatmap_legend_side = heatmap_legend_side, merge_legends = merge_legends, show_heatmap_legend = show_heatmap_legend, heatmap_legend_list = heatmap_legend_list, annotation_legend_side = annotation_legend_side, show_annotation_legend = show_annotation_legend, annotation_legend_list = annotation_legend_list, align_heatmap_legend = align_heatmap_legend, align_annotation_legend = align_annotation_legend, legend_grouping = legend_grouping, gap = gap, ht_gap = ht_gap, main_heatmap = main_heatmap, padding = padding, adjust_annotation_extension = adjust_annotation_extension, auto_adjust = auto_adjust, row_dend_side = row_dend_side, row_sub_title_side = row_sub_title_side, column_dend_side = column_dend_side, column_sub_title_side = column_sub_title_side, row_gap = row_gap, cluster_rows = cluster_rows, cluster_row_slices = cluster_row_slices, clustering_distance_rows = clustering_distance_rows, clustering_method_rows = clustering_method_rows, row_dend_width = row_dend_width, show_row_dend = show_row_dend, row_dend_reorder = row_dend_reorder, row_dend_gp = row_dend_gp, row_order = row_order, km = km, split = split, row_km = row_km, row_km_repeats = row_km_repeats, row_split = row_split, height = height, heatmap_height = heatmap_height, column_gap = column_gap, cluster_columns = cluster_columns, cluster_column_slices = cluster_column_slices, clustering_distance_columns = clustering_distance_columns, clustering_method_columns = clustering_method_columns, column_dend_width = column_dend_width, show_column_dend = show_column_dend, column_dend_reorder = column_dend_reorder, column_dend_gp = column_dend_gp, column_order = column_order, column_km = column_km, column_km_repeats = column_km_repeats, column_split = column_split, width = width, heatmap_width = heatmap_width, use_raster = use_raster, raster_device = raster_device, raster_quality = raster_quality, raster_device_param = raster_device_param, raster_resize = raster_resize, post_fun = post_fun, save_last = save_last, heatmap_row_names_gp = heatmap_row_names_gp, heatmap_column_names_gp = heatmap_column_names_gp, heatmap_row_title_gp = heatmap_row_title_gp, heatmap_column_title_gp = heatmap_column_title_gp, legend_title_gp = legend_title_gp, legend_title_position = legend_title_position, legend_labels_gp = legend_labels_gp, legend_grid_height = legend_grid_height, legend_grid_width = legend_grid_width, legend_border = legend_border, legend_gap = legend_gap, heatmap_border = heatmap_border, annotation_border = annotation_border, fastcluster = fastcluster, simple_anno_size = simple_anno_size, show_parent_dend_line = show_parent_dend_line) debug: standardGeneric("draw") debugging in: draw(ht, internal = TRUE) debug: standardGeneric("draw") debugging in: draw(anno, index = ind, x = x, y = y, just = just) debug: standardGeneric("draw") exiting from: draw(anno, index = ind, x = x, y = y, just = just) debugging in: draw(annotation, index = index, k = k, n = n, anno_mark_param = anno_mark_param) debug: standardGeneric("draw") debugging in: draw(object@anno_list[[i]], index, k, n, anno_mark_param = anno_mark_param) debug: standardGeneric("draw") debugging in: draw(object@fun, index = index, k = k, n = n) debug: standardGeneric("draw") exiting from: draw(object@fun, index = index, k = k, n = n) exiting from: draw(object@anno_list[[i]], index, k, n, anno_mark_param = anno_mark_param) exiting from: draw(annotation, index = index, k = k, n = n, anno_mark_param = anno_mark_param) exiting from: draw(ht, internal = TRUE) debugging in: draw(pk, y = height 0.5) debug: standardGeneric("draw") exiting from: draw(pk, y = height 0.5) exiting from: draw(object, newpage = newpage, background = background, row_title = row_title, row_title_side = row_title_side, row_title_gp = row_title_gp, column_title = column_title, column_title_side = column_title_side, column_title_gp = column_title_gp, heatmap_legend_side = heatmap_legend_side, merge_legends = merge_legends, show_heatmap_legend = show_heatmap_legend, heatmap_legend_list = heatmap_legend_list, annotation_legend_side = annotation_legend_side, show_annotation_legend = show_annotation_legend, annotation_legend_list = annotation_legend_list, align_heatmap_legend = align_heatmap_legend, align_annotation_legend = align_annotation_legend, legend_grouping = legend_grouping, gap = gap, ht_gap = ht_gap, main_heatmap = main_heatmap, padding = padding, adjust_annotation_extension = adjust_annotation_extension, auto_adjust = auto_adjust, row_dend_side = row_dend_side, row_sub_title_side = row_sub_title_side, column_dend_side = column_dend_side, column_sub_title_side = column_sub_title_side, row_gap = row_gap, cluster_rows = cluster_rows, cluster_row_slices = cluster_row_slices, clustering_distance_rows = clustering_distance_rows, clustering_method_rows = clustering_method_rows, row_dend_width = row_dend_width, show_row_dend = show_row_dend, row_dend_reorder = row_dend_reorder, row_dend_gp = row_dend_gp, row_order = row_order, km = km, split = split, row_km = row_km, row_km_repeats = row_km_repeats, row_split = row_split, height = height, heatmap_height = heatmap_height, column_gap = column_gap, cluster_columns = cluster_columns, cluster_column_slices = cluster_column_slices, clustering_distance_columns = clustering_distance_columns, clustering_method_columns = clustering_method_columns, column_dend_width = column_dend_width, show_column_dend = show_column_dend, column_dend_reorder = column_dend_reorder, column_dend_gp = column_dend_gp, column_order = column_order, column_km = column_km, column_km_repeats = column_km_repeats, column_split = column_split, width = width, heatmap_width = heatmap_width, use_raster = use_raster, raster_device = raster_device, raster_quality = raster_quality, raster_device_param = raster_device_param, raster_resize = raster_resize, post_fun = post_fun, save_last = save_last, heatmap_row_names_gp = heatmap_row_names_gp, heatmap_column_names_gp = heatmap_column_names_gp, heatmap_row_title_gp = heatmap_row_title_gp, heatmap_column_title_gp = heatmap_column_title_gp, legend_title_gp = legend_title_gp, legend_title_position = legend_title_position, legend_labels_gp = legend_labels_gp, legend_grid_height = legend_grid_height, legend_grid_width = legend_grid_width, legend_border = legend_border, legend_gap = legend_gap, heatmap_border = heatmap_border, annotation_border = annotation_border, fastcluster = fastcluster, simple_anno_size = simple_anno_size, show_parent_dend_line = show_parent_dend_line)

{ "name": "ERROR", "message": "Error in grid.Call.graphics(C_downvppath, name$path, name$name, strict): Viewport 'Norm. Enrichment -log10(P-adj) [0-Max]_heatmap_body_1_1' was not found ", "stack": "Error in grid.Call.graphics(C_downvppath, name$path, name$name, strict): Viewport 'Norm. Enrichment -log10(P-adj) [0-Max]_heatmap_body_1_1' was not found Traceback:

  1. ComplexHeatmap::draw(heatmapEM, heatmap_legend_side = \"bot\", . annotation_legend_side = \"bot\")
  2. ComplexHeatmap::draw(heatmapEM, heatmap_legend_side = \"bot\", . annotation_legend_side = \"bot\")
  3. .local(object, ...)
  4. draw(ht_list, ...)
  5. draw(ht_list, ...)
  6. .local(object, ...)
  7. grid.draw(p)
  8. grid.draw.gTree(p)
  9. recordGraphics(drawGTree(x), list(x = x), getNamespace(\"grid\"))
  10. drawGTree(x)
  11. grid.draw(x$children[[i]], recording = FALSE)
  12. grid.draw.grob(x$children[[i]], recording = FALSE)
  13. recordGraphics(drawGrob(x), list(x = x), getNamespace(\"grid\"))
  14. drawGrob(x)
  15. preDraw(x)
  16. preDraw.grob(x)
  17. pushvpgp(x)
  18. pushgrobvp(x$vp)
  19. pushgrobvp.vpPath(x$vp)
  20. downViewport(vp, strict = TRUE, recording = FALSE)
  21. downViewport.vpPath(vp, strict = TRUE, recording = FALSE)
  22. grid.Call.graphics(C_downvppath, name$path, name$name, strict)" }

ArchR-plotEnrichHeatmap-21d08ead457-Date-2024-10-22_Time-17-22-09.675731.log

alekseybelikov commented 1 day ago

Hi all,

I had exactly the same error when using plotEnrichHeatmap in jupyternotebook interface:

Error in grid.Call.graphics(C_downvppath, name$path, name$name, strict): Viewport 'Norm. Enrichment -log10(P-adj) [0-Max]_heatmap_body_1_1' was not found

And I could work around it by submitting a job to run the data. So seems it's en issue related with jupyter. I have R 4.2.2 and ArchR 1.0.2 Hope this helps.

Best, Zhijun

How exactly you solved this? Care to write step by step instruction for us mortals?