Package: sctransform 0.4.1

Saket Choudhary

sctransform: Variance Stabilizing Transformations for Single Cell UMI Data

A normalization method for single-cell UMI count data using a variance stabilizing transformation. The transformation is based on a negative binomial regression model with regularized parameters. As part of the same regression framework, this package also provides functions for batch correction, and data correction. See Hafemeister and Satija (2019) <doi:10.1186/s13059-019-1874-1>, and Choudhary and Satija (2022) <doi:10.1186/s13059-021-02584-9> for more details.

Authors:Christoph Hafemeister [aut], Saket Choudhary [aut, cre], Rahul Satija [ctb]

sctransform_0.4.1.tar.gz
sctransform_0.4.1.tar.gz(r-4.5-noble)sctransform_0.4.1.tar.gz(r-4.4-noble)
sctransform_0.4.1.tgz(r-4.4-emscripten)sctransform_0.4.1.tgz(r-4.3-emscripten)
sctransform.pdf |sctransform.html
sctransform/json (API)
NEWS

# Install 'sctransform' in R:
install.packages('sctransform', repos = 'https://cloud.r-project.org')

Bug tracker:https://github.com/satijalab/sctransform/issues

Uses libs:
  • openblas– Optimized BLAS
  • c++– GNU Standard C++ Library v3
Datasets:
  • pbmc - Peripheral Blood Mononuclear Cells
  • umify_data - Transformation functions for umify

On CRAN:

Conda-Forge:

openblascpp

8.62 score 1 stars 74 packages 1.6k scripts 23k downloads 34 mentions 13 exports 46 dependencies

Last updated 1 years agofrom:de74747424. Checks:2 OK. Indexed: no.

TargetResultLatest binary
Doc / VignettesOKFeb 10 2025
R-4.5-linux-x86_64OKFeb 10 2025

Exports:correctcorrect_countsdiff_mean_testdiff_mean_test_conservedgenerateget_model_varget_residual_varget_residualsplot_modelplot_model_parssmooth_via_pcaumifyvst

Dependencies:clicodetoolscolorspacedigestdplyrfansifarverfuturefuture.applygenericsggplot2globalsgluegridExtragtableisobandlabelinglatticelifecyclelistenvmagrittrMASSMatrixmatrixStatsmgcvmunsellnlmeparallellypillarpkgconfigplyrR6RColorBrewerRcppRcppArmadilloreshape2rlangscalesstringistringrtibbletidyselectutf8vctrsviridisLitewithr

Citation

To cite sctransform in publications, please use:

Hafemeister, C. & Satija, R. Normalization and variance stabilization of single-cell RNA-seq data using regularized negative binomial regression. Genome Biol 20, 296 (2019).

Choudhary, S. & Satija, R. Comparison and evaluation of statistical error models for scRNA-seq. Genome Biology 23, 1-20 (2022).

Corresponding BibTeX entries:

  @Article{,
    author = {Christoph Hafemeister and Rahul Satija},
    title = {Normalization and variance stabilization of single-cell
      RNA-seq data using regularized negative binomial regression},
    journal = {Genome Biology},
    year = {2019},
    volume = {20},
    pages = {296},
    doi = {10.1186/s13059-019-1874-1},
    url = {https://doi.org/10.1186/s13059-019-1874-1},
  }
  @Article{,
    author = {Saket Choudhary and Rahul Satija},
    title = {Comparison and evaluation of statistical error models for
      scRNA-seq},
    journal = {Genome Biology},
    year = {2022},
    volume = {23},
    pages = {20},
    doi = {10.1186/s13059-021-02584-9},
    url = {https://doi.org/10.1186/s13059-021-02584-9},
  }

Readme and manuals

sctransform

R package for normalization and variance stabilization of single-cell RNA-seq data using regularized negative binomial regression

The sctransform package was developed by Christoph Hafemeister in Rahul Satija's lab at the New York Genome Center and described in Hafemeister and Satija, Genome Biology 2019. Recent updates are described in (Choudhary and Satija, Genome Biology, 2022). Core functionality of this package has been integrated into Seurat, an R package designed for QC, analysis, and exploration of single cell RNA-seq data.

Quick start

Installation:

# Install sctransform from CRAN
install.packages("sctransform")

# Or the development version from GitHub:
remotes::install_github("satijalab/sctransform", ref="develop")

Running sctransform:

# Runnning sctransform on a UMI matrix
normalized_data <- sctransform::vst(umi_count_matrix)$y
# v2 regularization
normalized_data <- sctransform::vst(umi_count_matrix, vst.flavor="v2")$y

# Runnning sctransform on a Seurat object
seurat_object <- Seurat::SCTransform(seurat_object)
#v2 regularization
seurat_object <- Seurat::SCTransform(seurat_object, vst.flavor="v2")

Help

For usage examples see vignettes in inst/doc or use the built-in help after installation
?sctransform::vst

Available vignettes:

Please use the issue tracker if you encounter a problem

References

Help Manual

Help pageTopics
Compare gene expression between two groupscompare_expression
Correct data by setting all latent factors to their median values and reversing the regression modelcorrect
Correct data by setting all latent factors to their median values and reversing the regression modelcorrect_counts
Non-parametric differential expression test for sparse non-negative datadiff_mean_test
Find differentially expressed genes that are conserved across samplesdiff_mean_test_conserved
Generate data from regularized models.generate
Return average variance under negative binomial modelget_model_var
Get median of non zero UMIs from a count matrixget_nz_median2
Return variance of residuals of regularized modelsget_residual_var
Return Pearson or deviance residuals of regularized modelsget_residuals
Identify outliersis_outlier
Convert a given matrix to dgCMatrixmake.sparse
Peripheral Blood Mononuclear Cells (PBMCs)pbmc
Plot observed UMI counts and modelplot_model
Plot estimated and fitted model parametersplot_model_pars
Robust scale using median and madrobust_scale
Robust scale using median and mad per binrobust_scale_binned
Geometric mean per rowrow_gmean
Variance per rowrow_var
Smooth data by PCAsmooth_via_pca
Quantile normalization of cell-level data to match typical UMI count dataumify
Transformation functions for umifyumify_data
Variance stabilizing transformation for UMI count datavst