This is a test version of Biostars. For the public version, visit https://www.biostars.org.
EnhancedVolcano not plotting any dots

Hello and thanks in advance,

I would like to make something similar to the plot below without running DESeq.

Desired plot

I have the fold change and pvalue information in a .csv. I know the code is a bit weird but it loads fine and I can make a volcano plot that looks correct, but I am not very experienced in R and would like to use the enhanced volcano package to make a nice looking plot easily.

wrk.dir<-("C:/Users/Bonita McCuaig/OneDrive/Documents/Haku_metabolome")
otu.file.name<-"clinvsamp.csv"
meta.file.name<-"Metadata.csv"


#loading packages
library(phyloseq)
library(DESeq2)
library(plyr)
library(microbiome)
library(EnhancedVolcano)
library(tidyr)

setwd(wrk.dir)
#Reading in the OTU Data
OTU<-read.table(file=otu.file.name, sep=",", header=T)
OTU.names<-as.character(OTU[,1])
#fixing missing genus name
OTU.named<-read.table(file=otu.file.name, sep=",", header=T, check.names = F, row.names=OTU.names)
#set second number to number of variables in the table
dimensions<-dim(OTU)
OTU.named<-OTU.named[,2:dimensions[2]]


#Making sample integers so tables will merge
sapply(OTU.named, class)


VDF <- data.frame(row.names(OTU.named), log2(OTU.named$fc), OTU.named$pval)
names(VDF)[1] <- "Compound"
names(VDF)[2] <- "Log2FC"
names(VDF)[3] <- "pvalue"

myvolcanoplot <- ggplot(data = VDF, aes(x = Log2FC, y = -log10(pvalue))) + 
  geom_point() 

myvolcanoplot

p<-EnhancedVolcano(VDF,
                   lab = "Compound",
                   x = 'Log2FC',
                   y = 'pvalue',
                   selectLab = c("305", "261", "293", "4816", "4820"),
                   xlab = bquote(~Log[2]~ 'fold change'),
                   pCutoff = 0.001,
                   FCcutoff = 2.0,
                   pointSize = 4.0,
                   labSize = 6.0,
                   labCol = 'black',
                   labFace = 'bold',
                   boxedLabels = TRUE,
                   colAlpha = 4/5,
                   legendPosition = 'right',
                   legendLabSize = 14,
                   legendIconSize = 4.0,
                   drawConnectors = TRUE,
                   widthConnectors = 1.0,
                   colConnectors = 'black')

This is the plot made by the myvolcanoplot set of code.

Myvolcanoplot

This is the plot made by the EnhancedVolcano command.

failure

Any ideas why the points don't plot? I read somewhere else that the EnhancedVolcano changes the p-value automatically so that's why I have left it unchanged in the VDF dataframe.

Thanks

volcano-plot enhancedvolcano ggplot2

1 answer

One of my log2 fold change values was infinite. Replacing that with an actual number resulted in the graph working.

Log in to answer this question.