Closed tiagochst closed 6 years ago
Hi,
I would suggest the following procedure
If you want to do the filtering process in ggpubr, you can go as follow.
library(tidyverse)
library(ggpubr)
# Prepare some data
df <- iris %>%
as_tibble() %>%
gather(key = "gene", value = "expression", -Species) %>%
rename(group = Species)
df
# A tibble: 600 x 3 group gene expression1 setosa Sepal.Length 5.1 2 setosa Sepal.Length 4.9 3 setosa Sepal.Length 4.7 4 setosa Sepal.Length 4.6 5 setosa Sepal.Length 5 6 setosa Sepal.Length 5.4 7 setosa Sepal.Length 4.6 8 setosa Sepal.Length 5 9 setosa Sepal.Length 4.4 10 setosa Sepal.Length 4.9 # ... with 590 more rows
res.stats <- compare_means(expression ~ group, group.by = "gene", data = df, method = "anova") %>%
filter(p.adj > 0.05)
Is it possible to have a function to keep only those ggboxplots that have a significant comparison when using facet.by ?
For example, if a have a list of genes from a given pathway and want to compare the expression of all those genes between some groups. Since the number of genes might be too big, is it possible to add an option to keep only genes that a comparison presents significant p-values?
For example, I wanted to show only CACNA1E in the plot below: