diff --git a/DESCRIPTION b/DESCRIPTION index 9f6e4d8..15a0aeb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: ktplots Title: Plot single-cell data dotplots -Version: 2.3.0 +Version: 2.4.0 Authors@R: person("Kelvin", "Tuong", email = c("z.tuong@uq.edu.au"), role = c("aut", "cre")) Description: Plotting tools for scData. License: MIT + file LICENSE diff --git a/R/plot_cpdb.R b/R/plot_cpdb.R index 72f000f..6ab6fdc 100644 --- a/R/plot_cpdb.R +++ b/R/plot_cpdb.R @@ -30,6 +30,7 @@ #' @param scale_alpha_by_cellsign Whether or not to filter the transparency of interactions by the cellsign. #' @param filter_by_cellsign Filter out interactions with a 0 value cellsign. #' @param keep_id_cp_interaction Whether or not to keep the id_cp_interaction in the plot. +#' @param result_precision Sets integer value for decimal points of p_value, default to 3 #' @param ... passes arguments to grep for cell_type1 and cell_type2. #' @return ggplot dot plot object of cellphone db output #' @examples @@ -55,6 +56,7 @@ plot_cpdb <- function( special_character_regex_pattern = NULL, degs_analysis = FALSE, return_table = FALSE, exclude_interactions = NULL, min_interaction_score = 0, scale_alpha_by_interaction_scores = FALSE, scale_alpha_by_cellsign = FALSE, filter_by_cellsign = FALSE, title = "", keep_id_cp_interaction = FALSE, + result_precision = 3, ...) { requireNamespace("SingleCellExperiment") requireNamespace("grDevices") @@ -354,7 +356,7 @@ plot_cpdb <- function( names(df_) <- NULL df <- do.call(rbind, df_) } - df$pvals[which(df$pvals == 0)] <- 0.001 + df$pvals[which(df$pvals == 0)] <- 10^-result_precision df$pvals[which(df$pvals >= 0.05)] <- NA if (!is.null(splitby_key)) { if (length(groups) > 0) {