IanevskiAleksandr / sc-type

GNU General Public License v3.0
237 stars 45 forks source link

bubble plot vizualization with gridExtra::grid.arrange over scater::multiplot #34

Open pseudacriscrucifer opened 1 year ago

pseudacriscrucifer commented 1 year ago

Hello,

Following the tutorial and using brain tissue data: scater::multiplot(DimPlot(ddata_3tf, reduction = "umap", repel = TRUE, label = TRUE, cols = ccolss), gggr, cols = 2) error returned in bubble plot viz of multiplot being defunct: Error: 'multiplot' is defunct. Use 'scater::multiplot is defunct. Use 'gridExtra::grid.arrange' instead' instead. See help("Defunct")

How would I properly incorporate scater::multiplot parameters into gridExtra::grid.arrange()?

Trying gridExtra::grid.arrange(DimPlot(ddata_3tf, reduction = "umap", repel = TRUE, label = TRUE, cols = ccolss), gggr, cols = 2) returns the error of "Error in gList(...) : only 'grobs' allowed in "gList"".

Here is the error traceback too:

14. stop("only 'grobs' allowed in \"gList\"")
13. gList(...)
12. setChildren(gt, children)
11. gTree(children = gList(...), name = name, gp = gp, vp = vp, childrenvp = childrenvp,
cl = cl)
10. grobTree(grob, name = vp$name, vp = vp)
9. (function (grob, vp)
{
grobTree(grob, name = vp$name, vp = vp)
})(dots[[1L]][[3L]], dots[[2L]][[3L]])
8. mapply(wrap_gtableChild, x$grobs, children_vps, SIMPLIFY = FALSE)
7. makeContent.gtable(x)
6. makeContent(x)
5. drawGTree(x)
4. recordGraphics(drawGTree(x), list(x = x), getNamespace("grid"))
3. grid.draw.gTree(g)
2. grid.draw(g)
1. gridExtra::grid.arrange(DimPlot(ddata_3tf, reduction = "umap",
repel = TRUE, label = TRUE, cols = ccolss), gggr, cols = 2)
katarinazosel commented 1 year ago

Hello, I had this same error. What worked for me was to use gridExtra::grid.arrange(grobs = list(umap1, gggr), ncol = 2) where, in your case, umap1 <- Dimplot(ddata_3tf, reduction = "umap", repel = TRUE, label = TRUE, cols = colss)