fit_glm: Fits a Poisson generalized linear model to a set of genes

View source: R/fct_glm.R

fit_glmR Documentation

Fits a Poisson generalized linear model to a set of genes

Description

The idea is to extract the importance and effect of each factor. To do so, the expression of each gene is modeled as a Poisson distribution. The log of its parameter (the expected value) is approximated by a linear combination of the factors in the experiment. The coefficients associated to each factors are estimated to fit gene expression, and can be insightful to characterize genes behavior in a particular cluster. The model with interactions is considered. It your design in not a complete crossed design, the interaction term will be null.

Usage

fit_glm(normalized_counts, genes, design, factors = colnames(design))

Arguments

normalized_counts

normalized counts

genes

genes belonging to a specific expression-based clusters

design

experimental design as a dataframe

factors

factors to use for the fit (defalut is all the factors of the design)

Value

glm object

Note

Note that we can only apply a glm fit to a set of genes that have very close expression profiles accros conditions, else we would have to introduce a new variable related to the genes themselves.

Examples

data("abiotic_stresses")
genes_cluster <- DIANE::get_genes_in_cluster(
abiotic_stresses$heat_DEGs_coseq_membership, cluster = 3)
glm <- DIANE::fit_glm(abiotic_stresses$normalized_counts, genes_cluster, 
abiotic_stresses$design)
summary(glm)

OceaneCsn/DIANE documentation built on Jan. 10, 2024, 6:43 p.m.