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

bioconductor-apeglm

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

インストール方法を見る

含まれるファイル(1)

  • SKILL.md6.5 KB

SKILL.md(原文)

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

apeglm

Dependencies & Environment

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

  • Version: 1.34.0 · Bioconductor: 3.23 · R: ≥ 4.6
  • Depends: SummarizedExperiment, GenomicRanges, Rcpp
  • Imports: emdbook, SummarizedExperiment, GenomicRanges, Rcpp
  • System requirements: URL
  • Install: BiocManager::install("apeglm")

When to Use

  • Log Fold Change Shrinkage: Shrinking effect sizes for negative binomial GLMs in RNA-seq differential expression analysis (typically called via the DESeq2::lfcShrink wrapper).
  • Beta-Binomial Modeling: Estimating and shrinking GLM coefficients for binomial or beta-binomial rate data, such as allele-specific count ratios.
  • False Sign Rate Evaluation: Calculating local false sign rates (FSR) and s-values via svalue to control the probability of false-sign-or-small (FSOS) events.

When NOT to Use

  • Direct Log2 Scale Requirements: If you require coefficients directly estimated on the log2 scale without manual conversion, note that apeglm natively estimates coefficients on the natural log scale (though DESeq2::lfcShrink converts these to log2 internally).
  • Non-GLM Continuous Data: For standard linear modeling of continuous data (e.g., microarray log-intensities) where negative binomial or beta-binomial likelihoods do not apply.

Data Requirements

  • Input Counts: A SummarizedExperiment object or a matrix of raw integer counts passed to the Y parameter.
  • Design Matrix: A model matrix x specifying the experimental design (typically created using model.matrix).
  • Dispersions: A numeric vector of dispersion parameters param (e.g., estimated using dispersions from DESeq2).
  • MLE Estimates: A matrix mle containing maximum likelihood estimates of the coefficients and their standard errors, scaled to the natural log scale.
  • Offsets: A matrix of offsets offset matching the dimensions of the count matrix (e.g., log of sizeFactors).

Key Parameters

  • Y: The input data, which can be a SummarizedExperiment or a matrix of counts.
  • x: The design matrix (model matrix) for the GLM.
  • log.lik: The log-likelihood function to use (set to NULL when using fast C++ methods).
  • param: Parameter values for the likelihood, such as dispersion estimates.
  • coef: The integer index of the coefficient in the design matrix to shrink.
  • threshold: A numeric value on the natural log scale specifying the threshold for false-sign-or-small (FSOS) event probability calculation.
  • mle: A matrix of maximum likelihood estimates and their standard errors.
  • method: The estimation method to use, such as "nbinomR", "nbinomCR", "nbinomC", "betabinCR", "betabinC", or "general".

Best Practices

  • Use Integrated Wrappers: For standard RNA-seq workflows, call lfcShrink(dds, coef=2, type="apeglm") from the DESeq2 package to automatically handle scaling and parameter setup.
  • Select Fast C++ Methods: Use method="nbinomCR" (which calculates posterior standard deviations) or method="nbinomC" (which returns only MAP coefficients) to achieve 10x to 100x speedups over the default "general" method.
  • Scale Thresholds Correctly: When specifying a custom threshold in apeglm, multiply your log2-scale threshold by log(2) to convert it to the natural log scale required by the function.
  • Iterative Beta-Binomial Fitting: When modeling ratios of counts, perform iterative estimation of MLE coefficients and beta-binomial dispersions using bbEstDisp.

Common Pitfalls

  • Mismatched Coefficient Scales: Comparing raw apeglm output directly to log2 fold changes; fix this by multiplying the apeglm MAP estimates by log2(exp(1)) to convert them from the natural log scale to the log2 scale.
  • Slow Execution on Large Datasets: Using the default "general" method on large count matrices; fix this by setting method="nbinomCR" or method="nbinomC" for negative binomial data.
  • Line Search Failures: Encountering line search routine failures during beta-binomial dispersion estimation; fix this by ensuring your initial dispersion estimates and input counts are properly filtered and bounded.

Alternatives

  • DESeq2 (normal method): Provides the original normal-prior-based shrinkage estimator via lfcShrink(type="normal").
  • edgeR: Can be used as an alternative framework to estimate size factors and dispersions prior to shrinkage.
  • zinbwave: Useful in combination with apeglm to model zero-inflated negative binomial data by estimating and down-weighting excess zero components.

Citations

  • Zhu, A., Ibrahim, J. G., & Love, M. I. (2018). "Heavy-tailed prior distributions for sequence count data: adaptive shrinkage and its precision." Bioinformatics, 35(12), 2084-2092.
  • Stephens, M. (2016). "False discovery rates: a new dataset may warrant a new look." Biostatistics, 18(2), 275–294.
  • Love, M. I., Huber, W., & Anders, S. (2014). "Moderated estimation of fold change and dispersion for RNA-seq data with DESeq2." Genome Biology, 15(12), 550.

References

<!-- biomate-cta -->

Run this on BioMate

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

▶ Open apeglm 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日 更新

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日 更新

We propose an Asymmetric Within-Sample Transformation (AWST) to regularize RNA-seq read counts and reduce the effect of noise on the classification of samples. AWST comprises two main steps: standardization and smoothing. These steps transform gene expression data to reduce the noise of the lowly expressed features, which suffer from background effects and low signal-to-noise ratio, and the influence of the highly expressed features, which may be the result of amplification bias and other experi

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

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

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

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