Skip to contents

Design-informed size factor estimation

Usage

disize(
  design_formula,
  counts,
  metadata,
  batch_name,
  obs_name = "obs_id",
  n_feats = 10000L,
  n_subset = 50L,
  n_iters = "auto",
  n_threads = 1L,
  init_alpha = 1e-06,
  verbose = 3L
)

Arguments

design_formula

The formula describing the experimental design.

counts

A (observation x feature) count matrix.

metadata

A dataframe containing observation-level metadata.

batch_name

The identifier for the batch column in 'metadata'.

obs_name

The identifier for the observation column in 'metadata', defaults to "obs_id".

n_feats

The number of features used during estimation, defaults to all features (default caps to 10000).

n_subset

The number of observations per experimental unit used during estimation, defaults to 50 (useful for scRNA-seq experiments).

n_iters

The number of iterations used for estimation.

n_threads

The number of threads to use for parallel processing.

init_alpha

The initial step-size for the optimizer, lower values can sometimes make it easier to estimate size factors for more complex designs.

verbose

The verbosity level (1: only errors, 2: also allows warnings, 3: also allows messages, 4: also prints additional output useful for debugging).

Value

A named numeric vector containing the size factor estimates.