Overlay points with EnhancedVolcano R
1
0
Entering edit mode
redafazazi • 0
@90e8f417
Last seen 20 months ago
Canada

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

Here is what my data frame looks like (res_table_tb_sex) enter image description here

Can anyone help me please?

EnhancedVolcano • 1.6k views
ADD COMMENT
0
Entering edit mode

Cross-posted on biostars: https://www.biostars.org/p/9556151/

ADD REPLY
2
Entering edit mode
Kevin Blighe ★ 4.0k
@kevin
Last seen 14 days ago
Republic of Ireland

[Thanks Ram]

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

ADD COMMENT

Login before adding your answer.

Traffic: 608 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6