Skip to content

Commit

Permalink
Fix bug heatmap (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tu-feng authored Feb 2, 2023
1 parent 9dd9d0b commit 04cd8aa
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions R/plot_cpdb_heatmap.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,14 @@ plot_cpdb_heatmap <- function(scdata, idents, pvals, log1p_transform = FALSE, sh
colnames(all_intr) <- intr_pairs
all_count <- reshape2::melt(all_intr)
if (!degs_analysis){
all_count <- all_count[all_count$value < alpha, ]
all_count$significant <- all_count$value < alpha
} else {
all_count <- all_count[all_count$value == 1, ]
all_count$significant <- all_count$value == 1
}
count1x <- all_count[, 1, drop = FALSE] %>%
group_by_all() %>%
summarise(COUNT = n()) %>%

count1x <- all_count %>%
group_by(Var1) %>%
summarise(COUNT = sum(significant)) %>%
as.data.frame
tmp <- lapply(count1x[, 1], function(x) strsplit(as.character(x), "\\|"))
tmp <- lapply(tmp, function(x) x[[1]])
Expand Down

0 comments on commit 04cd8aa

Please sign in to comment.