saeyslab / multinichenetr

MultiNicheNet: a flexible framework for differential cell-cell communication analysis from multi-sample multi-condition single-cell transcriptomics data
GNU General Public License v3.0
112 stars 14 forks source link

Error polygon edge not found for ggraph_signaling_path$plot #29

Closed lchan8 closed 10 months ago

lchan8 commented 1 year ago

Hi,

I ran into the following error when I was running the vignette: MultiNicheNet analysis: MIS-C threewise comparison - step-by-step with all details. This occurs when I am running the code to visualize the ‘prior knowledge’ ligand-receptor-to-target signaling paths. I am using multinichenetr 1.0.3.

ggraph_signaling_path$plot Error in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : polygon edge not found

traceback() 40: grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, resolveHJust(x$just, x$hjust), resolveVJust(x$just, x$vjust), x$rot, 0) 39: widthDetails.text(x) 38: widthDetails(x) 37: (function (x) { widthDetails(x) })(structure(list(label = "IFNG", x = structure(list(list(1, structure(list(list(0.52332558081627, NULL, 4L), list(0, NULL, 3L)), class = c("unit", "unit_v2")), 201L)), class = c("unit", "unit_v2")), y = structure(list(list(1, structure(list(list(0.455192223331275, NULL, 4L), list(0, NULL, 3L)), class = c("unit", "unit_v2" )), 201L)), class = c("unit", "unit_v2")), just = c(0.5, 0.5), hjust = NULL, vjust = NULL, rot = 0, check.overlap = FALSE, name = "text", gp = structure(list(col = "purple", fontsize = 12.8037401574803, fontfamily = "Serif", lineheight = 1.2, font = c(bold = 2L)), class = "gpar"), vp = NULL), class = c("text", "grob", "gDesc"))) 36: grid.Call.graphics(C_setviewport, vp, TRUE) 35: push.vp.viewport(X[[i]], ...) 34: FUN(X[[i]], ...) 33: lapply(vps, push.vp, recording) 32: pushViewport(vp, recording = FALSE) 31: pushgrobvp.viewport(x$vp) 30: pushgrobvp(x$vp) 29: pushvpgp(x) 28: preDraw.grob(x) 27: preDraw(x) 26: drawGrob(x) 25: recordGraphics(drawGrob(x), list(x = x), getNamespace("grid")) 24: grid.draw.grob(x$children[[i]], recording = FALSE) 23: grid.draw(x$children[[i]], recording = FALSE) 22: drawGTree(x) 21: recordGraphics(drawGTree(x), list(x = x), getNamespace("grid")) 20: grid.draw.gTree(x$children[[i]], recording = FALSE) 19: grid.draw(x$children[[i]], recording = FALSE) 18: drawGTree(x) 17: recordGraphics(drawGTree(x), list(x = x), getNamespace("grid")) 16: grid.draw.gTree(x$children[[i]], recording = FALSE) 15: grid.draw(x$children[[i]], recording = FALSE) 14: drawGTree(x) 13: recordGraphics(drawGTree(x), list(x = x), getNamespace("grid")) 12: grid.draw.gTree(x$children[[i]], recording = FALSE) 11: grid.draw(x$children[[i]], recording = FALSE) 10: drawGTree(x) 9: recordGraphics(drawGTree(x), list(x = x), getNamespace("grid")) 8: grid.draw.gTree(x$children[[i]], recording = FALSE) 7: grid.draw(x$children[[i]], recording = FALSE) 6: drawGTree(x) 5: recordGraphics(drawGTree(x), list(x = x), getNamespace("grid")) 4: grid.draw.gTree(gtable) 3: grid.draw(gtable) 2: print.ggplot(x) 1: (function (x, ...) UseMethod("print"))(x)

I also got the same error when I was working my own dataset.

browaeysrobin commented 10 months ago

Hi @lchan8

Can you confirm this also happens after updating ggraph, tidygraph, and igraph to their latest versions. For me, there are no issues at all in running this code in the example vignettes, so I suspect your problem may have to do with version incongruencies.

lchan8 commented 10 months ago

Thank you for looking into it! My packages were all up-to-date, but I realized that when I changed font to "serif" instead of "Serif," it resolved the issue for me.