Closed rbutleriii closed 1 year ago
Hi,
Likely it does not work with wrap_plots as neither the heatmap nor the chord are ggplot2 objects.
The chord_diagram is a circlelize object and the heatmap is generated with ComplexHeatmap.
You could check how both of these types are usually appended, e.g. https://jokergoo.github.io/ComplexHeatmap-reference/book/a-list-of-heatmaps.html, https://jokergoo.github.io/circlize_book/book/advanced-layout.html#arrange-multiple-plots
Hope this helps!
Success! I eventually figured out to pass the base R objects (heatmap + circlize plots) by passing the function as a formula instead of calling it:
# in this case, liana.agg is a list of aggregated liana results
liana.trunc = lapply(liana.agg, filter, aggregate_rank <= 1e-5)
outnames = c("Wild Type Veh", "Wild Type C31", "PS19 Veh", "PS19 C31")
# chord plot for frequency
circos.clear()
p.list = lapply(seq(liana.trunc), function(i){
wrap_elements(full= ~ chord_freq(liana.trunc[[i]])) +
ggtitle(outnames[i])
})
ggsave(filename=paste(round_num, nameset, cate, "all_filtered_1e-5.png", sep="."),
plot=wrap_plots(p.list), dpi=300, width=16, height=16, type="cairo")
This also works if you want to pass additional arguments to chordDiagram
, although I haven't played with it a lot yet. Next stop, trying to get the tensor c2c running.
Hi,
I have several groups in a list of liana aggregate results, and I have been trying to get the
heat_freq
andchord_freq
plots to cooperate withpatchwork
, but no success this farIt does work for
liana_dotplot
, but I cannot figure out how to wrap or draw the objects withwrap_elements
orgrid.grabExpr