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:

 [<a href="https://ibb.co/92snqsC"><img src="https://i.ibb.co/92snqsC/Rplot.png" alt="Rplot" border="0"></a>][1]


How can I color these overlapped gene lists? thank you


  [1]: http://%3Ca%20href=%22https://ibb.co/92snqsC%22%3E%3Cimg%20src=%22https://i.ibb.co/92snqsC/Rplot.png%22%20alt=%22Rplot%22%20border=%220%22%3E%3C/a%3E

Hey,

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

 - <a
   href="https://bioconductor.org/packages/release/bioc/vignettes/EnhancedVolcano/inst/doc/EnhancedVolcano.html#only-label-key-variables">4.7
   Only label key variables</a>

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

 - <a
   href="https://bioconductor.org/packages/release/bioc/vignettes/EnhancedVolcano/inst/doc/EnhancedVolcano.html#over-ride-colouring-scheme-with-custom-key-value-pairs">4.9
   Over-ride colouring scheme with custom key-value pairs</a>


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):

 - <a
   href="https://bioconductor.org/packages/release/bioc/vignettes/EnhancedVolcano/inst/doc/EnhancedVolcano.html#shade-certain-variables">4.11
   Shade certain variables</a>

Kevin