regModel2: Regularized quasibinomial logistic regression

View source: R/models.R

regModel2R Documentation

Regularized quasibinomial logistic regression

Description

Requires a column titled 'library' in the meta slot of the input object.

Usage

regModel2(
  obj,
  r.variates = "~log10nSites",
  do.sample = T,
  subpeaks = 5000,
  subcells = 1000,
  propC = 0.1,
  cellNames = NULL,
  bins = 256,
  bw_adjust = 10,
  type = "pearson",
  link = "logit",
  nthreads = 1,
  center.resid = T,
  scale.resid = F,
  make.sparse = F,
  verbose = FALSE,
  slotName = "residuals"
)

Arguments

obj

list containing a slot named 'counts' for the dgCMatrix object with binary cell (columns) x peak (rows) accessibility scores, and a slot named 'meta' containing a data.frame with barcode meta data information.

r.variates

model formula specifying variable to regress out. Should be specified as a character string. Defaults to "~log10nSites". Changing this parameter is not recommended.

do.sample

logical, whether or not to sub-sample cells for regularized regression. Defaults to TRUE when the number of cells is greater 5000, FALSE otherwise. Set do.sample to NULL to override subsampling.

subpeaks

numeric, number of ACRs to select for regularization parameter estimates. Defaults to 5000.

subcells

numeric, number of cells to select for regularization. Defaults to 1000.

propC

numeric, proportion of cells to sample from each factor in meta data variable 'library'. Requires 'library' is a column name in meta data with more than two factors. Ultimately, the number of cells that are selected from each library is the greater of propC * number of cells in library and subcells.

bins

numeric, number of bins to split ACRs into. Defaults to 256.

bw_adjust

numeric, sets the bandwidth for kernel regression during parameter regularization.

type

character, specify the residual type to extract from the model. Possible choices inlucde: "pearson", "deviance", "response", and "working". Defaults to "pearson".

link

character, specify the link-function type for logistic regression. Possible parameters are "logit" and "probit". Defaults to "logit".

nthreads

numeric, number of threads to run logistic model in parallel. Depends on doSNOW. Defaults to 1.

center.resid

logical, whether to zero-center residuals. Defaults to TRUE.

scale.resid

logical, whther to standardize residuals. Defaults to FALSE.

make.sparse

logical, whether or not to set negative values to 0, and reduce memory usage. Setting this parameter to TRUE has negligible effects on downstream results. Setting make.sparse to TRUE will override center.resid and scale.resid arguments, setting them to FALSE. Defaults to FALSE.

verbose

logical. Defaults to FALSE.

slotName

character, specify the slot name for saving residuals. Useful for saving multiple normalization steps. Note, if changing from default, make sure to provide downstream functions with non-default slotName with useSlot. Defaults to "residuals".


plantformatics/Socrates documentation built on April 3, 2025, 1:02 p.m.