Skip to content

Commit 6be4e15

Browse files
committed
Added a fix to do_GroupwiseDEHeatmap where pvalues of 0 would cause an error.
1 parent 134fd43 commit 6be4e15

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ The reason of these modification is to allow for a much clearer and concise outp
111111

112112
## do_GroupwiseDEHeatmap()
113113
- Reduced the legend title texts to allow for more room in the plot.
114+
- Fixed a bug in which providing a DE genes object with `p_val_adj = 0` would cause the function to crash.
114115

115116
## do_LigandReceptorPlot()
116117
- Added a new parameter `top_interactions_by_group` which when set to `TRUE` will report for each pair of `source` and `target`, as many interactions as stated in `top_interactions`.

R/do_GroupwiseDEHeatmap.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ do_GroupwiseDEHeatmap <- function(sample,
210210
dplyr::group_by(.data$cluster) %>%
211211
dplyr::filter(.data[[specificity]] <= p.cutoff) %>%
212212
dplyr::slice_head(n = top_genes)
213+
213214

214215
gene.order <- data.use$gene %>% unique()
215216

@@ -224,6 +225,10 @@ do_GroupwiseDEHeatmap <- function(sample,
224225
dplyr::arrange(dplyr::desc(.data[[magnitude]]), dplyr::desc(.data$p.adj.log10.minus)) %>%
225226
dplyr::select(-dplyr::all_of(c(specificity)))
226227

228+
data.use$p.adj.log10.minus[data.use$p.adj.log10.minus == Inf] <- .Machine$double.xmax
229+
230+
231+
227232
# Workaround parameter deprecation.
228233
if (base::isTRUE(utils::packageVersion("Seurat") < "4.9.9")){
229234
data <- Seurat::GetAssayData(object = sample,

0 commit comments

Comments
 (0)