limma
is geared towards testing for differences in gene expression between conditions. However, as you probably already know, failing to detect any DE is not the same as "similar expression", i.e., absence of evidence does not provide evidence of absence. For example, a truly DE gene might have a large p-value if its expression is highly variable across replicates.
A formal statistical test for a similarly-expressed gene might be something like the two one-sided tests (TOST) procedure. Briefly, you specify a log-fold change threshold, under which you consider the gene as having no differences in expression. You then test for whether the observed log-fold change is significantly smaller and larger than the positive and negative threshold, respectively. If so, then that represents evidence that the true fold change does lie under the threshold. However, this can be quite conservative (as it involves an intersection) and I'm not aware of any implementation within the limma
framework.
Depending on your application, an ad hoc approach may be sufficient, e.g., considering similarly-expressed genes as those with small log-fold changes. You can also get confidence intervals on the log-fold changes by specifying confint=X
in topTable
, for some percentage X
; you could then pick the genes where the boundaries of the interval are close to zero. We'd need to know more about your study, though, to give more advice.
Can you elaborate a bit more on what "similarly expressed" genes are so we can get some more clarity on what you are after?
Do you mean you want to find groups of genes with correlated expression across many samples/conditions, or something else?