Annotate splice junctions with all possible transcript IDs in the given genomic region.

add_tx(df, transcripts)

Arguments

df

A data.frame with splice junctions in rows and at least the columns:

  • junc_id junction id consisting of genomic coordinates

transcripts

GRangesList of transcripts

Value

A data.frame as the input but with potentially multiple rows and with the additional column(s):

  • tx_id the ID of the affected transcript

  • tx_lst a list of GRanges with the transcript

Examples

junc_df <- tibble::tibble(
  junc_id = c("chr2:152389996-152392205:-", "chr2:152389996-152390729:-",
              "chr2:152389955-152389956:-")
)

add_tx(junc_df, toy_transcripts)
#> # A tibble: 27 × 3
#>    junc_id                    tx_id           tx_lst      
#>    <chr>                      <chr>           <named list>
#>  1 chr2:152389996-152392205:- ENST00000409198 <GRanges>   
#>  2 chr2:152389996-152392205:- ENST00000172853 <GRanges>   
#>  3 chr2:152389996-152392205:- ENST00000397345 <GRanges>   
#>  4 chr2:152389996-152392205:- ENST00000427231 <GRanges>   
#>  5 chr2:152389996-152392205:- ENST00000618972 <GRanges>   
#>  6 chr2:152389996-152392205:- ENST00000413693 <GRanges>   
#>  7 chr2:152389996-152392205:- ENST00000603639 <GRanges>   
#>  8 chr2:152389996-152392205:- ENST00000604864 <GRanges>   
#>  9 chr2:152389996-152392205:- ENST00000420924 <GRanges>   
#> 10 chr2:152389996-152390729:- ENST00000409198 <GRanges>   
#> # ℹ 17 more rows