lbic_model: lbic_model

View source: R/lbic_model.R

lbic_modelR Documentation

lbic_model

Description

This function is used to select the best fit model for each gene based on the least BIC value

Usage

lbic_model(bic.value, counts)

Arguments

bic.value

A dataframe of BIC values from fitting GLM using error distributions P, NB, ZIP, ZINB; the output from model_bic.

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. The rows of the matrix are genes and columns are samples/cells.

Value

A list of genes chosen to be following one of the 4 distributions P, NB, ZIP, ZINB based on the least BIC value and the corresponding subset of counts from filter_counts

Examples


data(scData)

# apply the lbic_model function to select the model with the least
# BIC value on the matrix of BIC values obtained after running
# model_bic 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)

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