zhanghao-njmu / SCP

An end-to-end Single-Cell Pipeline designed to facilitate comprehensive analysis and exploration of single-cell data.
https://zhanghao-njmu.github.io/SCP/
GNU General Public License v3.0
357 stars 81 forks source link

a warning for SCP calling ggplot2 version > 3.4.X #254

Open Shiywa opened 4 weeks ago

Shiywa commented 4 weeks ago

In some plot function including DynamicPlot, there will be an error when your ggplot2 version > 3.4.X.

Error in scale$guide == "none" :

the detailed function information is

raw_point <- list(geom_point(data = df_point, 
                                       mapping = aes(x = .data[["x_assign"]], 
                                                     y = .data[["exp"]], color = .data[[group.by]]), 
                                       size = pt.size, alpha = 0.8), scale_color_manual(values = palette_scp(df[[group.by]], 
                                                                                                             palette = point_palette, palcolor = point_palcolor)), 
                            scale_fill_manual(values = palette_scp(df[[group.by]], 
                                                                   palette = point_palette, palcolor = point_palcolor), 
                                              guide = guide_legend(override.aes = list(alpha = 1, 
                                                                                       size = 3), order = 1)), new_scale_color(), 
                            new_scale_fill())

p <- ggplot() + 
      scale_x_continuous(trans = x_trans, expand = expansion(c(0, 0))) + 
      scale_y_continuous(expand = expansion(c(0.1,  0.05))) + 
      raw_point

the error is due to the list is not support in ggplot()+list() in ggplot2 v3.5.X.

reinstall ggplot2 3.4.X could resolve the problem.