to_intron | R Documentation |
Given a set of exons
, to_intron()
will return the corresponding introns.
to_intron(exons, group_var = NULL)
exons |
|
group_var |
|
It is important to note that, for visualization purposes, to_intron()
defines introns precisely as the exon boundaries, rather than the intron
start/end being (exon end + 1)/(exon start - 1).
data.frame()
contains the intron co-ordinates.
library(magrittr)
library(ggplot2)
# to illustrate the package's functionality
# ggtranscript includes example transcript annotation
sod1_annotation %>% head()
# extract exons
sod1_exons <- sod1_annotation %>% dplyr::filter(type == "exon")
sod1_exons %>% head()
# to_intron() is a helper function included in ggtranscript
# which is useful for converting exon co-ordinates to introns
sod1_introns <- sod1_exons %>% to_intron(group_var = "transcript_name")
sod1_introns %>% head()
# this can be particular useful when combined with
# geom_range() and geom_intron()
# to visualize the core components of transcript annotation
sod1_exons %>%
ggplot(aes(
xstart = start,
xend = end,
y = transcript_name
)) +
geom_range() +
geom_intron(
data = to_intron(sod1_exons, "transcript_name")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.