Question: volcano plot help code
0
gravatar for priyadhawan11234
29 days ago by
priyadhawan112340 wrote:

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

sequencing rna-seq R gene • 96 views
ADD COMMENTlink modified 28 days ago by Kevin Blighe63k • written 29 days ago by priyadhawan112340
2
gravatar for Kevin Blighe
28 days ago by
Kevin Blighe63k
Kevin Blighe63k wrote:

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 COMMENTlink written 28 days ago by Kevin Blighe63k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1573 users visited in the last hour