volcano plot help code
1
0
Entering edit mode
10 months ago

I want to make a volcano plot with 4 different cell types and these cell types should have different shape and color. But i want log2foldchange value on y axis and -log10(pval) on x -axis. Can anyone help? Thank You

RNA-Seq R sequencing gene • 275 views
ADD COMMENT
2
Entering edit mode
10 months ago

Did you create this github issue? - https://github.com/kevinblighe/EnhancedVolcano/issues/52

Try EnhancedVolcano(...) + coord_flip():

library(EnhancedVolcano)
library(airway)
library(magrittr)

data('airway')
airway$dex %<>% relevel('untrt')

ens <- rownames(airway)

library(org.Hs.eg.db)
symbols <- mapIds(org.Hs.eg.db, keys = ens,
  column = c('SYMBOL'), keytype = 'ENSEMBL')
symbols <- symbols[!is.na(symbols)]
symbols <- symbols[match(rownames(airway), names(symbols))]
rownames(airway) <- symbols
keep <- !is.na(rownames(airway))
airway <- airway[keep,]

library('DESeq2')

dds <- DESeqDataSet(airway, design = ~ cell + dex)
dds <- DESeq(dds, betaPrior=FALSE)
res <- results(dds,
  contrast = c('dex','trt','untrt'))
res <- lfcShrink(dds,
  contrast = c('dex','trt','untrt'), res=res, type = 'normal')

p1 <- EnhancedVolcano(res,
  lab = rownames(res),
  x = 'log2FoldChange',
  y = 'pvalue')
p1 + coord_flip()

k

Kevin

ADD COMMENT

Login before adding your answer.

Traffic: 2099 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