Skip to contents

Tests H0: mu = mu0 (global/theoretical mean) vs H1: mu = gene-specific mean, using beta-binomial likelihoods with shrunk dispersion from correct_theta().

Usage

bb_mean(
  a1_counts,
  tot_counts,
  estimates,
  glob_params,
  min_cells = 5,
  min_counts = 5,
  batch = NULL,
  metadata = NULL,
  estimates_group = NULL
)

Arguments

a1_counts

Integer matrix (genes x cells): allele-1 counts.

tot_counts

Integer matrix (genes x cells): total counts. (same dimenstions and rownames as a1_counts).

estimates

Data frame from correct_theta()

glob_params

Named vector/list with elements alpha, beta, mu, theta as returned by glob_disp().

min_cells

Integer >= 1. Minimum number of cells per gene to fit (default 5). Genes with a number of cells less than min_cells are excluded from the estimation.

min_counts

Integer >= 0. Minimum reads per cell to include (default 0). Cells with a number of mapped reads less than min_counts are excluded from the estimation

batch

Optional string: column name in metadata identifying batches. (if batch correction is required)

metadata

Optional metadata object containing cell level information (batch identifier must be one of the column in the cell metadata)

estimates_group

Optional object containing initial beta-binomial parameter estimates and correction performed on each batch separately

Examples

bb_mean(a1_counts,
        tot_counts,
        estimates,
        glob_params,
        min_cells = 5,
        min_counts = 5)
#> Error: object 'a1_counts' not found