caravagnalab / bascule

Detecting mutational signatures via bayesian inference and a reference catalog
https://caravagnalab.github.io/bascule/
GNU General Public License v3.0
1 stars 1 forks source link

plot functions refactoring #8

Open azadsadr opened 4 months ago

azadsadr commented 4 months ago

all the plot function in basilica must return the ggplot object (not patchwork), which make it easy to manage visualization tuning afterwards. So, all the function returning multiple plots must handle the case by adding extra parameters to choose one of the plots at the time.

elena-buscaroli commented 4 months ago

Please report the functions you would like to improve. @azadsadr

azadsadr commented 4 months ago

the functions are as follow:

caravagn commented 4 months ago

Logic: in order to allow full customizability of the output plots, it is better that all plotting functions return a ggplot object and that the caller, if required, will assembly stuff using his/her favourite tool (patchwork, ggpubr etc).

I suggest however to limit the number of plotting functions using the format

top_level_plot(x, what="XXX", which="YYY")

that might use internal plotting functions of the form private_plot_X_Y.

See an example here: https://github.com/caravagnalab/CNAqc/blob/master/R/plot_data_histogram.R