Convenience function to wrap ftmsRanalysis plotting functions for Trelliscope

panelFunctionGenerator(plot_fn_name, ...)

Arguments

plot_fn_name

plot function name, e.g. "vanKrevelenPlot" or "kendrickPlot"

...

other parameters to pass to the plotting function other than the data object

Details

Sometimes the additional parameters to pass to the plotting function will depend on the key associated with the data in the ddo (e.g. if a column name is prepended with the group name). In that case, see example below for how to construct an expr statement to obtain the necessary information.

Author

Amanda White

Examples

if (FALSE) {
library(ftmsRanalysis)
library(trelliscope)

vdbDir <- vdbConn(file.path(tempdir(), "trell_test"), autoYes = TRUE) #temporary directory

data('exampleProcessedPeakData')
groupDdo <- divideByGroup(exampleProcessedPeakData)
groupSummaryDdo <- summarizeGroups(groupDdo, summary_functions = c("prop_present", "n_present"))

# See rlang::expr here:
panelFnG1 <- panelFunctionGenerator(
  "vanKrevelenPlot", 
  colorCName=rlang::expr(paste0(getSplitVar(v, "Group"), "_prop_present")), 
  legendTitle="Proportion<br>Present")

makeDisplay(groupSummaryDdo, 
            panelFn=panelFnG1,
            name = "Trelliscope test G_1 with VK plot per group",
            group = "Group")
view()
}