Unable to label in Enhanced Volcano
0
0
Entering edit mode
@fd0f6e40
Last seen 2.9 years ago
Spain

Good morning.

I would like to plot an Enhanced Volcano using the results of my toptable. I am unable to plot a short list of genes of my own interest. Moreover, I created two cutoffs: one from adjusted p value and another from my beta variable (log2 fold change), and I found that my volcano is not right. These are my comands:

library(EnhancedVolcano)

NM53_WT_T_NM53_atf6_T<-NM53_WT_T_NM53_atf6_T %>% dplyr::distinct(ext_gene,.keep_all=T)

keyvals.colour <- ifelse(
  NM53_WT_T_NM53_atf6_T$b< -1.0 & NM53_WT_T_NM53_atf6_T$pval<10^-4, 'forestgreen',
  ifelse(NM53_WT_T_NM53_atf6_T$b > 1.0 & NM53_WT_T_NM53_atf6_T$pval<10^-4, 'red2',
         'grey30'))
keyvals.colour[is.na(keyvals.colour)] <- 'grey30'
names(keyvals.colour)[keyvals.colour == 'red2'] <- 'Upregulated genes'
names(keyvals.colour)[keyvals.colour == 'grey30'] <- 'NS'
names(keyvals.colour)[keyvals.colour == 'forestgreen'] <- 'Downregulated genes'

volcano.dir<-"F:/r_output/ES 2162/Volcano plots/"
setwd(volcano.dir)

s_genes<-c('Hspa5','Calr',"Pdia3","H2-D1")
pdf(paste0(volcano.dir,"_","NM53_WT_T_NM53_atf6_T","_",Sys.Date(),".pdf"),width = 9,height = 9,
    paper = "a4",onefile = T)
Volcano <- EnhancedVolcano(NM53_WT_T_NM53_atf6_T,
                      lab = NM53_WT_T_NM53_atf6_T$ext_gene,
                      x = 'b',
                      y = 'qval',
                      selectLab = s_genes,
                      xlim = c(-7,7),
                      ylim = c(0,9),
                      boxedLabels = TRUE,
                      xlab = "log2(Fold-change)",
                      ylab = "-log10(adjusted P-value)",
                      title = 'Volcano NM53_WT_T_NM53_atf6_T',
                      pCutoff = 10^-4,
                      FCcutoff = 1.0,
                      pointSize = 1.0,
                      labSize = 6.0,
                      labCol = "black",
                      labFace = "bold",
                      colCustom = keyvals.colour,
                      colAlpha = 4/5,
                      legendPosition = 'right',
                      legendLabSize = 10,
                      legendIconSize = 2.0,
                      drawConnectors = TRUE,
                      widthConnectors = 1.0,
                      typeConnectors = 'open',
                      endsConnectors = 'last',
                      colConnectors="black",
                      arrowheads = TRUE,
                      gridlines.major = TRUE,
                      gridlines.minor = FALSE,
                      border = 'partial',
                      borderWidth = 1.0,
                      borderColour = 'black')
Volcano
dev.off()

Could you help me?

Best regards

Visualization • 1.1k views
ADD COMMENT
0
Entering edit mode

Hola, can you please show the output of:

str(NM53_WT_T_NM53_atf6_T)
which(s_genes %in% NM53_WT_T_NM53_atf6_T$ext_gene)

Why are you using:

x = 'b'

?

ADD REPLY

Login before adding your answer.

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