R/kendrickCognostics.R
kendrickCognostics.Rd
The kendrickCognostics
function provides a set of default cognostics
to be used with Kendrick plots in Trelliscope. The kendrickCognostics
function accepts the boundary set used for Van Krevelen class calculations
and (for comparisonSummary
objects only) the name of the column to use
for identifying which peaks are observed in which group. It returns a
function that may be applied to each ftmsData
object, as is
appropriate for use with the
makeDisplay
function. See Examples
section for use.
kendrickCognostics(vkBoundarySet = "bs1", uniquenessColName = NA)
Van Krevelen boundary set to use for calculating class proportions
if ftmsObj
is a group comparison summary
object, what is the name of the column that specifies uniqueness to a
group? If only one uniqueness function has been applied this is
unnecessary. (See summarizeGroupComparisons
.)
a function that may be applied to objects of type peakData
,
groupSummary
, and comparisonSummary
if (FALSE) {
library(ftmsRanalysis)
library(trelliscope)
vdbDir <- vdbConn(file.path(tempdir(), "trell_test"), autoYes = TRUE)
data('exampleProcessedPeakData')
## Kendrick plot for each sample
sampleDdo <- divideBySample(exampleProcessedPeakData)
panelFn1 <- panelFunctionGenerator("kendrickPlot", vkBoundarySet="bs2", title="Test")
# Note: make sure the same vkBoundarySet value is provided to the panel and cognostics functions
makeDisplay(sampleDdo,
panelFn=panelFn1,
cogFn=kendrickCognostics(vkBoundarySet="bs2"),
name = "Kendrick_plots_per_sample")
## Kendrick plots for group summaries
groupDdo <- divideByGroup(exampleProcessedPeakData)
groupSummaryDdo <- summarizeGroups(groupDdo, summary_functions = c("prop_present", "n_present"))
panelFn2 <- panelFunctionGenerator(
"kendrickPlot",
colorCName=expr(paste0(getSplitVar(v, "Group"), "_n_present")),
legendTitle="Number<br>Present")
makeDisplay(grpCompSummaryDdo,
panelFn=panelFn2,
cogFn=kendrickCognostics(),
name = "Kendrick_plots_for_group_summaries")
view()
}