Thanks Kevin, it's working now. I have another question about maxoverlapconnectors when I am using maxoverlapsConnectors = Inf, my graph looks totally black with few spots of red and green because I get the following warning ggrepel: 1307 unlabeled data points (too many overlaps). Consider increasing max.overlaps
My code is below:
keyvals <- ifelse(
db_P7_db_veh$log2FoldChange < -1.5 | db_P7_db_veh$pvalue < 0.05, 'green4',
ifelse(db_P7_db_veh$log2FoldChange > 1.5 | db_P7_db_veh$pvalue < 0.05, 'red',
'black'))
keyvals[is.na(keyvals)] <- 'black'
names(keyvals)[keyvals == 'red'] <- 'high'
names(keyvals)[keyvals == 'green4'] <- 'low'
EnhancedVolcano(db_P7_db_veh,
lab = db_P7_db_veh$Gene_symbol,
x = 'log2FoldChange',
y = 'pvalue',
selectLab = db_P7_db_veh$Gene_symbol[which(names(keyvals) %in% c('high', 'low'))],
xlab = bquote(~Log[2]~ 'fold change'),
pointSize = 2.5,
labSize = 3.5,
colCustom = keyvals,
colAlpha = 0.5,
legendPosition = 'right',
legendLabSize = 15,
legendIconSize = 5.0,
drawConnectors = TRUE,
widthConnectors = 1.0,
colConnectors = 'black',
arrowheads = FALSE,
gridlines.major = TRUE,
gridlines.minor = FALSE,
border = 'partial',
borderWidth = 1.5,
borderColour = 'black',
maxoverlapsConnectors = Inf)
Please help me in this. Thanks.
tagging Kevin Blighe
Thank you.