kevinblighe / EnhancedVolcano

Publication-ready volcano plots with enhanced colouring and labeling
399 stars 81 forks source link

Set ylim and plot greater values on the limit along x-axis. #67

Closed elcega closed 3 years ago

elcega commented 3 years ago

Hi again,

Even after lfcShrink to my dds, my data on the y label (Log10P) is quite concentrated and has few "outliers" which make the visualisation a bit complicated, therefore, is there a way in the EnhancedVolcano() where you can determine the ylim=c(0,20) and plot any outliers with higher values y > 20 as a different shape/colour along the x-axis at y =20.

Something similar I found in another graph is this: https://ibb.co/2yBp08x Where outliers are plotted as triangles.

kevinblighe commented 3 years ago

You would have to program / code that manually, first by changing the fold-change values in your input data, and then by modifying the shape of those points. Sorry, but no other way for now.

It could be as easy as:

res$log2FoldChange_new <- ifelse(abs(res$log2FoldChange) > 6, 6, res$log2FoldChange)
shape_vector <- ifelse(abs(res$log2FoldChange) > 6, 18, 20)

EnhancedVolcano(res,
    lab = rownames(res),
    x = 'log2FoldChange_new',
    y = 'pvalue',
    shape = shape_vector)