estCutoffs: Estimation of distance separation cutoffs

Description Usage Arguments Details Value Author(s) References Examples

View source: R/estCutoffs.R

Description

For each sample, estimates a cutoff parameter for the distance between positive and negative barcode populations.

Usage

1

Arguments

x

a SingleCellExperiment.

Details

For the estimation of cutoff parameters, we considered yields upon debarcoding as a function of the applied cutoffs. Commonly, this function will be characterized by an initial weak decline, where doublets are excluded, and subsequent rapid decline in yields to zero. In between, low numbers of counts with intermediate barcode separation give rise to a plateau. As an adequate cutoff estimate, we target the point that approximately marks the end of the plateau regime and the onset of yield decline. To facilitate robust cutoff estimation, we fit a linear and a three-parameter log-logistic function to the yields function:

f(x) = d / (1 + exp(b * (log(x) - log(e))))

The goodness of the linear fit relative to the log-logistic fit is weighed with:

w = RSS(log-logistic) / (RSS(log-logistic) + RSS(linear))

and the cutoffs for both functions are defined as:

c(linear) = - beta0 / (2 * beta1)

c(log-logistic) = argmin x { | f'(x) | / f(x) > 0.1 }

The final cutoff estimate is defined as the weighted mean between these estimates:

c = (1 - w) x c(log-logistic) + w x c(linear)

Value

the input SingleCellExperiment is returned with an additional metadata slot sep_cutoffs.

Author(s)

Helena L Crowell helena.crowell@uzh.ch

References

Finney, D.J. (1971). Probit Analsis. Journal of Pharmaceutical Sciences 60, 1432.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
library(SingleCellExperiment)

# construct SCE
data(sample_ff, sample_key)
sce <- prepData(sample_ff)
    
# assign preliminary barcode IDs
# & estimate separation cutoffs
sce <- assignPrelim(sce, sample_key)
sce <- estCutoffs(sce)

# access separation cutoff estimates
(seps <- metadata(sce)$sep_cutoffs)

# compute population yields
cs <- split(seq_len(ncol(sce)), sce$bc_id)
sapply(names(cs), function(id) {
  sub <- sce[, cs[[id]]]
  mean(sub$delta > seps[id])
})

# view yield plots including current cutoff
plotYields(sce, which = "A1")

CATALYST documentation built on Nov. 8, 2020, 6:53 p.m.