ggbio
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
- Depends: BiocGenerics, ggplot2
- Imports: gridExtra, scales, reshape2, gtable, Hmisc, biovizBase, Biobase, S4Vectors, IRanges, Seqinfo, GenomeInfoDb, GenomicRanges, SummarizedExperiment, Biostrings, Rsamtools, GenomicAlignments, BSgenome, VariantAnnotation, rtracklayer, GenomicFeatures, OrganismDbi, ensembldb, AnnotationDbi, AnnotationFilter, rlang
- Install:
BiocManager::install("ggbio")
When to Use
- Construct an ideogram track for a specific genome (e.g., hg19) using
Ideogram. - Plot gene models from
OrganismDb,TxDb, orEnsDbobjects usingautoplot. - Visualize zoomed regions on an ideogram by passing a
GRangesobject toxlim.
When NOT to Use
- For fetching specific gene/transcript information with a rich filtering system (use
ensembldbinstead). - For purely retrieving gene annotations without visualization (use
Homo.sapiensorTxDbdirectly).
Data Requirements
- Input data should be Bioconductor objects like
OrganismDb,TxDb,EnsDb,GRanges, orGRangesList. - Ideograms require specifying a supported genome build (e.g., "hg19", "mm10").
Key Parameters
- genome (default): Specifies the genome build (e.g., "hg19") for the
Ideogramfunction. - which (default): A
GRangesobject used to subset the region of interest inautoplot. - gap.geom (default): Controls the geometry of introns (e.g., "chevron") in gene model tracks.
- stat (default): Statistical transformation, such as "reduce" to collapse all features.
- columns (default): Specifies which columns to retrieve for labeling from an
OrganismDbobject. - names.expr (default): An expression to create flexible label combinations from column names.
- label.color (default): Controls the text color of the labels in
autoplot. - fill (default): Controls the fill color of the plotted features.
Best Practices
- Use
OrganismDborEnsDbobjects overTxDbif you need to label transcripts with gene symbols. - Use
stat = "reduce"inautoplotto collapse all features and simplify the gene model track. - Use
names.exprto combine multiple metadata columns (likeTXNAMEandGO) into a single track label.
Common Pitfalls
- Attempting to label a
TxDbgene model track with gene symbols. Fix:TxDbdoesn't contain gene symbols; use anOrganismDborEnsDbobject instead. - Ideogram zoom highlights not appearing correctly. Fix: Use
xlimwith aGRangesobject to change the highlighted zoomed region on the ideogram. - Overlapping or cluttered gene models in dense regions. Fix: Use
stat = "reduce"to collapse features or filter the input object before plotting.
Alternatives
ensembldb: For filtering and fetching Ensembl annotations rather than plotting them.ggplot2: For general-purpose grammar of graphics plotting without specialized genomic geoms.biovizBase: For underlying genomic data transformations that feed into visualizations.
Citations
- Yin, T., Cook, D., & Lawrence, M. (2012). ggbio: an R package for extending the grammar of graphics for genomic data. Genome Biology, 13(8), R77.
References
- Homepage: bioconductor.org/packages/ggbio
- Vignette: vignette_0_23da92f0.txt
Run this on BioMate
This skill is the knowledge layer — when, why, and how to use ggbio. To run this analysis on your own data with managed compute, automated QC, and reproducible outputs, use BioMate — free to start.