Skip to content
cccskills
FreePublished on GitHub

bioconductor-sva

The sva package contains functions for removing batch effects and other unwanted variation in high-throughput experiment. Specifically, the sva package contains functions for the identifying and building surrogate variables for high-dimensi

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md5.9 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

sva

Dependencies & Environment

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

  • Version: 3.60.0 · Bioconductor: 3.23 · R: ≥ 4.6
  • Depends: mgcv, genefilter, BiocParallel
  • Imports: matrixStats, limma, edgeR
  • System requirements: URL
  • Install: BiocManager::install("sva")

When to Use

  • Surrogate Variable Analysis (SVA): Identifying and adjusting for hidden, unmodeled, or latent sources of variation in high-dimensional datasets using sva and num.sv.
  • Known Batch Effect Correction (ComBat): Adjusting for known batch effects in normalized gene expression data using ComBat.
  • RNA-seq Count Correction (ComBat-seq): Removing batch effects from raw RNA-seq count data using ComBat_seq while preserving the integer count structure.
  • Sequencing Data SVA: Estimating surrogate variables specifically for sequencing data using svaseq.
  • Frozen SVA for Prediction: Removing batch effects for prediction and clustering on new test datasets using fsva.

When NOT to Use

  • For single-cell RNA-seq batch correction, use Seurat or batchelor instead because ComBat/sva can overcorrect and destroy single-cell biological heterogeneity.
  • When the batch effect is completely confounded with the biological variable of interest, do not use ComBat/sva because it will remove the biological signal.

Data Requirements

  • Expression Data: A matrix of normalized gene expression values (e.g., from exprs) or raw integer counts (specifically for ComBat_seq).
  • Design Matrix: A model matrix representing the biological variables of interest (full model) created with model.matrix.
  • Batch Covariate: A vector or factor indicating the known batch for each sample.

Key Parameters

  • dat: The gene expression matrix (genes in rows, samples in columns).
  • mod: Model matrix of interest representing the biological variables to preserve.
  • mod0 (NULL): Null model matrix containing only the adjustment variables.
  • n.sv (NULL): Number of surrogate variables to estimate; can be estimated using num.sv.
  • batch: Factor or vector specifying the known batch variable.
  • covar_mod (NULL): Model matrix of covariates to adjust for during ComBat_seq run.
  • par.prior (TRUE): Whether to use parametric empirical Bayesian adjustments in ComBat.
  • group (NULL): Biological variable to preserve in ComBat_seq.

Best Practices

  • Always specify the biological model of interest (mod) when running sva or ComBat to prevent the algorithm from accidentally removing the biological signal.
  • For downstream differential expression with limma, include the estimated surrogate variables as covariates in the design formula (e.g., using lmFit and contrasts.fit).
  • Use ComBat_seq instead of standard ComBat when working with raw RNA-seq counts to maintain the integer distribution required by count-based differential tools.
  • Use num.sv to automatically estimate the number of latent factors before running sva.

Common Pitfalls

  • ComBat on raw counts: Running standard ComBat on raw counts; fix this by using ComBat_seq for raw counts.
  • Missing biological model: Failing to include the biological design matrix in ComBat, which leads to over-correction; fix this by always passing the mod parameter.
  • Confounded designs: Attempting to correct batch effects when they are completely confounded with the biological group; fix this by avoiding ComBat/SVA entirely.

Alternatives

  • limma: Provides removeBatchEffect for linear model-based batch correction, ideal for visualization but not for downstream differential testing.
  • ruv (Remove Unwanted Variation): Uses control genes or replicate samples to estimate and remove unwanted variation.
  • harman: A PCA-based batch correction method that constrains the correction to prevent over-correction of biological variation.

Citations

  • Leek, J. T., & Storey, J. D. (2007). Capturing heterogeneity in gene expression studies by surrogate variable analysis. PLoS Genetics, 3(9), e161.
  • Johnson, W. E., Li, C., & Rabinovic, A. (2007). Adjusting batch effects in microarray expression data using empirical Bayes methods. Biostatistics, 8(1), 118-127.
  • Zhang, Y., Parmigiani, G., & Johnson, W. E. (2020). ComBat-seq: batch effect adjustment in RNA-seq count data using empirical Bayes methods. NAR Genomics and Bioinformatics, 2(3), lqaa078.

References

<!-- biomate-cta -->

Run this on BioMate

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

▶ Open sva on BioMate →

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

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

The English summary is being prepared. Showing the original description.

bioMate-AI/biomate-bioconductor-kb793Updated Jun 21, 2026

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

The English summary is being prepared. Showing the original description.

bioMate-AI/biomate-bioconductor-kb793Updated Jun 21, 2026

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

The English summary is being prepared. Showing the original description.

bioMate-AI/biomate-bioconductor-kb793Updated Jun 21, 2026

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

The English summary is being prepared. Showing the original description.

bioMate-AI/biomate-bioconductor-kb793Updated Jun 21, 2026

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).

The English summary is being prepared. Showing the original description.

bioMate-AI/biomate-bioconductor-kb793Updated Jun 21, 2026

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

The English summary is being prepared. Showing the original description.

bioMate-AI/biomate-bioconductor-kb793Updated Jun 21, 2026

See all skills by bioMate-AI

Report a problem with this skill