Hello everyone!
I am learning to create a volcano plot by using EnhancedVolcano in R. But I am struggling to color custom points (genes).
Here is my input file:
library('EnhancedVolcano')
res <- read.table("text.txt", header=TRUE)
res$gene <- as.character(res$gene)
res object contains:
head(res)
# gene log2foldchange pvalue padj
#1 Cx3cr1 -8.039239 1.29e-118 2.780000e-116
#2 Trem1 -5.258502 3.01e-44 1.770000e-42
#3 Serpina3f 3.202818 2.12e-09 2.400000e-08
Also, I have gene lists which I want to label(able to do it), and color (cannot do it) in "res$gene" object (overlapping):
gene_list <- scan("503-5ptarget.txt", what="", sep="\n")
[1] "gene" "Fam122A" "Ccnd2" "Usp2" "Arl2" "Rab9B" "Dcaf7" "Pom121" "Ccdc42B" "N4Bp1" "Tmem74B" "Akt3"
Now I created this volcano plot by injecting "gene_list" into "res$gene". But the problem was I can "label" overlapped gene, But I "cannot color that point".
aa2 <- EnhancedVolcano(res,
lab = res$gene,
x = 'log2foldchange',
y = 'pvalue',
title = 'test',
subtitle = "test",
pCutoff = FALSE,
FCcutoff = FALSE,
xlim = c(-10, 10),
pointSize = 2.0,
cutoffLineType = 'blank',
selectLab = gene_list,
labCol = 'black',
labFace = 'bold',
colAlpha = 1,
shade = gene_list,
shadeLabel = 'gene list 1',
shadeAlpha = 1/2,
shadeFill = 'red',
shadeSize = 1,
shadeBins = 5,
col = c('grey', 'grey','grey', 'grey'),
drawConnectors = TRUE,
gridlines.major = FALSE,
gridlines.minor = FALSE,
legendVisible = FALSE)
Here is the plot:
How can I color these overlapped gene lists? thank you
Hi, I have the same problem than "choijamtsm", i followed the script and i'm able to put its specific name but i don't known how to change the color of a specific point, this will be very useful for me. thanks in advance
Can you please share the code that you have already tried? Also, please show samples of your input data (the results table)