Entering edit mode
Hi, I wanted to plot up regulated genes in one color and down regulated genes in another color in enhanced volcano. I am totally naive, and I would appreciate if you let me know how to do it. I was using keyvals. colour, but probably I am writing it wrong.
up_path <- c(vj$logFC < -2.0)
down_path <- c(vj$logFC > 2.0)
## Print volcano plots with up genes in purple and down genes in green
keyvals.colour1 <- ifelse(
rownames(vj) %in% up_path, 'purple',
ifelse(rownames(vj) %in% down_path, 'green',
'black'))
keyvals.colour1[is.na(keyvals.colour1)] <- 'black'
names(keyvals.colour1)[keyvals.colour1 == 'black'] <- 'NA'
names(keyvals.colour1)[keyvals.colour1 == 'purple'] <- 'vj$logFC < -2.0'
names(keyvals.colour1)[keyvals.colour1 == 'green'] <- 'vj$logFC > 2.0'
EnhancedVolcano(vj,
lab = rownames(vj),
x = 'logFC',
y = 'pValue',
selectLab = c('Axl','Mfge8','Gas6','Tyro3','S1pr1','Mertk'),
xlim = c(-10, 10),
pCutoff = 0.001,
FCcutoff = 1.5,
boxedLabels = TRUE,
drawConnectors = TRUE)