This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Overlay points with EnhancedVolcano R

Hi everyone,

I would like to colour a specific population of genes in a volcano plot using enhanced volcano function. The thing is they are crowded in the rest of the non-significant genes. Would like to overlay them to be visible.

Here is the code used

keyvals.colour <- ifelse(
res_table_tb_sex$ygenes == FALSE, 'grey',
ifelse(res_table_tb_sex$ygenes == TRUE, 'red', 'grey'))
keyvals.colour[is.na(keyvals.colour)] <- 'grey'
names(keyvals.colour)[keyvals.colour == 'red'] <- 'Y chrom genes'
names(keyvals.colour)[keyvals.colour == 'grey'] <- 'non Y chrom genes'

EnhancedVolcano(res_table_tb_sex,
            lab = rownames (res_table_tb_sex),
            x = 'log2FoldChange',
            y = 'padj',
            selectLab = as.character(res_table_tb_sex$genelabels),
            xlab = bquote(~Log[2]~ 'fold change'),
            title = 'Mearly vs Mrapid - Brain',
            pCutoff = 0.05,
            FCcutoff = 1.5,
            pointSize = 3.0,
            labSize = 6.0,
            labCol = 'black',
            labFace = 'bold',
            boxedLabels = TRUE,
            colCustom = keyvals.colour,
            colAlpha = 1, #transparency of the point
            legendLabels=c('NS','Log2FC','padj',
                           'padj & Log2FC'),
            legendPosition = 'right',
            legendLabSize = 14,
            legendIconSize = 5.0,
            drawConnectors = TRUE,
            widthConnectors = 1.0,
            colConnectors = 'black')

Here is the graph obtained. I you see, we can barely see the red dots. I would like that to be on top of the grey ones. enter image description here

Can anyone help me please?

rnaseq enhancedvolcano volcano-plot

make the point color semi-transparent by setting colAlpha = 0.5 where the smaller the alpha number the greater the transparency of the color

It is not looking better unfortunately

1 answer

[Thanks Ram and others]

If you want to increase the possibility that your genes of interest are visible in the final plot, then you should re-order your input data-frame (res_table_tb_sex) so that these genes [of interest] are featured in the final few rows of the data-frame.

ggplot2, on which EnhancedVolcano is based, plots the rows in the order in which they appear in the input data-frame; thus, those entries that appear in the final rows will be plot last, on top of / over all previous points.

Kind regards,

Kevin

Log in to answer this question.