Skip to content
naulon

No retraction, correction or concern found when last checked on Oct 16, 2026.

ggtranscript : an R package for the visualization and interpretation of transcript isoforms using ggplot2

Emil K Gustavsson, David Zhang, Regina H Reynolds and 2 more

Bioinformatics · 2022 · CC BY

doi:10.1093/bioinformatics/btac409

Abstract

Motivation. The advent of long-read sequencing technologies has increased demand for the visualization and interpretation of transcripts. However, tools that perform such visualizations remain inflexible and lack the ability to easily identify differences between transcript structures. Here, we introduce ggtranscript, an R package that provides a fast and flexible method to visualize and compare transcripts. As a ggplot2 extension, ggtranscript inherits the functionality and familiarity of ggplot2 making it easy to use.

Availability and implementation. ggtranscript is an R package available at https://github.com/dzhang32/ggtranscript (DOI: https://doi.org/10.5281/zenodo.6374061) via an open-source MIT licence. Further documentation is available at https://dzhang32.github.io/ggtranscript/.

Full text

From PubMed Central, U.S. National Library of Medicine, as current on Oct 16, 2026. Paragraph numbers are ours, so an answer can point at one.

1 Introduction

Alternative splicing is a crucial post-transcriptional step through which introns are excised from messenger RNA (mRNA) precursors, and exons are spliced together to form mature mRNA isoforms. In fact, ∼95% of human genes undergo alternative splicing resulting in various forms of mature mRNA. This process is often regulated in a tissue-specific, disease-specific or developmental manner, resulting in multiple different transcripts being generated from the same gene.

It is well-recognized that it is challenging to identify full-length transcript structures from standard transcriptomic assays relying on short-read RNA-sequencing, as short-reads rarely span multiple splice junctions and therefore make it difficult to infer transcript structures. However, long-read sequencing platforms such as PacBio and Oxford Nanopore have transformed the field and enabled the discovery of new transcript isoforms that could not have been recognized by the assembly of short-reads. In addition, long reads facilitate better transcript quantifications and improve mapping of highly homologous sequences.

Current tools to visualize transcript structures are often inflexible, allowing users very limited control over the outputted plot aesthetics or lack the ability to compare transcript structures. For example, UCSC genome browser, IGV Browser and Gviz are genome-based tracks that allow for visualization of transcripts, but are not accessible programmatically. IsoformSwitchAnalyzeR, wiggleplotr and ggsashimi offers limited customization of plot aesthetics and comparisons of transcript structures. SWAN does offer some customizable transcript visualization functions, but has limited functionality to highlight differences and is within the python framework.

Here, we introduce the R package ggtranscript which makes it easy to both visualize and compare transcript structures using ggplot2, a popular R-based framework for data visualization based upon an intuitive grammar system that permits flexibility via combination of independent components. As a ggplot2 extension, ggtranscript inherits a vast amount of flexibility when determining the plot aesthetics, as well as interoperability with existing ggplot2 geoms and ggplot2 extensions. Furthermore, the input data for ggtranscript matches widely used formats in genetic and transcriptomic analyses.

2 Implementation

ggtranscript is an R package released that extends the incredibly popular tool ggplot2 (RRID: SCR_014601 version: 3.3.5, https://cran.r-project.org/web/packages/ggplot2/index.html) for visualizing transcript structure and annotation.

As a ggplot2 extension, the input data for ggtranscript are required to be a data.frame with columns specifying the start and end positions of each feature (e.g. exon or intron) as well as identifiers for the transcript(s) to be plotted. This data format is widely used across transcriptomic and genetic analyses and matches annotation and data structures such as the GTF/GFF3 files or GenomicRanges objects.

To enable the visualization of the transcript structures, ggtranscript introduces five new geoms [geom_range, geom_half_range, geom_intron, geom_junction and geom_junction_label_repel] and several helper functions designed to facilitate the visualization of transcript structure and annotation.

geom_range and geom_intron enable the plotting of exons and introns, the core components of transcript annotation (Fig. 1A). ggtranscript also provides the helper function to_intron, which converts exon co-ordinates to the corresponding introns. Together, ggtranscript enables users to plot transcript structures with only exons as the required input and only a few lines of code. geom_range is designed to be used for any range-based genomic annotation. For instance, when plotting protein-coding transcripts, geom_range can be used to visually distinguish the coding regions from untranslated regions (Fig. 1A).

geom_half_range takes advantage of the vertical symmetry of transcript annotation by plotting only half of a range on the top or bottom of a transcript structure; one use case of which is to visualize the differences between two transcripts more clearly (Fig. 1B). As a ggplot2 extension, ggtranscript inherits the familiarity and functionality of ggplot2. For instance, by leveraging ggforce::facet_zoom users can zoom in on regions of interest (Fig. 1B). geom_junction enables the plotting of junction curves, which can be overlaid across transcript structures to annotate them with supporting short-read RNA-sequencing data (Fig. 1C). geom_junction_label_repel adds a label to junction curves, which can often be useful to mark junctions with a metric of their usage such as read counts (Fig. 1C).

For longer, more complex transcripts, small differences between exons of interest can be more difficult to visualize (Fig. 1D). For this reason, ggtranscript includes a helper function shorten_gaps which shortens regions that do not overlap an exon to a fixed, user-inputted width. Plotting of the rescaled exons and introns enables easier comparison between transcript structures when genes are long (Fig. 1E). In addition, the function to_diff facilitates this by highlighting differences in comparison to a reference transcript (Fig. 1F).

Together, ggtranscript simplifies the process of visualizing and comparing transcript structures, facilitating the exploration, analyses and interpretation of long-read sequencing and transcriptomic data.

3 Conclusion

ggtranscript enables a fast and simplified way to visualize, explore and interpret transcript isoforms. It allows users to combine data from both long-read and short-read RNA-sequencing technologies, making systematic assessment of transcript support easier. Finally, by being a ggplot2 extension it is highly flexible and can easily generate high-quality and publication-ready plots.

References 9

  1. 1.
  2. 2.

    Hahne F., Ivanek R. (2016 ) Visualizing genomic data using gviz and bioconductor. Methods Mol. Biol., 1418, 335–351.

    Not in our library10.1007/978-1-4939-3578-9_16

  3. 3.

    Kent W.J. et al (2002 ) The human genome browser at UCSC. Genome Res., 12, 996–1006.

    Not in our library10.1101/gr.229102

  4. 4.

    Li Y.I. et al (2018 ) Annotation-free quantification of RNA splicing using LeafCutter. Nat. Genet., 50, 151–158.

    Not in our library10.1038/s41588-017-0004-9

  5. 5.

    Reese F., Mortazavi A. (2021 ) Swan: a library for the analysis and visualization of long-read transcriptomes. Bioinformatics, 37, 1322–1323.

    Not in our library10.1093/bioinformatics/btaa836

  6. 6.

    Robinson J.T. et al (2011 ) Integrative genomics viewer. Nat. Biotechnol., 29, 24–26.

    Not in our library10.1038/nbt.1754

  7. 7.

    Vitting-Seerup K. et al (2019 ) IsoformSwitchAnalyzeR: analysis of changes in genome-wide patterns of alternative splicing and its functional consequences. Bioinformatics, 35, 4469–4471.

    Not in our library10.1093/bioinformatics/btz247

  8. 8.

    Wang E.T. et al (2008 ) Alternative isoform regulation in human tissue transcriptomes. Nature, 456, 470–476.

    Not in our library10.1038/nature07509

  9. 9.

    Wickham H. (2016 ) ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag, New York. ISBN 978-3-319-24277-4, https://ggplot2.tidyverse.org.

    Not in our library

Cited by papers we hold 5

Reads

Read by people on this page

None yet.

Checked or read by AI through naulon

None yet.

A person counts once a day per paper. We keep no cookie and no address: a reader is a hash that changes every day. Any month under five reads shows no number.

Are you an author?

Is this your paper?

Claim it to add your note and be paid when agents cite it. Free.