regModel: Regularized quasibinomial logistic regression

View source: R/models.R

regModelR Documentation

Regularized quasibinomial logistic regression

Description

Regularized quasibinomial logistic regression

Usage

regModel(
  obj,
  r.variates = "~log10nSites",
  variates = NULL,
  subpeaks = 5000,
  bins = 256,
  bw_adjust = 10,
  type = "pearson",
  link = "logit",
  nthreads = 1,
  weights = NULL,
  method = "lm",
  alpha = 0.5,
  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.

variates

model formula as character string to regress out variables from the initial residuals using QR residuals in a second round of regression. Ideal for specifying batch effects, cell-cycle and other technical sources of variation. Defaults to NULL.

subpeaks

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

bins

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

bw_adjust

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

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.

weights

sets weights to glmnet regression to remove technical effects.

method

character, type of secondary regression to use for removing additional technical effects. Choices include "elasticNet" for glmnet based regularized regression or "lm" for linear regression. Option has no effect when variates is NULL. Using glmnet instead of "lm" is still experimental and time consuming. Final accessibility residuals should be carefully analyzed if using "elasticNet". Defaults to "lm".

alpha

numeric, sets the alpha parameter for glmnet. 0 for LASSO like regression, 1 for ridge regression. Default 0.5 for elastic net regression.

center.resid

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

scale.resid

logical, whether to standardize residuals. Defaults to TRUE.

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 (default) will override center.resid and scale.resid arguments, setting them to FALSE. make.sparse is mutally exclusive with the argument 'variates'. Defaults to FALSE

verbose

logical. Defaults to FALSE.

slotName

character, specify the slot name for saving residuals. Useful for saving multiple normalization steps. Note, make sure to update the slotName argument for downstream functions. Defaults to "residuals".


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