jmw86069 / multienrichjam

Analysis and Visualization of Multiple Gene Set Enrichments
24 stars 4 forks source link

ComplexHeatmap Error #7

Closed gat2010 closed 2 years ago

gat2010 commented 2 years ago

Hi,

I am getting below error while running function mem_canonical_plots

(15:52:37) 23Mar2022: mem_plot_folio(): Enrichment P-value heatmap

(15:52:37) 23Mar2022: mem_plot_folio(): plot_num 1: Enrichment P-value Heatmap

Error in ComplexHeatmap::Heatmap(use_matrix, name = name, col = col_logp, : unused arguments (node_factor = 5, label_factor = 1.5)

jmw86069 commented 2 years ago

Ah I think I know the source of this error, and thank you for posting!

First, can you post the command you tried that caused the error? Include the arguments you used so I can confirm.

I think this error is caused when trying to pass ... to downstream functions such as jam_igraph() and ComplexHeatmap::Heatmap(), except Heatmap() does not allow ... so any extra arguments cause an error.

I think your code is something like this:

mem_plot_folio(mem,
   node_factor=5,
   label_factor=1.5)

There are two workarounds:

  1. Do not customize node_factor and label_factor at this step. You can call the relevant plot function directly and apply customizations, for example with mem_multienrichplot(mem, node_factor=5, label_factor=1.5) or the same with jam_igraph().
  2. (I would probably do this one.) Limit the plots rendered by mem_plot_folio() with argument do_which so it does not create the two heatmaps. The heatmaps are created as plot 1 and 2, for example:
    mem_plot_folio(mem,
    node_factor=5,
    label_factor=1.5,
    do_which=3:8) # it will create plots 3 through 8

I will update multienrichjam however I need a fix that will scale well. I probably need to intercept ... and pass only arguments accepted by ComplexHeatmap::Heatmap(). Later today or early tomorrow? I want to find a function I can use for that step, I seem to recall a package like dotfiles or something similar. :)

jmw86069 commented 2 years ago

I feel silly for missing the source of the error, which was the vignette! My mistake, I thought my process using pkgdown::build_site() would show that, so I must have missed the error.

I made some updates:

I rebuilt the site docs with pkgdown to confirm proper handling in the vignette, and function examples.

Update to test: remotes::install_github("jmw86069/multienrichjam") And thank you again for posting the issue!