Hi yall,
I was wondering if anyone could help me figure out how to add Asterisk over specific transcription factors labeled in my x-axis on my boxplot. Each of my TFs has three values and my code is the following. Just as extra info my mutants or my x-axis are my TFs, in this case, TF2 all the way to TF212. I want t highlight about 6 mutants via the asterisk to show their significance.
I took the liberty to clean up your code. If you supply some of your data or create a corresponding "dummy"-data, perhaps we can use it as a reference to solve your challenge
# Load libraries ----------------------------------------------------------
library("tidyverse")
# Load data ---------------------------------------------------------------
df <- Normalized_Ranged_Data_of_TF_for_summer_project
# Wrangle data ------------------------------------------------------------
df_long <- df %>%
pivot_longer(names_to = "mutant", values_to = "amount") %>%
mutate(is_TF33 = case_when(mutant == "TF33" ~ TRUE,
mutant != "TF33" ~ FALSE)) %>%
drop_na
# Visualise ---------------------------------------------------------------
df_long %>%
ggplot(aes(x = mutant, y = amount, fill = is_TF33)) +
geom_boxplot() +
scale_fill_manual(values = c("pink", "purple")) +
theme(axis.text.x = element_text(angle = 90, hjust = 1),
text = element_text(size = 10, family = "Serif")) +
labs(title = "Flocculation Level of Mutants",
x = "Mutant Transcription Factors",
y = "Degree of Flocculation")