View source: R/vanKrevelenCognostics.R
vanKrevelenCognostics | R Documentation |
The vanKrevelenCognostics
function provides a set of default
cognostics to be used with Van Krevelen plots in Trelliscope. The
vanKrevelenCognostics
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.
vanKrevelenCognostics(vkBoundarySet = "bs1", uniquenessColName = NA)
vkBoundarySet |
Van Krevelen boundary set to use for calculating class proportions |
uniquenessColName |
if |
a function that may be applied to objects of type peakData
,
groupSummary
, and comparisonSummary
## Not run:
library(ftmsRanalysis)
library(trelliscope)
vdbDir <- vdbConn(file.path(tempdir(), "trell_test"), autoYes = TRUE)
data('exampleProcessedPeakData')
## Van Krevelen plot for each sample
sampleDdo <- divideBySample(exampleProcessedPeakData)
panelFn1 <- panelFunctionGenerator("vanKrevelenPlot", vkBoundarySet="bs2", title="Test")
# Note: make sure the same vkBoundarySet value is provided to the panel and cognostics functions
makeDisplay(sampleDdo,
panelFn=panelFn1,
cogFn=vanKrevelenCognostics(vkBoundarySet="bs2"),
name = "Van_Krevelen_plots_per_sample")
## Van Krevelen plots for group comparison summaries
grpCompDdo <- divideByGroupComparisons(exampleProcessedPeakData, "all")
grpCompSummaryDdo <- summarizeGroupComparisons(
grpCompDdo,
summary_functions="uniqueness_gtest",
summary_function_params=list(uniqueness_gtest=list(
pres_fn="nsamps",
pres_thresh=2,
pvalue_thresh=0.05)))
panelFn2 <- panelFunctionGenerator("vanKrevelenPlot", colorCName="uniqueness_gtest")
# Note: uniquenessColName parameter tells vanKrevelenCognostics which column to use to determine
# group uniqueness for each peak. If only one summary function is used in summarizeGroupComparisons
# then it will be inferred, otherwise it's necessary to specify.
makeDisplay(grpCompSummaryDdo,
panelFn=panelFn2,
cogFn=vanKrevelenCognostics(uniquenessColName="uniqueness_gtest"),
name = "Van_Krevelen_plots_for_group_comparison_summaries")
view()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.