Skip to content

Commit 174209b

Browse files
committed
Plot significant volcano points on top
1 parent 6d9c273 commit 174209b

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

R/core_diffbind_analyzer.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ get_diffbind_volcano_data <- function(
542542
mutate(FDR_is_significant = if_else(FDR <= fdr_threshold,
543543
paste('<=',fdr_threshold),
544544
paste('>',fdr_threshold))) %>%
545-
mutate(FDR_is_significant = factor(FDR_is_significant,
545+
mutate(FDR_is_significant = factor(FDR_is_significant,
546546
levels = paste(c('>','<='), fdr_threshold)))
547547
return(volcano.sites)
548548
}
@@ -608,6 +608,8 @@ make_diffbind_volcano_plot <- function(
608608
fdr_threshold = fdr_threshold,
609609
xdiff = xdiff,
610610
ymax = ymax)
611+
# sort so significant points are plotted on top
612+
volcano.sites <- volcano.sites %>% arrange(desc(FDR))
611613

612614
p <- ggplot(data = volcano.sites, aes(x = Fold, y = negLogFDR, color = FDR_is_significant)) +
613615
geom_point(size = point_size, alpha = point_alpha) +

man/make_diffbind_volcano_plot.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)