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

bioconductor-transformgampoi

Variance-stabilizing transformations help with the analysis of heteroskedastic data (i.e., data where the variance is not constant, like count data). This package provide two types of variance stabilizing transformations: (1) methods based on the delta method (e.g., 'acosh', 'log(x+1)'), (2) model residual based (Pearson and randomized quantile residuals).

インストール方法を見る

含まれるファイル(1)

  • SKILL.md5.1 KB

SKILL.md(原文)

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

transformGamPoi

Workflows

Standard Workflow

Apply delta method-based transformations (acosh or shifted logarithm) to stabilize the variance of count data.

library(transformGamPoi)
library(SingleCellExperiment)

# Load the data
sce <- TENxPBMCData::TENxPBMCData("pbmc4k")
sce <- sce[sample(nrow(sce), 1000), sample(ncol(sce), 500)]

# Apply the acosh transformation to the count matrix
assay(sce, "acosh") <- acosh_transform(assay(sce, "counts"))

# Alternatively, apply the shifted log transformation with a specified pseudo-count
y_shiftLog <- shifted_log_transform(assay(sce, "counts"), pseudo_count = 1/(4 * 0.1))

Inputs are a SingleCellExperiment or count matrix; outputs are variance-stabilized values added as an assay or returned as a matrix.

Model Residuals Transformation

Apply model residuals-based transformations (Pearson or randomized quantile residuals) to stabilize variance across all genes, including lowly expressed ones.

library(transformGamPoi)
library(SingleCellExperiment)

# Load the data
sce <- TENxPBMCData::TENxPBMCData("pbmc4k")
sce <- sce[sample(nrow(sce), 1000), sample(ncol(sce), 500)]

# Apply the Pearson residuals transformation with clipping
assay(sce, "pearson") <- residual_transform(sce, "pearson", clipping = TRUE, on_disk = FALSE)

# Alternatively, apply the randomized quantile residuals transformation
assay(sce, "rand_quantile") <- residual_transform(sce, "randomized_quantile", on_disk = FALSE)

Inputs are a SingleCellExperiment or count matrix; outputs are Pearson or randomized quantile residuals.

When to Use

  • When analyzing heteroskedastic count data (e.g., single-cell RNA-seq counts) where variance increases with mean expression.
  • To prepare count data for classical statistical methods (like PCA or clustering) that perform best on data with uniform variance.
  • When you want to stabilize variance for lowly expressed genes using model residuals (residual_transform).

When NOT to Use

  • Do not use on already normalized or log-transformed values; this package requires raw, heteroskedastic count data.
  • For differential expression testing directly; use glmGamPoi or DESeq2 which model the count distribution directly.

Data Requirements

  • Raw count matrix-like objects (e.g., matrix, dgCMatrix, DelayedArray, SummarizedExperiment, SingleCellExperiment).
  • Sparsity is preserved for sparse inputs where possible.
  • Typically filtered to exclude genes where all counts are zero (e.g., using rowMeans2(counts(sce)) > 0).

Key Parameters

  • overdispersion (0.1): The Gamma-Poisson overdispersion parameter $\alpha$ used in acosh_transform.
  • pseudo_count (1/(4 * overdispersion)): The pseudo-count $c$ used in shifted_log_transform.
  • clipping (TRUE): Whether to clip extremely large Pearson residuals in residual_transform.
  • on_disk (FALSE): Whether to perform calculations on disk for large datasets in residual_transform.

Best Practices

  • Exclude genes with zero counts across all cells using rowMeans2 before applying transformations.
  • Use acosh_transform or shifted_log_transform to retain sparsity of the input data (ensuring $g(0) = 0$).
  • Use randomized quantile residuals (residual_transform with "randomized_quantile") to handle the discrete nature of counts and stabilize variance for lowly expressed genes.

Common Pitfalls

  • Loss of sparsity: Choosing an offset in log-transformation that shifts zero counts to non-zero values. Fix: Use shifted_log_transform or acosh_transform which are designed to preserve sparsity ($g(0) = 0$).
  • Poor stabilization of lowly expressed genes with delta method: Delta method-based transformations (like acosh) still show increasing variance for low mean expression ($\mu < 0.5$). Fix: Use residual_transform with Pearson or randomized quantile residuals instead.

Alternatives

  • scry: For deviance residuals as a feature selection and dimension reduction tool.
  • sctransform (Seurat): For regularized negative binomial regression-based normalization.
  • scran: For pooling-based size factor normalization.

Citations

  • Hafemeister, C. and Satija, R. 2019. "Normalization and variance stabilization of single-cell RNA-seq data using regularized negative binomial regression." Genome Biology.

References

レビュー

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

同じリポジトリのスキル

概要と使いどころ

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 のスキルをすべて見る

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