ap_cutoff_selection: Cutoff selection

View source: R/data_transformation.R

ap_cutoff_selectionR Documentation

Cutoff selection

Description

Select cutoff based on the slope of the density of scores per antigen.

Usage

ap_cutoff_selection(x, cutoffs, slope_cutoff = -0.5, offset = 0.1, bw = 0.1)

Arguments

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.

Details

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).

Value

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.


cekehe/rappp documentation built on May 17, 2022, 8:54 a.m.