Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Result precision #113

Merged
merged 2 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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("[email protected]"), role = c("aut", "cre"))
Description: Plotting tools for scData.
License: MIT + file LICENSE
Expand Down
4 changes: 3 additions & 1 deletion R/plot_cpdb.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
Expand Down Expand Up @@ -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) {
Expand Down
Loading