gof_model: gof_model

View source: R/gof_model.R

gof_modelR Documentation

gof_model

Description

This function is used to perform the likelihood ratio test on the models chosen based on the BIC values from best_model to check for model adequacy.

Usage

gof_model(lbic, cexpr, lib.size, formula = NULL, BPPARAM)

Arguments

lbic

A list of genes together with filtered read counts based on the selected distribution from best_model. Output from best_model.

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.

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 genes with the p-values from performing the GOF tests.

Examples


data(scData)

# apply the gof_model function to perform the likelihood ratio
# test on the models selected by using the lbic_model function

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

scData_gof <- gof_model(scData_least.bic, cexpr=scData$covariates, lib.size=scData$lib_size,
BPPARAM=bpparam())

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