Skip to content

Commit

Permalink
Update volcano_plots.R
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelqs committed Dec 13, 2023
1 parent 3422daa commit 5ed3f1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/volcano_plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
plot_volcano <- function(df, p_adj_col = "padj", lfc_col = "log2FoldChange",
label_col = "mgi_symbol",
p_adj_treshold = 0.05, lfc_treshold = 1,
labels_n = 20, labels = NULL) {
labels_n = 20, labels = NULL, labels_fun = ggrepel::geom_label_repel) {
df <- mutate(df,
significant = !!sym(p_adj_col) < p_adj_treshold,
change = case_when(
Expand Down Expand Up @@ -71,7 +71,7 @@ plot_volcano <- function(df, p_adj_col = "padj", lfc_col = "log2FoldChange",
values = c("steelblue2", "gray", "orangered3"),
breaks = c("down", "not sig.", "up")
) +
geom_label_repel(
labels_fun(
aes(label = !!sym(label_col)),
data = labels_data, show.legend = FALSE, max.overlaps = 30
) +
Expand Down

0 comments on commit 5ed3f1a

Please sign in to comment.