inmoose.edgepy.glmLRT

inmoose.edgepy.glmLRT(glmfit, coef=None, contrast=None)

Conduct genewise statistical tests for a given coefficient or coefficient contrast.

This function implements one of the GLM methods developed by [McCarthy2012].

glmLRT() conducts likelihood ratio tests for one or more coefficients in the linear model. If coef is used, the null hypothesis is that all the coefficients indicated by coef are equal to zero. If contrast is non-null, then the null hypothesis is that the specified contrasts of the coefficients are equal to zero. For example, a contrast of [0,1,-1], assuming there are three coefficients, would test the hypothesis that the second and third coefficients are equal.

Parameters:
  • glmfit (DGEGLM) – a DGEGLM object, usually output from glmFit()

  • coef (array_like of integers or strings) – vector indicating which coefficients of the linear model are to be tested equal to zero. Values must be column indices or column names of design. Defaults to the last coefficient. Ignored if contrast is specified.

  • contrast (array or matrix of integers) – vector or matrix specifying one or more contrasts of the linear model coefficients to be tested equal to zero. Number of rows must equal to the number of columns of design. If specified, then takes precedence over coef.

Returns:

dataframe with two additional components:

  • fit containing the result of glmFit()

  • comparison, string describing the coefficient or the contrast being tested

The dataframe has the same rows as y and is ready to be displayed by topTags(). It contains the following columns:

  • "log2FoldChange", log2-fold-change of expression between conditions being tested.

  • "lfcSE", standard error of log2-fold-change.

  • "logCPM", average log2-counts per million, the average taken over all libraries in y.

  • "stat", likelihood ratio statistics.

  • "pvalue", p-values.

Return type:

DGELRT