kevinblighe / EnhancedVolcano

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

How to change the gene labels to Italic #69

Closed ccruizm closed 3 years ago

ccruizm commented 3 years ago

Good day!

nice tool! I have been trying to change the gene names to Italic instead, but have not been successful. Have tried selectLab = bquote(italic('gene_names')) but did not work. Could you help me with this, please? thanks in advance!

kevinblighe commented 3 years ago

Hi, I tried, briefly, but realised that this may be difficult based on how EnhancedVolcano is currently setup. Have you tried a manual solution via _geom_textrepel(..., parse = TRUE)? For example, take a look here: https://stackoverflow.com/questions/41528953/how-do-i-include-italic-text-in-geom-text-repel-or-geom-text-labels-for-ggplot

kevinblighe commented 3 years ago

Hi Cristian, this has now been implemented. Please check the GitHub vignette. For now, you will also have to install the GitHub version to avail of this new functionality. Related Twitter posting: https://twitter.com/KevinBlighe/status/1350054621214089217 Kevin

lmanchon commented 6 months ago

--Hi,

i have installed the GitHub version but it failed for me. what i used:

selectLab_italics = paste0("italic('",c('c1qb','f5','c1qa','p2rx7','klf2b','s1pr4','mmp9','cxcr3.1','tnfb','tlr4bb','arg2','ptger2a','timp2b','il10','il6','ptgs2a'),"')")

v <- EnhancedVolcano(rawlist_filtered, lab = rawlist_filtered$Gene, x = 'log2FoldChange', y = 'padj', selectLab = selectLab_italics, xlab = bquote('Fold Change (' ~Log[2]~ ')'), ylab = bquote('Significance (' ~-Log[10]~ ')'), axisLabSize = 10, caption = NULL, titleLabSize = 11, subtitleLabSize = 10, captionLabSize = 8, xlim = c(-5, 8), ylim = c(0,100), title = 'Volcano plot', subtitle = NULL, pCutoff = 0.05, FCcutoff = 1, colCustom = keyvals, colAlpha = 4/5, shadeSize = 0.01, shadeBins = 2, legendPosition = 'bottom', legendLabSize = 12, legendIconSize = 4.0, pointSize = 2, labFace = "plain", labSize = 6, shape = 19, shapeCustom = NULL, border = 'full', cutoffLineType = '3313', cutoffLineCol = '#5d5d5d', cutoffLineWidth = 0.5, col=c('grey30', 'grey30', 'grey30', 'red2'), borderWidth = 1, borderColour = 'black', drawConnectors = TRUE, boxedLabels = FALSE, parseLabels = TRUE, widthConnectors = 0.25, typeConnectors = "closed", endsConnectors = "first", lengthConnectors = unit(0.01, "npc"), colConnectors = "grey10", max.overlaps = 15, maxoverlapsConnectors = NULL, min.segment.length = 0, directionConnectors = "both", arrowheads = FALSE )