I am fairly new at this. I want to construct a volcano plot that looks something like this: This is what I have so far
With the following code:
genes <- read_excel("VolcanoData.xlsx")
genes$Significant <- ifelse(genes$pvalue < 0.00000519, "FDR < 0.00000519", "Not Sig")
ggplot(data=genes, aes(x = rho, y = -log10(pvalue)))+
geom_point(aes(color = Significant), size=0.1)+
theme_bw(base_size = 12) + theme(legend.position = "bottom")+
scale_color_manual(values = c("red", "grey"))
And data that looks something like this
head(genes)
# A tibble: 6 x 5
gene rho pvalue label Significant
<chr> <dbl> <dbl> <chr> <chr>
1 NUBPL -0.936 9.79e-30 normal FDR < 0.00000519
2 EPB41L5 -0.931 2.41e-29 ND FDR < 0.00000519
3 PIGU -0.930 4.49e-29 normal FDR < 0.00000519
4 TSHR -0.920 6.78e-27 normal FDR < 0.00000519
5 ENPEP -0.916 1.11e-26 normal FDR < 0.00000519
6 SEC22A -0.910 3.88e-26 normal FDR < 0.00000519
tail(genes)
# A tibble: 6 x 5
gene rho pvalue label Significant
<chr> <dbl> <dbl> <chr> <chr>
1 HIGD1B 0.00144 0.993 normal Not Sig
2 CHST3 -0.000712 0.996 normal Not Sig
3 TLR10 0.000418 0.998 normal Not Sig
4 AVPR1A -0.000333 0.998 ND Not Sig
5 MFSD10 -0.000314 0.998 normal Not Sig
6 PARP10 0.0000317 1.000 normal Not Sig
I would like to color only the genes labeled "ND" in black. I've tried different combinations but I can't seem to make it work. Thank you!