Skip to contents

Get Alternate Splice Events based on their differential regulation.

Usage

get_ASE_by_regulation(
  x,
  sample_comparisons,
  regulation = "both",
  event_type = NULL,
  simplify = FALSE
)

get_ASEsets_by_regulation(
  x,
  sample_comparisons,
  regulation = "both",
  event_type = NULL
)

Arguments

x

an abject of class "parcutils_ase". This is an output of the function run_ase_diff_analysis().

sample_comparisons

a character vector denoting sample comparisons for which ASE to be obtained.

regulation

a character string, default both. Values can be one of the up, down, both, other, all.

  • up : returns all up regulated ASE.

  • down : returns all down regulated ASE

  • both : returns all up and down regulated ASE.

  • other : returns ASE other than up and down regulated ASE.

  • all : returns all ASE.

event_type

a character string denoting event type for which one of the up, down, both, other or all events to be returned based. Choices are: IR, SE, AFE, ALE, A3SS, A5SS and MXE. Default NULL, uses all event types.

simplify

logical, default FALSE, if TRUE returns result in a dataframe format.

Value

a list or dataframe.

Details

For a given differential comparison this function returns up, down, both, other and all ASE.

Examples

se <- SpliceWiz::SpliceWiz_example_NxtSE(novelSplicing = TRUE)
SpliceWiz::colData(se)$treatment <- rep(c("A", "B"), each = 3)
SpliceWiz::colData(se)$replicate <- rep(c("P","Q","R"), 2)

res <- run_ase_diff_analysis(x = se, test_factor = "replicate", test_nom = c("P","Q","R") ,test_denom = c("Q","R","P"),  IRmode ="annotated",  cutoff_lfc = 0.6, cutoff_pval = 1, regul_based_upon = 1)
#> 
#> Attaching package: ‘purrr’
#> The following object is masked from ‘package:GenomicRanges’:
#> 
#>     reduce
#> The following object is masked from ‘package:IRanges’:
#> 
#>     reduce
#> The following object is masked from ‘package:magrittr’:
#> 
#>     set_names
#> Mar 18 15:09:40 Performing edgeR contrast for included / excluded counts separately
#> Mar 18 15:09:42 Performing edgeR contrast for included / excluded counts together
#> Mar 18 15:09:44 Performing edgeR contrast for included / excluded counts separately
#> Mar 18 15:09:45 Performing edgeR contrast for included / excluded counts together
#> Mar 18 15:09:46 Performing edgeR contrast for included / excluded counts separately
#> Mar 18 15:09:47 Performing edgeR contrast for included / excluded counts together

# get both up and down regulated genes
get_ASE_by_regulation(x = res, sample_comparisons = c("P_VS_Q")) %>% head()
#>          SE:SRSF3-202-exon5;SRSF3-novelTr004-int1 
#>                                              down 
#>          SE:TRA2B-205-exon4;TRA2B-novelTr003-int1 
#>                                              down 
#>          SE:TRA2B-208-exon3;TRA2B-novelTr003-int1 
#>                                              down 
#>       A5SS:TRA2A-202-exon3;TRA2A-novelTr004-exon1 
#>                                              down 
#> MXE:TRA2B-novelTr015-exon2;TRA2B-novelTr014-exon2 
#>                                              down 
#>              A3SS:NSUN5-201-exon3;NSUN5-203-exon3 
#>                                              down 
#> Levels: up down other

# get up genes only
get_ASE_by_regulation(x = res, sample_comparisons = c("P_VS_Q") , regul = "up") %>% head()
#> A3SS:SRSF2-novelTr002-exon2;SRSF2-209-exon2 
#>                                          up 
#>    SE:TRA2B-novelTr014-exon2;TRA2B-214-int2 
#>                                          up 
#>    SE:SRSF2-novelTr004-exon2;SRSF2-209-int1 
#>                                          up 
#>            SE:TP53-201-exon10;TP53-217-int1 
#>                                          up 
#> A5SS:SRSF2-novelTr001-exon1;SRSF2-209-exon1 
#>                                          up 
#>    SE:SRSF1-201-exon2;SRSF1-novelTr004-int1 
#>                                          up 
#> Levels: up down other

# get SE events
get_ASE_by_regulation(x = res, sample_comparisons = c("P_VS_Q") , regul = "down",event_type = "SE") %>% head()
#> SE:SRSF3-202-exon5;SRSF3-novelTr004-int1 
#>                                     down 
#> SE:TRA2B-205-exon4;TRA2B-novelTr003-int1 
#>                                     down 
#> SE:TRA2B-208-exon3;TRA2B-novelTr003-int1 
#>                                     down 
#>        SE:SRSF3-204-exon3;SRSF3-202-int2 
#>                                     down 
#>        SE:SRSF3-203-exon4;SRSF3-202-int3 
#>                                     down 
#>        SE:TRA2B-205-exon7;TRA2B-201-int3 
#>                                     down 
#> Levels: up down other

# get genes other than up and down
get_ASE_by_regulation(x = res, sample_comparisons = c("P_VS_Q") , regul = "other") %>% head()
#> A5SS:SRSF2-206-exon2;SRSF2-202-exon2  TRA2B/ENST00000453386_Intron4/clean 
#>                                other                                other 
#>  SRSF3/ENST00000373715_Intron5/clean  SRSF3/ENST00000373715_Intron4/clean 
#>                                other                                other 
#>  AFE:TRA2B-215-exon1;TRA2B-203-exon1 A3SS:TRA2B-205-exon8;TRA2B-204-exon4 
#>                                other                                other 
#> Levels: up down other

# Simplify output for multiple sample comparisons
get_ASE_by_regulation(x = res, sample_comparisons = res$de_comparisons, simplify = TRUE, regul= "both",event_type = "IR")
#> $P_VS_Q
#> # A tibble: 4 × 3
#>   sample_comparisons ase                                      regul
#>   <chr>              <chr>                                    <fct>
#> 1 P_VS_Q             SRSF1/ENST00000258962_Intron3/known-exon down 
#> 2 P_VS_Q             TP53/ENST00000269305_Intron2/known-exon  down 
#> 3 P_VS_Q             SRSF2/ENST00000585202_Intron3/known-exon up   
#> 4 P_VS_Q             SRSF1/ENST00000581979_Intron3/known-exon up   
#> 
#> $Q_VS_R
#> # A tibble: 7 × 3
#>   sample_comparisons ase                                      regul
#>   <chr>              <chr>                                    <fct>
#> 1 Q_VS_R             SRSF1/ENST00000581979_Intron3/known-exon down 
#> 2 Q_VS_R             TRA2B/ENST00000453386_Intron4/clean      down 
#> 3 Q_VS_R             SRSF1/ENST00000258962_Intron3/known-exon up   
#> 4 Q_VS_R             NSUN5/ENST00000252594_Intron2/clean      up   
#> 5 Q_VS_R             SRSF3/ENST00000373715_Intron5/clean      up   
#> 6 Q_VS_R             NSUN5/ENST00000438747_Intron9/known-exon up   
#> 7 Q_VS_R             TP53/ENST00000269305_Intron2/known-exon  up   
#> 
#> $R_VS_P
#> # A tibble: 6 × 3
#>   sample_comparisons ase                                      regul
#>   <chr>              <chr>                                    <fct>
#> 1 R_VS_P             SRSF3/ENST00000373715_Intron5/clean      down 
#> 2 R_VS_P             SRSF1/ENST00000258962_Intron3/known-exon down 
#> 3 R_VS_P             SRSF2/ENST00000585202_Intron3/known-exon down 
#> 4 R_VS_P             NSUN5/ENST00000252594_Intron2/clean      down 
#> 5 R_VS_P             NSUN5/ENST00000438747_Intron9/known-exon down 
#> 6 R_VS_P             SRSF1/ENST00000581979_Intron3/known-exon up   
#> 


# get genesets by regulation. It uses sample comparison and regulation to name each output geneset.

get_ASEsets_by_regulation(x = res, sample_comparisons = "P_VS_Q", regul = "both")
#> $P_VS_Q_down
#>  [1] "SE:SRSF3-202-exon5;SRSF3-novelTr004-int1"          
#>  [2] "SE:TRA2B-205-exon4;TRA2B-novelTr003-int1"          
#>  [3] "SE:TRA2B-208-exon3;TRA2B-novelTr003-int1"          
#>  [4] "A5SS:TRA2A-202-exon3;TRA2A-novelTr004-exon1"       
#>  [5] "MXE:TRA2B-novelTr015-exon2;TRA2B-novelTr014-exon2" 
#>  [6] "A3SS:NSUN5-201-exon3;NSUN5-203-exon3"              
#>  [7] "A5SS:TRA2A-novelTr003-exon1;TRA2A-novelTr004-exon1"
#>  [8] "A5SS:TRA2A-208-exon2;TRA2A-novelTr004-exon1"       
#>  [9] "A3SS:NSUN5-201-exon8;NSUN5-novelTr003-exon2"       
#> [10] "SRSF1/ENST00000258962_Intron3/known-exon"          
#> [11] "A5SS:TRA2A-202-exon3;TRA2A-203-exon2"              
#> [12] "SE:SRSF3-204-exon3;SRSF3-202-int2"                 
#> [13] "SE:SRSF3-203-exon4;SRSF3-202-int3"                 
#> [14] "A5SS:SRSF1-208-exon4;SRSF1-novelTr001-exon1"       
#> [15] "SE:TRA2B-205-exon7;TRA2B-201-int3"                 
#> [16] "A3SS:TRA2B-214-exon3;TRA2B-novelTr010-exon2"       
#> [17] "A5SS:SRSF2-202-exon1;SRSF2-205-exon1"              
#> [18] "A5SS:TRA2A-novelTr003-exon1;TRA2A-203-exon2"       
#> [19] "SE:SRSF3-novelTr008-exon2;SRSF3-202-int2"          
#> [20] "A3SS:SRSF1-204-exon4;SRSF1-203-exon2"              
#> [21] "A3SS:SRSF2-206-exon2;SRSF2-novelTr003-exon2"       
#> [22] "A5SS:SRSF2-201-exon1;SRSF2-207-exon1"              
#> [23] "A3SS:SRSF2-206-exon2;SRSF2-202-exon3"              
#> [24] "SE:SRSF2-206-exon2;SRSF2-202-int2"                 
#> [25] "AFE:TRA2B-214-exon1;TRA2B-202-exon1"               
#> [26] "A5SS:TRA2A-208-exon2;TRA2A-203-exon2"              
#> [27] "A3SS:TRA2B-208-exon3;TRA2B-205-exon4"              
#> [28] "A3SS:TRA2A-201-exon7;TRA2A-202-exon9"              
#> [29] "SE:TRA2B-214-exon3;TRA2B-novelTr004-int1"          
#> [30] "TP53/ENST00000269305_Intron2/known-exon"           
#> [31] "A3SS:SRSF3-201-exon4;SRSF3-novelTr002-exon2"       
#> [32] "A3SS:NSUN5-novelTr002-exon2;NSUN5-novelTr001-exon2"
#> [33] "SE:TP53-207-exon2;TP53-201-int1"                   
#> [34] "AFE:TP53-211-exon1;TP53-201-exon1"                 
#> [35] "ALE:TP53-217-exon2;TP53-202-exon9"                 
#> 
#> $P_VS_Q_up
#>  [1] "A3SS:SRSF2-novelTr002-exon2;SRSF2-209-exon2"       
#>  [2] "SE:TRA2B-novelTr014-exon2;TRA2B-214-int2"          
#>  [3] "SE:SRSF2-novelTr004-exon2;SRSF2-209-int1"          
#>  [4] "SE:TP53-201-exon10;TP53-217-int1"                  
#>  [5] "A5SS:SRSF2-novelTr001-exon1;SRSF2-209-exon1"       
#>  [6] "SE:SRSF1-201-exon2;SRSF1-novelTr004-int1"          
#>  [7] "SRSF2/ENST00000585202_Intron3/known-exon"          
#>  [8] "SRSF1/ENST00000581979_Intron3/known-exon"          
#>  [9] "MXE:SRSF1-209-exon2;SRSF1-novelTr005-exon2"        
#> [10] "A3SS:SRSF1-201-exon4;SRSF1-novelTr001-exon2"       
#> [11] "A5SS:SRSF1-207-exon3;SRSF1-208-exon4"              
#> [12] "A5SS:SRSF2-211-exon1;SRSF2-206-exon2"              
#> [13] "SE:SRSF1-207-exon3;SRSF1-novelTr001-int1"          
#> [14] "A5SS:SRSF1-206-exon1;SRSF1-201-exon1"              
#> [15] "SE:TRA2A-201-exon6;TRA2A-novelTr001-int1"          
#> [16] "SE:TRA2A-208-exon2;TRA2A-201-int1"                 
#> [17] "SE:TRA2A-203-exon2;TRA2A-201-int1"                 
#> [18] "SE:SRSF1-208-exon4;SRSF1-novelTr001-int1"          
#> [19] "SE:NSUN5-201-exon6;NSUN5-novelTr002-int1"          
#> [20] "A5SS:TRA2A-novelTr004-exon1;TRA2A-203-exon2"       
#> [21] "SE:TRA2A-211-exon2;TRA2A-201-int1"                 
#> [22] "A5SS:SRSF1-novelTr001-exon1;SRSF1-novelTr002-exon1"
#> [23] "A5SS:SRSF1-207-exon3;SRSF1-novelTr002-exon1"       
#> [24] "SE:TRA2B-novelTr015-exon2;TRA2B-214-int2"          
#> [25] "A5SS:SRSF2-211-exon1;SRSF2-202-exon2"              
#> [26] "A5SS:SRSF3-202-exon5;SRSF3-novelTr007-exon1"       
#> [27] "A5SS:TRA2A-208-exon2;TRA2A-202-exon3"              
#> [28] "SE:SRSF3-203-exon5;SRSF3-novelTr003-int1"          
#> [29] "A5SS:SRSF1-novelTr003-exon1;SRSF1-201-exon3"       
#> [30] "A5SS:TRA2A-208-exon2;TRA2A-novelTr003-exon1"       
#> [31] "SE:TRA2A-212-exon2;TRA2A-201-int1"                 
#> [32] "MXE:SRSF3-novelTr008-exon2;SRSF3-204-exon3"        
#> [33] "SE:TP53-201-exon4;TP53-214-int3"                   
#> [34] "A3SS:TP53-201-exon5;TP53-218-exon5"                
#> [35] "SE:TP53-201-exon6;TP53-216-int1"                   
#> [36] "A3SS:TP53-204-exon10;TP53-206-exon10"              
#> [37] "ALE:TP53-210-exon5;TP53-216-exon2"                 
#>