Annotate if there is an exon within an intron
exon_in_intron(df, transcripts)
A data.frame with splice junctions in rows and at least the columns:
junc_id
junction id consisting of genomic coordinates
tx_id
transcript id consisting of genomic coordinates
a GRangesList with transcripts defined as GRanges of exons
created by GenomicFeatures::exonsBy(txdb, by = c("tx"), use.names = TRUE)
.
A data.frame as the input but with potentially multiple rows
and with the additional column(s):
- exon_free
: Boolean indicating if the given IR junctions is exon-free. Will return NA for non-intron retentions.
library(dplyr)
#>
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#>
#> filter, lag
#> The following objects are masked from ‘package:base’:
#>
#> intersect, setdiff, setequal, union
toy_tx <- GenomicRanges::GRangesList(list(
tx1 = GenomicRanges::GRanges(
c("1", "1", "1"),
IRanges::IRanges(
c(2, 15, 27),
c(8, 23, 35),
),
strand = c("+", "+", "+")
),
tx1a = GenomicRanges::GRanges(
c("1" ),
IRanges::IRanges(
c(3),
c(10),
),
strand = c("+")
)))
df <- tibble(
junc_id = c("1:8-9:+", "1:14-15:+"),
tx_id = c("tx1", "tx1")
)
df1 <- df %>%
exon_in_intron(transcripts = toy_tx)