diff --git a/R/splicewiz_wrappers.R b/R/splicewiz_wrappers.R index 4713508..977aa36 100644 --- a/R/splicewiz_wrappers.R +++ b/R/splicewiz_wrappers.R @@ -201,6 +201,9 @@ get_diff_ASE_count_barplot <- function(x, #' @param summarise_groups_by a character string denoting a method to summaries groups. Can be one of the `mean` or `median`. #' @param 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. #' @param method a character string denoting a method for data value. Can be one of the "PSI", "logit" or "Z-Score". +#' @param depth_threshold default 10, refer `depth_threshold` of [SpliceWiz::makeMatrix()] +#' @param logit_max default 5, refer `logit_max` of [SpliceWiz::makeMatrix()] +#' @param na.percent.max default 0.1, refer `na.percent.max` of [SpliceWiz::makeMatrix()] #' #' @return a data matrix #' @export @@ -213,7 +216,13 @@ get_diff_ASE_count_barplot <- function(x, #' get_ASE_data_matrix(se, event_names , samples = c("A", "B"), column_condition ="treatment") #' get_ASE_data_matrix(se, event_names , samples = c("P", "Q","R"), column_condition ="replicate") #' -get_ASE_data_matrix <- function(se , event_names,samples,summarise_groups=TRUE,summarise_groups_by = "mean", method ="PSI", column_condition ="condition"){ +get_ASE_data_matrix <- function(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 + ){ match.arg(arg = summarise_groups_by, choices = c("mean","median")) @@ -227,7 +236,9 @@ get_ASE_data_matrix <- function(se , event_names,samples,summarise_groups=TRUE,s data_matrix <- SpliceWiz::makeMatrix(se = se, event_list = event_names, sample_list = samples_repli$samples, - method = method) %>% + method = method, + depth_threshold=depth_threshold,logit_max =logit_max, + na.percent.max= na.percent.max) %>% as.data.frame() %>% tibble::rownames_to_column(var = "event_name") %>% tibble::tibble() diff --git a/docs/reference/Rplot001.png b/docs/reference/Rplot001.png index eb05085..17a3580 100644 Binary files a/docs/reference/Rplot001.png and b/docs/reference/Rplot001.png differ diff --git a/docs/reference/get_ASE_data_matrix.html b/docs/reference/get_ASE_data_matrix.html index f05b607..fa87ba5 100644 --- a/docs/reference/get_ASE_data_matrix.html +++ b/docs/reference/get_ASE_data_matrix.html @@ -55,7 +55,10 @@

Usage summarise_groups = TRUE, summarise_groups_by = "mean", method = "PSI", - column_condition = "condition" + column_condition = "condition", + depth_threshold = 10, + logit_max = 5, + na.percent.max = 0.1 ) @@ -88,6 +91,18 @@

ArgumentsSpliceWiz::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

@@ -102,39 +117,23 @@

ExamplesSpliceWiz::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) -#> Mar 29 12:40:36 Performing edgeR contrast for included / excluded counts separately -#> Mar 29 12:40:37 Performing edgeR contrast for included / excluded counts together +#> +#> 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") -#> # A tibble: 99 × 3 -#> event_name A B -#> <chr> <dbl> <dbl> -#> 1 A3SS:NSUN5-201-exon3;NSUN5-203-exon3 1 0.996 -#> 2 A3SS:NSUN5-201-exon7;NSUN5-206-exon6 0.879 0.908 -#> 3 A3SS:NSUN5-201-exon8;NSUN5-novelTr003-exon2 0.953 0.958 -#> 4 A3SS:NSUN5-204-exon10;NSUN5-202-exon10 0.955 0.941 -#> 5 A3SS:SRSF1-201-exon4;SRSF1-novelTr001-exon2 0.766 0.877 -#> 6 A3SS:SRSF1-204-exon4;SRSF1-203-exon2 0.963 0.916 -#> 7 A3SS:SRSF2-202-exon2;SRSF2-201-exon2 0.988 0.989 -#> 8 A3SS:SRSF2-206-exon2;SRSF2-202-exon3 0.165 0.159 -#> 9 A3SS:SRSF2-206-exon2;SRSF2-novelTr003-exon2 0.988 0.981 -#> 10 A3SS:SRSF2-novelTr002-exon2;SRSF2-209-exon2 0.0530 0.0596 -#> # … with 89 more rows +#> 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") -#> # A tibble: 99 × 4 -#> event_name P Q R -#> <chr> <dbl> <dbl> <dbl> -#> 1 A3SS:NSUN5-201-exon3;NSUN5-203-exon3 0.997 1 0.997 -#> 2 A3SS:NSUN5-201-exon7;NSUN5-206-exon6 0.836 0.911 0.933 -#> 3 A3SS:NSUN5-201-exon8;NSUN5-novelTr003-exon2 0.929 0.979 0.959 -#> 4 A3SS:NSUN5-204-exon10;NSUN5-202-exon10 0.954 0.957 0.933 -#> 5 A3SS:SRSF1-201-exon4;SRSF1-novelTr001-exon2 0.807 0.738 0.920 -#> 6 A3SS:SRSF1-204-exon4;SRSF1-203-exon2 0.970 0.984 0.865 -#> 7 A3SS:SRSF2-202-exon2;SRSF2-201-exon2 0.984 0.988 0.993 -#> 8 A3SS:SRSF2-206-exon2;SRSF2-202-exon3 0.158 0.219 0.110 -#> 9 A3SS:SRSF2-206-exon2;SRSF2-novelTr003-exon2 0.987 0.996 0.971 -#> 10 A3SS:SRSF2-novelTr002-exon2;SRSF2-209-exon2 0.0954 0.00864 0.0649 -#> # … with 89 more rows +#> Error in event_list %in% rownames(se): object 'event_names' not found

diff --git a/man/get_ASE_data_matrix.Rd b/man/get_ASE_data_matrix.Rd index d5bd0fc..bb50f35 100644 --- a/man/get_ASE_data_matrix.Rd +++ b/man/get_ASE_data_matrix.Rd @@ -11,7 +11,10 @@ get_ASE_data_matrix( summarise_groups = TRUE, summarise_groups_by = "mean", method = "PSI", - column_condition = "condition" + column_condition = "condition", + depth_threshold = 10, + logit_max = 5, + na.percent.max = 0.1 ) } \arguments{ @@ -28,6 +31,12 @@ get_ASE_data_matrix( \item{method}{a character string denoting a method for data value. Can be one of the "PSI", "logit" or "Z-Score".} \item{column_condition}{a character string denoting a condition column from \code{se} to select samples. Same column will also be used to group and summaries samples.} + +\item{depth_threshold}{default 10, refer \code{depth_threshold} of \code{\link[SpliceWiz:make_plot_data]{SpliceWiz::makeMatrix()}}} + +\item{logit_max}{default 5, refer \code{logit_max} of \code{\link[SpliceWiz:make_plot_data]{SpliceWiz::makeMatrix()}}} + +\item{na.percent.max}{default 0.1, refer \code{na.percent.max} of \code{\link[SpliceWiz:make_plot_data]{SpliceWiz::makeMatrix()}}} } \value{ a data matrix