caravagnalab / bascule

Detecting mutational signatures via bayesian inference and a reference catalog

Home Page:https://caravagnalab.github.io/bascule/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

plot functions refactoring

azadsadr opened this issue · comments

commented

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.

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

commented

the functions are as follow:

  • plot_gradient_norms
  • plot_scores
  • plot_QC(x)
  • plot_fit
  • plot_data
  • plot_data_differences
  • plot_signatures
  • plot_similarity_reference
    PS: if found other functions please add to the list
    PS: it can be done using the template e.g., plot_scores(x, what="nmf", which="likelihood")

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