Question: EnhancedVolcano: How to coloring custom gene points in volcano plot?
gravatar for choijamtsm
8 months ago by
choijamtsm50 wrote:

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:


res <- read.table("text.txt", header=TRUE)
res$gene <- as.character(res$gene)

res object contains:

#       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

enhancedvolcano • 511 views
ADD COMMENTlink modified 8 months ago • written 8 months ago by choijamtsm50
gravatar for Kevin Blighe
8 months ago by
Kevin Blighe69k
Republic of Ireland
Kevin Blighe69k wrote:


If you want to label specific genes, then you just need to use the selectLab parameter, as elaborated here:

If you want to customise the colouring of the points, then you need to follow:

A much easier way to colour-mark key genes is by following this section (but this is a relatively new feature and is not fully developed to my liking):


ADD COMMENTlink written 8 months ago by Kevin Blighe69k

I followed vignette carefully but still no luck. Is there any alternative solutions to coloring point?

ADD REPLYlink written 8 months ago by choijamtsm50

A good practice is to run through the entire vignette using the code provided [in the vignette] - you literally will not have to write any of your own code. In this process, by checking the input and output for various commands / functions, you should be able to adapt the vignette's code to your own analysis.

ADD REPLYlink written 8 months ago by Kevin Blighe69k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1940 users visited in the last hour