Skip to contents

Get a data matrix (PSI, logit, z-score) for a given ASE

Usage

get_ASE_data_matrix(
  se,
  event_names,
  samples,
  summarise_groups = TRUE,
  summarise_groups_by = "mean",
  method = "PSI",
  column_condition = "condition",
  depth_threshold = 10,
  logit_max = 5,
  na.percent.max = 0.1
)

Arguments

se

an object of class NxtSE.

event_names

a character vector denoting valid ASE names to plot in the heatmap.

samples

a character vector denoting valid sample names to plot in the heatmap.

summarise_groups

logical, denoting whether to summaries groups (replicates mostly), default TRUE.

summarise_groups_by

a character string denoting a method to summaries groups. Can be one of the mean or median.

method

a character string denoting a method for data value. Can be one of the "PSI", "logit" or "Z-Score".

column_condition

a character string denoting a condition column from se to select samples. Same column will also be used to group and summaries samples.

depth_threshold

default 10, refer depth_threshold of SpliceWiz::makeMatrix()

logit_max

default 5, refer logit_max of SpliceWiz::makeMatrix()

na.percent.max

default 0.1, refer na.percent.max of SpliceWiz::makeMatrix()

Value

a data matrix

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 = "treatment", test_nom = "A" ,test_denom = "B",  IRmode ="annotated",  cutoff_lfc = 0.6, cutoff_padj = 1, regul_based_upon = 2)
#> 
#> Attaching package: ‘purrr’
#> The following object is masked from ‘package:magrittr’:
#> 
#>     set_names
#> Jan 30 16:07:56 Performing edgeR contrast for included / excluded counts separately
#> Jan 30 16:07:58 Performing edgeR contrast for included / excluded counts together
event_names = get_ASEsets_by_regulation(x = res, sample_comparisons = "A_VS_B", regul = "all") %>% unlist()
#> Error in purrr::discard(ase, ~nrow(..1) > 0):  In index: 1.
#>  With name: sample_comparisons.
#> Caused by error:
#> ! `.p()` must return a single `TRUE` or `FALSE`, not an empty logical
#>   vector.
get_ASE_data_matrix(se, event_names , samples = c("A", "B"), column_condition ="treatment")
#> Error in event_list %in% rownames(se): object 'event_names' not found
get_ASE_data_matrix(se, event_names , samples = c("P", "Q","R"), column_condition ="replicate")
#> Error in event_list %in% rownames(se): object 'event_names' not found