本文へ移動
cccskills
無料GitHub で公開

bioconductor-limma

Given a matrix of counts (e.g. from featureCounts) and optional information about the genes, this tool performs differential expression (DE) using the limma Bioconductor package and produces plots and tables useful in DE analysis. Interacti

インストール方法を見る

含まれるファイル(1)

  • SKILL.md11.3 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

limma — Comprehensive Skill Guide

Domain: Microarray / RNA-seq Bioconductor: limma Paper: Ritchie ME et al. (2015). Nucleic Acids Research, 43:e47.

Linear models for microarray and RNA-seq data. Enables any experimental design expressible as a linear model; uses empirical Bayes shrinkage of standard errors.

Dependencies & Environment

Package-intrinsic requirements from the Bioconductor landing page — reproduce in any R environment.

  • Version: 3.68.3 · Bioconductor: 3.23 · R: ≥ 4.6
  • Imports: statmod
  • Install: BiocManager::install("limma")

When to Use

  • Microarray differential expression
  • RNA-seq (via voom transformation)
  • Complex designs: factorial, time-course, blocking
  • Batch effect correction with duplicateCorrelation
  • Rotation test for gene set testing (ROAST/MROAST)

Alternatives: DESeq2, edgeR

Do NOT Use When

  • Very small sample sizes (n<3 per group) where Bayesian shrinkage cannot be estimated — use edgeR instead.
  • RNA-seq without voom() transformation — raw counts violate limma's Gaussian assumption.
  • Non-linear effects or complex time-series without manual design matrix specification.

Data Requirements

RequirementDetails
Min Replicates≥3 per group for RNA-seq; works with n=2 but with reduced power
Input FormatFor RNA-seq: raw counts + voom(); for microarray: log2 intensities (pre-normalized)
Must Not UseRaw counts directly without voom() for RNA-seq
NotesFor microarray: normalize with normalizeBetweenArrays() before fitting

Installation

if (!require("BiocManager", quietly=TRUE))
    install.packages("BiocManager")
BiocManager::install("limma")
library(limma)

Workflows

RNA-seq with voom

Standard limma-voom workflow for RNA-seq

Setup

library(limma); library(edgeR)
d <- DGEList(counts=counts)
keep <- filterByExpr(d, group=group)
d <- d[keep,]
d <- calcNormFactors(d)
design <- model.matrix(~group)

voom transform + fit

v <- voom(d, design, plot=TRUE)   # visualise mean-variance trend
fit <- lmFit(v, design)
fit <- eBayes(fit, trend=TRUE)     # trend=TRUE for RNA-seq
topTable(fit, coef=2, n=20)        # top DE genes for coefficient 2

Multiple contrasts

contr.matrix <- makeContrasts(AvsB=A-B, AvsC=A-C, BvsC=B-C, levels=design)
vfit <- contrasts.fit(fit, contr.matrix)
vfit <- eBayes(vfit, trend=TRUE)
results <- decideTests(vfit)       # summary across contrasts
summary(results)

Microarray

Agilent or Affymetrix expression arrays

Load and normalise

library(limma)
targets <- readTargets("targets.txt")
RG <- read.maimages(targets, source="agilent", green.only=TRUE)
RG <- backgroundCorrect(RG, method="normexp")
MA <- normalizeBetweenArrays(RG, method="quantile")

DE analysis

design <- model.matrix(~0 + factor(targets$Treat))
colnames(design) <- c("Control","Treated")
fit <- lmFit(MA, design)
contrasts <- makeContrasts(Treated-Control, levels=design)
fit2 <- contrasts.fit(fit, contrasts)
fit2 <- eBayes(fit2)
topTable(fit2, adjust.method="BH")

Key Functions & Parameters

voom()

Transform RNA-seq counts to log-CPM with precision weights for limma

ParameterDescription
countsDGEList or count matrix
designmodel matrix
normalize.method'none'|'scale'|'quantile'|'cyclicloess'
plotlogical; plot mean-variance trend

lmFit()

Fit linear model to each gene

ParameterDescription
objectEList (voom output) or expression matrix
designmodel matrix from model.matrix()
blockvector of blocking variable (for duplicateCorrelation)
correlationintra-block correlation from duplicateCorrelation()

makeContrasts()

Build contrast matrix for pairwise or complex comparisons

ParameterDescription
...named contrasts as expressions e.g. TreatvsCtrl=Treat-Control
levelscolnames of design matrix

contrasts.fit()

Re-parametrise MArrayLM for specified contrasts

ParameterDescription
fitMArrayLM from lmFit
contrastscontrast matrix from makeContrasts

eBayes()

Empirical Bayes moderation of t-statistics

ParameterDescription
fitMArrayLM
trendlogical; model variance trend with intensity (RNA-seq: TRUE)
robustlogical; robust empirical Bayes
proportionprior proportion of DE genes (default 0.01)

topTable()

Extract top DE genes

ParameterDescription
fitMArrayLM after eBayes
coefcoefficient name or index
ngenes to return (default 10; Inf for all)
adjust.method'BH' | 'BY' | 'holm'
p.valuep-value filter (default 1)
lfclog2FC threshold filter (default 0)

Scientific Assumptions

The method assumes the following about your data and experiment:

  • After voom transformation, the data approximately follows a normal distribution.
  • Precision weights from voom account for the mean-variance relationship in RNA-seq counts.
  • Empirical Bayes shrinkage of variance toward a common value across genes (eBayes).
  • The linear model correctly specifies the experimental design.

Result Interpretation

  • logFC: log2 fold-change (or contrast coefficient); same direction convention as edgeR.
  • adj.P.Val: BH-FDR adjusted p-value; use < 0.05 as standard cutoff.
  • t: moderated t-statistic (smaller SE than ordinary t because of eBayes shrinkage).
  • B (log-odds): log-odds of DE; B > 0 means more likely DE than not (rarely used directly).
  • AveExpr: average log2-expression across all samples; low value → less reliable estimates.
  • Volcano: plotMA(fit2) or volcanoplot(fit2) for MA and volcano visualization.
  • Use treat() instead of eBayes() to test against a minimum FC threshold.

Best Practices

  • For RNA-seq use voom() + lmFit() + eBayes() workflow.
  • Set trend=TRUE in eBayes() for RNA-seq data (accommodates mean-variance trend).
  • Use duplicateCorrelation() for paired samples or repeated measures.
  • Use removeBatchEffect() only for visualisation — not as input for DE; put batch in design.
  • For microarray, quantile-normalise with normalizeBetweenArrays() before lmFit.
  • Use fry() or camera() for gene set testing — they account for inter-gene correlation.
  • voomWithQualityWeights() improves power when sample quality varies.

When to Choose This vs Alternatives

AlternativePrefer this tool whenPrefer alternative when
DESeq2You have microarray data or very large RNA-seq cohorts; you want linear model contrasts flexibility.You have count data, small n, or want negative binomial modelling.

Benchmark Evidence

Key studies that have validated or benchmarked this tool:

  • Ritchie ME et al. (2015). Nucleic Acids Res 43:e47. PMID:25605792
    limma-voom competitive with DESeq2/edgeR for RNA-seq; best for microarray and large n.

  • Law CW et al. (2014). Genome Biol 15:R29. PMID:24926665
    voom outperforms DESeq2/edgeR at large sample sizes (n≥20); performs comparably for small n.

Common Errors & Troubleshooting

Coefficients not estimable from factor 'X'

Cause: Aliased coefficients — model is not full rank

Fix: Use nonEstimable(design) to identify redundant columns; simplify design

From Community Q&A (Biostars)

Additional Notes from Official Documentation

Extracted from the limma Bioconductor vignette(s)

What is it?

Limma is an R package for the analysis of gene expression data, especially the use of linear models for analysing designed experiments and the assessment of differential expression. Limma provides the ability to analyse comparisons between many RNA targets simultaneously in arbitrary complicated designed experiments. Empirical Bayesian methods are used to provide stable results even when the number of arrays is small. The normalization and background correction functions are provided for microarrays and similar technologies. The linear model and differential expression functions apply to a wide variety of gene expression technologies including microarrays (single-channel or two-color), quantitative PCR, RNA-seq or proteomics.

How to get help

The edgeR User’s Guide is available by or alternatively from the limma landing page . Documentation for specific functions is available through the usual R help system, e.g., ?lmFit . Further questions about the package should be directed to the Bioconductor support site .

> library(limma)
> limmaRUsersGuide()

Further reading

Ritchie ME, Phipson B, Wu D, Hu Y, Law CW, Shi W, Smyth GK (2015). limma powers differential expression analyses for RNA-sequencing and microarray studies. Nucleic Acids Research 43, e47. doi:10.1093/nar/gkv007 Phipson B, Lee S, Majewski IJ, Alexander WS, and Smyth GK (2016). Robust hyperparameter estimation protects against hypervariable genes and improves power to detect differential expression. Annals of Applied Statistics 10, 946-963. doi:10.1214/16-AOAS920 Law CW, Chen Y, Shi W, Smyth GK (2014). Voom: precision weights unlock linear model analysis tools for RNA-seq read counts. Genome Biology 15, R29. doi:10.1186/gb-2014-15-2-r29 . See also the Preprint Version at https://gksmyth.github.io/pubs/VoomPreprint.pdf incorporating some notational corrections. Law CW, Alhamdoosh M, Su S, Do

Resources


<!-- biomate-cta -->

Run this on BioMate

This skill is the knowledge layer — when, why, and how to use limma. To run this analysis on your own data with managed compute, automated QC, and reproducible outputs, use BioMate — free to start.

▶ Open limma on BioMate →

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

The package contains functions for exploratory oligonucleotide array analysis. The dependence on tkWidgets only concerns few convenience functions. 'affy' is fully functional without it.

日本語の概要は準備中です。原文の説明を表示しています。

bioMate-AI/biomate-bioconductor-kb8042026年6月21日 更新

This tool uses the label-tree function from HyPhy to annotate a phylogenetic tree. It allows users to select a subset of leaves using either a regular expression or a list of sequence names, and then apply a specified label to these selecte

日本語の概要は準備中です。原文の説明を表示しています。

bioMate-AI/biomate-bioconductor-kb8042026年6月21日 更新

This package provides a client for the Bioconductor AnnotationHub web resource. The AnnotationHub web resource provides a central location where genomic files (e.g., VCF, bed, wig) and other resources from standard locations (e.g., UCSC, En

日本語の概要は準備中です。原文の説明を表示しています。

bioMate-AI/biomate-bioconductor-kb8042026年6月21日 更新

apeglm provides Bayesian shrinkage estimators for effect sizes for a variety of GLM models, using approximation of the posterior for individual coefficients.

日本語の概要は準備中です。原文の説明を表示しています。

bioMate-AI/biomate-bioconductor-kb8042026年6月21日 更新

ASURAT is a software for single-cell data analysis. Using ASURAT, one can simultaneously perform unsupervised clustering and biological interpretation in terms of cell type, disease, biological process, and signaling pathway activity. Inputting a single-cell RNA-seq data and knowledge-based databases, such as Cell Ontology, Gene Ontology, KEGG, etc., ASURAT transforms gene expression tables into original multivariate tables, termed sign-by-sample matrices (SSMs).

日本語の概要は準備中です。原文の説明を表示しています。

bioMate-AI/biomate-bioconductor-kb8042026年6月21日 更新

AUCell allows to identify cells with active gene sets (e.g. signatures, gene modules...) in single-cell RNA-seq data. AUCell uses the "Area Under the Curve" (AUC) to calculate whether a critical subset of the input gene set is enriched with

日本語の概要は準備中です。原文の説明を表示しています。

bioMate-AI/biomate-bioconductor-kb8042026年6月21日 更新

bioMate-AI のスキルをすべて見る

このスキルの問題を報告する