SetupLinearModel: Set up design matrices and response given a Seurat object

View source: R/glmnet.R

SetupLinearModelR Documentation

Set up design matrices and response given a Seurat object

Description

Set up design matrices and response given a Seurat object

Usage

SetupLinearModel(
  obj,
  pert.col,
  batch.col = NULL,
  size.factor.col = NULL,
  mito.col = NULL,
  response.col = NULL,
  features.use = NULL,
  test.prop = 0.2,
  seed = 12345
)

Arguments

obj

Seurat object

pert.col

Metadata column containing perturbation info (required)

batch.col

Metadata column containing batch info (default: NULL)

size.factor.col

Metadata column containing library size info (default: NULL)

mito.col

Metadata column containing mitochondrial fraction info (default: NULL)

response.col

Metadata column containing the desired response. If NULL, the normalized data in the Seurat object will be used as the response.

features.use

If response.col is NULL, a subset of features to use for the response

test.prop

Proportion of cells held out for model evaluation

Value

List of x (perturbation + covariate design matrix) y (response vector or matrix), and family (response family)


yanwu2014/perturbLM documentation built on Aug. 24, 2023, 2:28 p.m.