fast_estimate_ziber: Fast parameter estimation of zero-inflated bernoulli model

Description Usage Arguments Value Examples

View source: R/ziber.R

Description

This function implements Newton's method for solving zero of Expectation-Maximization equation at the limit of parameter convergence: a zero-inflated bernoulli model of transcript detection, modeling gene expression state (off of on) as a bernoulli draw on a gene-specific expression rate (Z in 0,1). Detection conditioned on expression is a logistic function of gene-level features. The bernoulli model is modeled numerically by a logistic model with an intercept.

Usage

1
2
3
fast_estimate_ziber(x, fp_tresh = 0, gfeatM = NULL,
  bulk_model = FALSE, pos_controls = NULL, rate_tol = 0.01,
  maxiter = 100, verbose = FALSE)

Arguments

x

matrix. An expression data matrix (genes in rows, cells in columns)

fp_tresh

numeric. Threshold for calling a positive detection (D = 1). Default 0.

gfeatM

matrix. Numeric gene level determinants of drop-out (genes in rows, features in columns)

bulk_model

logical. Use median log-expression of gene in detected fraction as sole gene-level feature. Default FALSE. Ignored if gfeatM is specified.

pos_controls

logical. TRUE for all genes that are known to be expressed in all cells.

rate_tol

numeric. Convergence treshold on expression rates (0-1).

maxiter

numeric. The maximum number of steps per gene. Default 100.

verbose

logical. Whether or not to print the value of the likelihood at each iteration.

Value

a list with the following elements:

Examples

1
2
3
4
5
mat <- matrix(rpois(1000, lambda = 3), ncol=10)
mat = mat * matrix(1-rbinom(1000, size = 1, prob = .01), ncol=10)
ziber_out = suppressWarnings(fast_estimate_ziber(mat,
   bulk_model = TRUE,
   pos_controls = 1:10))

scone documentation built on Nov. 8, 2020, 5:20 p.m.