Skip to contents

Estimates the over-dispersion parameter (theta) for a beta-binomial model stratified by sequencing depth, using panel of normal (PoN) BAF data.

Usage

EstimateTheta(normals_dt, pon_ref, n_bins)

Arguments

normals_dt

Data frame or tibble. Panel of normal data.

pon_ref

Data frame or tibble. Reference PoN data.

n_bins

Integer. Number of depth strata to use.

Value

Returns a list with elements:

theta_table

Data frame with columns depth_bin and theta (per-stratum estimates).

breaks

Numeric vector of depth quantile breakpoints.

Details

The function compares observed BAF variance to expected binomial variance across bins and depths, and estimates theta as: $$\theta = \frac{\mathrm{Var}(p)}{\mathrm{E}[p(1-p)/d]} - 1$$ where \(p\) is the observed BAF, and \(d\) is the median depth.