Overlay points with EnhancedVolcano R
1
0
Entering edit mode
14 months ago
redafazazi ▴ 30

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 • 2.0k views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

It is not looking better unfortunately

ADD REPLY
0
Entering edit mode

Cross-posted on bioC support: https://support.bioconductor.org/p/9149886/ after I pointed OP to Kevin's post asking folks to open support threads there.

ADD REPLY
4
Entering edit mode
14 months ago

[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

ADD COMMENT
1
Entering edit mode

Thank you so much, it worked!

ADD REPLY

Login before adding your answer.

Traffic: 1547 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