View source: R/data_transformation.R
| ap_cutoff_selection | R Documentation |
Select cutoff based on the slope of the density of scores per antigen.
ap_cutoff_selection(x, cutoffs, slope_cutoff = -0.5, offset = 0.1, bw = 0.1)
x |
List of scoring values with two levels per element: level one = assay data sets ; level two = bead subsets (e.g. wih and w/o controls). It is recommended to use to element Scoring in the output from ap_scoring). |
cutoffs |
data.frame with at least two columns: - One column named score with the desired cutoffs to use - One column named xmad with the corresponding MAD cutoff values It is recommended is to use the Cutoff_key element in the output from ap_scoring). |
slope_cutoff |
Arbitrary slope cutoff value. Can be chosen freely. |
offset |
Offset used to prevent script from finding the peak (as slope = 0 there). |
bw |
Bandwidth for density funciton, default set to 0.1. |
A cutoff will be selected for each antigen based on the distribution of the scores for the antigen. The algorithm will search for a local min nearest the highest peak in a density plot using bandwidth=0.1.
The input values should be scoring values, and structured as a list (preferably the output from function ap_scoring()), even if only one data set is used (see examples in ap_mads).
List with two main elements
[[1]] Density output used for cutoff selection, with same structure as input list.
[[2]] Calculated antigen specific cutoffs, with same structure as input list.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.