I was wondering if it is possible to plot different font sizes for the labels in an EnhancedVolcano plot
I tried it with
..
labSize = c(ifelse(test = topG %in% "GAPDH", 3,1)),
..
and also with
labSize = c(ifelse(test = topG == "GAPDH", 3,1)),
the first one does increase the size of one label, but the wrong one, the second option doesn't do anything to the label size.
P.S. topG are the labels I want to show ( topG <- na.omit(c("GAPDH", resT[1:50,"gene_name"])))
The labSize vector created is of length 50 with the numbers 3,1,1,1,1,1,... Not sure, how to make the function recognize which gene name I won't to highlight.
Agree with this answer. I would create an extra column in my dataframe that marks the label size (if any) then pass that vector to the labsize function while plotting.
Thanks Kevin Blighe for the answer.
This is the complete command I use (I remove everything which is not important for the function itself)
resTis the modified results table from DESeq2, topG is a character vector with ~50 gene namesThe
ifelseclause creates the correct vector and put the correct values where they should beBut
EnhancedVolcanoregards the labelling differently and just assign the vector of names from the resT input table. It therefore increase the size of the first element of theresTtable and not the first element of the character vectortopG.I could solve the problem with changing the
ifelseclause to that:This is likely because the topG vector and resT dataframe have genes in different orders. In general, it's good practice to keep all of your plotting aesthetics relative to your input dataframe, hence the suggestion of making the label size its own column in the resT object.