Plotting Upregulated and down regulated genes in different colour
0
0
Entering edit mode
Somenath • 0
@c7ccb854
Last seen 2.7 years ago
United States

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)
EnhancedVolcano • 1.2k views
ADD COMMENT

Login before adding your answer.

Traffic: 835 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6