biovizBase
Dependencies & Environment
Package-intrinsic requirements from the Bioconductor landing page — reproduce in any R environment.
- Version: 1.60.0 · Bioconductor: 3.23 · R: ≥ 4.6
- Imports: scales, Hmisc, RColorBrewer, dichromat, BiocGenerics, S4Vectors, IRanges, Seqinfo, GenomeInfoDb, GenomicRanges, SummarizedExperiment, Biostrings, Rsamtools, GenomicAlignments, GenomicFeatures, AnnotationDbi, VariantAnnotation, ensembldb, AnnotationFilter, rlang
- System requirements: URL
- Install:
BiocManager::install("biovizBase")
When to Use
- Generating colorblind-safe palettes for biological data visualization using
colorBlindSafePal(). - Retrieving standardized, biologically sensible color schemes for cytobands, strands, or nucleotides using
getBioColor(). - Manipulating
GRangesobjects for plotting by adding disjoint stepping levels (addStepping()) or shrinking gaps (shrinkageFun()). - Fetching chromosome ideograms from the UCSC genome browser using
getIdeogram().
When NOT to Use
- For high-level, out-of-the-box static genomic plotting, use
ggbiobecausebiovizBaseonly provides the low-level utilities and color schemes. - For interactive genomic graphics, use
visnabbecausebiovizBaseis designed as a foundational infrastructure package rather than an interactive plotting tool.
Data Requirements
- Input Format:
GRangesobjects (from theGenomicRangespackage) for genomic manipulations, or character vectors of biological categories (e.g., "A", "C", "T", "G", "N") for color mapping. - Structure: Genomic coordinates must be properly formatted in
GRangesto use utilities likeaddStepping(),maxGap(), orgaps().
Key Parameters
- repeatable (TRUE): Controls whether to repeat colors if the required number exceeds the maximum colors allowed in
colorBlindSafePal(). - source ("default"): Specifies whether to retrieve colors from the default fixed settings or from the user's options in
getBioColor(). - extend.size (5): The size to extend ranges when adding stepping levels in
addStepping(). - max.gap (0): The maximum gap size allowed when shrinking gaps using
shrinkageFun(). - cytoband (TRUE): Logical indicating whether to include cytoband information when fetching an ideogram with
getIdeogram().
Best Practices
- Use
getBioColor()instead of accessing options directly to hide internal complexity and ensure uniform color schemes across all graphics. - Check custom color palettes for colorblind safety using
dichromat()to ensure accessibility for deuteranopia and protanopia. - Use
plotColorLegend()orshowColor()to visually verify your selected color schemes before applying them to complex genomic plots.
Common Pitfalls
- Running out of colors in a palette: Requesting more colors than a specific colorblind-safe palette supports returns
NAor errors. Fix: Setrepeatable = TRUEwhen calling the function returned bycolorBlindSafePal(). - Inconsistent color themes across plots: Hardcoding colors leads to mismatched figures. Fix: Temporarily edit colors in the global options (
options(biovizBase = opts)) sogetBioColor()returns uniform colors globally.
Alternatives
ggbio: Built on top ofbiovizBase, use this for actual static genomic plotting rather than just base utilities.visnab: Built on top ofbiovizBase, use this for interactive genomic graphics.RColorBrewer: Provides general color palettes, but lacks the built-in biological category mappings (like nucleotides or cytobands) provided bybiovizBase.dichromat: Used for colorblindness simulation, but does not provide genomic-specific color generators out of the box.
Citations
- Tengfei Yin, Michael Lawrence, Dianne Cook (2026). "An Introduction to biovizBase".
References
- Homepage: https://bioconductor.org/packages/biovizBase
- Vignette: https://bioconductor.org/packages/release/bioc/vignettes/biovizBase/inst/doc/biovizBase.pdf
Run this on BioMate
This skill is the knowledge layer — when, why, and how to use biovizbase. To run this analysis on your own data with managed compute, automated QC, and reproducible outputs, use BioMate — free to start.