xuranw / MuSiC

Multi-subject Single Cell Deconvolution
https://github.com/xuranw/MuSiC
GNU General Public License v3.0
224 stars 89 forks source link

Benchmark evaluation tutorial error with plot_grid #42

Open RinconFer opened 4 years ago

RinconFer commented 4 years ago

I am running the tutorial for MuSiC for Benchmark evaluation. I followed all the steps without problems, and averything looks like is running properly, but the final step which is plotting the figures stored in "abs.diff.fig" and "prop.comp.fig" generate an error with plot_grid.

Here is everything R says about the error:

plot_grid(prop.comp.fig, abs.diff.fig, labels = "auto", rel_widths = c(4,3)) Error: Aesthetics must be either length 1 or the same as the data (9): label Run rlang::last_error() to see where the error occurred. rlang::last_error() <error/rlang_error> Aesthetics must be either length 1 or the same as the data (9): label Backtrace:

  1. cowplot::plot_grid(...)
  2. cowplot::align_plots(...)
  3. base::lapply(...)
  4. cowplot:::FUN(X[[i]], ...)
  5. cowplot:::as_gtable.default(x)
  6. cowplot:::as_grob.ggplot(plot)
  7. ggplot2::ggplotGrob(plot)
  8. ggplot2:::ggplot_build.ggplot(x)
  9. ggplot2:::by_layer(function(l, d) l$compute_geom_2(d))
  10. ggplot2:::f(l = layers[[i]], d = data[[i]])
  11. l$compute_geom_2(d)
  12. ggplot2:::f(..., self = self)
  13. self$geom$use_defaults(data, self$aes_params, modifiers)
  14. ggplot2:::f(..., self = self)
  15. ggplot2:::check_aesthetics(params[aes_params], nrow(data)) Run rlang::last_trace() to see the full context. rlang::last_trace() <error/rlang_error> Aesthetics must be either length 1 or the same as the data (9): label Backtrace: █
  16. └─cowplot::plot_grid(...)
  17. └─cowplot::align_plots(...)
  18. └─base::lapply(...)
  19. └─cowplot:::FUN(X[[i]], ...)
  20. ├─cowplot::as_gtable(x)
  21. └─cowplot:::as_gtable.default(x)
  22. ├─cowplot::as_grob(plot)
  23. └─cowplot:::as_grob.ggplot(plot)
  24. └─ggplot2::ggplotGrob(plot)
  25. ├─ggplot2::ggplot_gtable(ggplot_build(x))
  26. ├─ggplot2::ggplot_build(x)
  27. └─ggplot2:::ggplot_build.ggplot(x)
  28. └─ggplot2:::by_layer(function(l, d) l$compute_geom_2(d))
  29. └─ggplot2:::f(l = layers[[i]], d = data[[i]])
  30. └─l$compute_geom_2(d)
  31. └─ggplot2:::f(..., self = self)
  32. └─self$geom$use_defaults(data, self$aes_params, modifiers)
  33. └─ggplot2:::f(..., self = self)
  34. └─ggplot2:::check_aesthetics(params[aes_params], nrow(data))

Thank you very much for your help! David