simple_FNR_params: Fit Simple False-Negative Model

View source: R/sample_filtering.R

simple_FNR_paramsR Documentation

Fit Simple False-Negative Model

Description

Fits a logistic regression model of false negative observations as a function of expression level, using a set of positive control (ubiquitously expressed) genes

Usage

simple_FNR_params(expr, pos_controls, fn_tresh = 0.01)

Arguments

expr

matrix A matrix of transcript-proportional units (genes in rows, cells in columns).

pos_controls

A logical, numeric, or character vector indicating control genes that will be used to compute false-negative rate characteristics. User must provide at least 2 control genes.

fn_tresh

Inclusive threshold for negative detection. Default 0.01. fn_tresh must be non-negative.

Details

logit(Probability of False Negative) ~ a + b*(median log-expr)

Value

A matrix of logistic regression coefficients corresponding to glm fits in each sample (a and b in columns 1 and 2 respectively). If the a & b fit does not converge, b is set to zero and only a is estimated.

Examples

mat <- matrix(rpois(1000, lambda = 3), ncol=10)
mat = mat * matrix(1-rbinom(1000, size = 1, prob = .01), ncol=10)
fnr_out = simple_FNR_params(mat,pos_controls = 1:10)


YosefLab/scone documentation built on Oct. 21, 2024, 4:39 p.m.