Entering edit mode
2.8 years ago
Riku
▴
80
Dear, everyone,
I have this table, and created MAplot using the following steps. In this plot, I would like to mark up only the genes that I specify:for example, I would like to display the gene name in a different color.
What is the best way to do this? Thank you for reading.
gene logFC logCPM PValue FDR
1 Ab_DN4787_c0_g1 8.701543 6.481583 8.718089e-95 1.898277e-90
2 Ab_DN9125_c0_g3 -8.575896 6.311612 5.984297e-77 6.515104e-73
3 Ab_DN4518_c0_g2 -3.880269 8.601647 1.125398e-68 8.168139e-65
4 Ab_DN11435_c0_g1 13.802492 6.566147 2.599560e-64 1.415071e-60
5 Ab_DN18643_c0_g1 13.949692 6.713022 1.070026e-62 4.659751e-59
> res <- read.table("input", sep="\t", header=T, quote = "\"", fill = T)
> A <- res$logCPM
> M <- res$logFC
> plot(A, M, xlab="Average log CPM", ylab="log-fold-change", pch=16, cex=0.4)
For OP issue, I would suggest you to use "enhancedvolcano" library from Bioconductor or use of ggplot (for plotting) and ggrepel (for labeling genes of interest)
with basic plotting and example data:
Thank you very much for your advice. I can make the same figure in ggplot2 with the following command, what options do I need in this case?
Thank you very much! I have been able to create beautiful graph thanks to you.
Please star ggplot devs here: https://github.com/tidyverse/ggplot2