sidbdri / cookiecutter-de_analysis_skeleton

Skeleton for new differential expression analysis project.
3 stars 1 forks source link

Fix heatmap #222

Closed deepalivasoya closed 2 months ago

deepalivasoya commented 8 months ago

For this patch of the code:

Plot gene expression heatmap for each comparison

for(comparison_name in COMPARISON_TABLE %>% pull(comparison)) { start_plot(str_c('gene_expressionheatmap',comparison_name,sep = '')) plot_expression_heatmap(comparison_name = comparison_name,top = 50) %>% ComplexHeatmap::draw(column_title=comparison_name,column_title_gp=grid::gpar(fontsize=16)) end_plot() }

The following error appears:

Error in h(simpleError(msg, call)) : error in evaluating the argument 'object' in selecting a method for function 'draw': no applicable method for 'mutate' applied to an object of class "character"

hxin commented 2 months ago

From the error message, it seems that the 'plot_expression_heatmap' returns an error message rather than a 'ComplexHeatmap' object, which when passed to the draw function, it caused the error.

I tested the code with a small example but it looks like it works without issue. I suspect It might be something specific to the result of that particular project, but I cannot repeat it.

I will close this issue for now as I tested it and it works. Please reopen if this happens again. @deepalivasoya @lweasel

lweasel commented 2 months ago

Yes, I suspect it's an edge case particular to certain projects (perhaps when there are no D.E. genes?). We can reopen if it happens again.