sidbdri / cookiecutter-de_analysis_skeleton

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

Problem plotting gene expression heatmaps #217

Closed lweasel closed 1 year ago

lweasel commented 1 year ago

In the following code in diff_expr.R:

## Plot gene expression heatmap for each comparison

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

shouldn't the start_plot() and end_plot() calls be inside the for loop, with a different string passed to start_plot() each time?

hxin commented 1 year ago

I think if wrap the start/stop outside, all the plots will end up in one pdf with each page containing one plot with the comparison name. We can change it so that it produces for each comparison a plot instead?

lweasel commented 1 year ago

Yep, I think that would probably be the thing to do.

hxin commented 1 year ago

okay, will change it so it produces one plot for each comparison in a separator file.

lweasel commented 1 year ago

(Sorry of course if I previously said the opposite to this!)