Entering edit mode
3.6 years ago
n.tear
▴
80
Hi,
I am attempting to highlight a number of genes that intersect with a list of EMT genes I have.
When I run the below, any genes that are not EMT genes disappear.. How can I fix this?
top20padj <- head(res.smIHW.cp1df.rmNA.ord$symbol, n=20)
topLFCgenes <- res.smIHW.cp1df.rmNA.ord[order(-abs(res.smIHW.cp1df.rmNA.ord$shrunkLFC)), ]
top20LFCgenes <- head(topLFCgenes$symbol, n=20)
# define genes that will show as shape 17
VolcanoEMTgenes <- as.vector(EMTgenes$`intersect(EMTdbgenes$GeneSymbol, res.smIHW.cp1df.rmNA.sig$symbol)`)
# create custom key-value pairs for defined genes
# this can be achieved with ifelse statements
keyvals.shape <- ifelse(res.smIHW.cp1df.rmNA.ord$symbol %in% VolcanoEMTgenes, 17, 19)
keyvals.shape[is.na(keyvals.shape)] <- 19
names(keyvals.shape)[keyvals.shape == 17] <- 'EMT genes'
library(EnhancedVolcano)
EnhancedVolcano(res.smIHW.cp1df.rmNA.ord,
lab = res.smIHW.cp1df.rmNA.ord$symbol,
x = 'shrunkLFC',
y = 'padj',
title = '',
subtitle = '',
pCutoff = .05,
FCcutoff = 2,
pointSize = 3.0,
labSize = 4.0,
legendLabels=c('Not sig.','Log2 FC','p-value',
'p-value & Log2 FC'),
selectLab = c(top20LFCgenes, top20padj),
shapeCustom = keyvals.shape,
drawConnectors = TRUE,
widthConnectors = 0.2,
colConnectors = 'grey30')