fit_models: fit_models

View source: R/fit_models.R

fit_modelsR Documentation

fit_models

Description

This function is used to fit genes with GLM

Usage

fit_models(counts, cexpr, lib.size, formula = NULL, model = NULL, BPPARAM)

Arguments

counts

A non-negative integer matrix of scRNA-seq filtered read counts containing genes belonging to the family of ZINB distributions selected from ks_test.

cexpr

A dataframe that contains the covariate values. The rows of the dataframe are the corresponding samples/cells from the counts matrix from filter_counts. The cells of the dataframe are the covariates to be included in the GLM.

lib.size

A numeric vector that contains the total number of counts per cell from the counts matrix from filter_counts.

formula

A regression formula to fit the covariates in the ZINB GLM.

model

A specific model to fit (1:P, 2:NB, 3:ZIP, 4:ZINB, NULL:All)

BPPARAM

configuration parameter related to the method of parallel execution. For further information on how to set-up parallel execution refer to BiocParallel vignette.

Value

A list of models fitted by 'glm'

Examples


data(scData)

# apply the fit_models function to subset genes belonging to the
# family of ZINB distributions, selceted from ks_test function.

library(BiocParallel)
scData_models <- fit_models(counts=scData$counts, cexpr=scData$covariates,
lib.size=scData$lib_size, BPPARAM=bpparam())

Malindrie/scShapes documentation built on Nov. 21, 2022, 8:58 a.m.