I have a data frame that looks like this:
rowname Class Sec ES.2um Mean_WPBs ES.2um_ZS Mean_ES VWF_Sec name
1 Formin HAI 113.37340 147.1792 0.16078492 131.69309 162.5219 DIAPH1
2 Formin HAI 43.90661 121.9017 -0.11594028 75.37296 137.4212 FMN2
3 Septin HAI 64.32138 132.7591 -0.16218581 66.23765 195.9011 SEPTIN5
4 Septin HAI 53.15791 145.7871 -0.86969449 81.92690 187.2647 LRCH3
5 Arp2/3 HAI 68.67222 161.0516 -0.05404113 82.51804 158.2623 ARPC3
6 Arp2/3 HAI 71.00643 149.0704 -0.38119473 82.91458 220.5494 WASF3
and am currently using gghighlight to identify/highlight a class of proteins; look at the code below:
plot_ESZ_lab <-ggplot(df, aes(ES.2um_ZS, VWF_Sec, color = Sec, shape = Sec)) +
geom_point(aes(size = Mean_ES)) +
scale_size_continuous(range=c(0.5,10))+
scale_color_manual(values=c("HAI" = "blue", "PMA" = "red")) +
gghighlight(Class == "Formin", use_direct_label = TRUE,
label_key = name, label_params = list(size=2)) +
xlab("Mean Exit Site Z-Score") + ylab("Secretion") +
ggtitle("Formin Highlighted") +
theme_bw() + theme(plot.title = element_text(hjust =0.5))
I would also like to highlight just 2 or 3 proteins using their names; this is what I have tried:
plot_ESZ_lab <-ggplot(df, aes(ES.2um_ZS, VWF_Sec, color = Sec, shape = Sec)) +
geom_point(aes(size = Mean_ES)) +
scale_size_continuous(range=c(0.5,10))+
scale_color_manual(values=c("HAI" = "blue", "PMA" = "red")) +
gghighlight(Class == "Formin", name == "FMN2", "DIAPH1",
use_direct_label = TRUE, label_key = name,
label_params = list(size=2)) +
xlab("Mean Exit Site Z-Score") + ylab("Secretion") +
ggtitle("Formin Highlighted") +
theme_bw() + theme(plot.title = element_text(hjust =0.5))
but only the first name provided to gghighlight (i.e. FMN2
) is ever plotted. How can I get more than 1 point to be plotted, i.e. in this case FMN2
and DIAPH1
?