This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Error with the Volcano plot

Hi,

I am very new to R so I apologise in advance if something doesn't make sense. I am trying to create a basic Volcano plot based on my microarray analysis. I want to colour different subgroups of the points (genes) on the volcano plot, similar to this: https://cloud.githubusercontent.com/assets/10505524/18939504/cc686790-85ce-11e6-8132-65079812dc6b.png

To get points based p value, I ran:

> with(subset(table, adj.P.Val **<**.05, logFC **<** 2.0 ), points(logFC, -log10(P.Value), pch=16, cex= c(0.4), col="darkorange2"))

and this works just fine, however, when I run a script to obtain points based on fold change, i get this:

> with(subset(table, adj.P.Val **>**.05, logFC **>** 2.0 ), points(logFC, -log10(P.Value), pch=16, cex= c(0.4), col="paleturquoise4"))
Error in points(logFC, -log10(P.Value), pch = 16, cex = c(0.4), col = "paleturquoise4") : 
  object 'logFC' not found

I would appreciate if anyone could help me solve this as the only difference between these two lines are the directions of the arrows "<>" and the colour selected. I don't understand why suddenly R wouldn't be able to locate "logFC".

Thank you!

xxx edit xxx

I found out that if I swap logFC and adj.P.Val, the error disappears.

> with(subset(table, logFC **>** 2.0, adj.P.Val **>**.05 ), points(logFC, -log10(P.Value), pch=16, cex= c(0.4), col="paleturquoise4"))

However, the problem persists for getting the final group:

> with(subset(table, logFC **>** 2.0, adj.P.Val **<**.05 ), points(logFC, -log10(P.Value), pch=16, cex= c(0.4), col="paleturquoise4"))
Error in points(logFC, -log10(P.Value), pch = 16, cex = c(0.4), col = "paleturquoise4") : 
  object 'logFC' not found
microarray volcanoplot logfc error

Thanks! I tried your package, but I am having problems with column names as my data comes from a microarray and not RNA seq

It works independently of the platform used. Just do this:

EnhancedVolcano(table,
        lab = rownames(table),
        x = "logFC",
        y = "adj.P.Val")

I see that you nevertheless got it solved.

1 answer

I solved it by replacing comma with a & symbol.

 > with(subset(table, logFC **>** 2.0 **&** adj.P.Val **<**.05 ), points(logFC, -log10(P.Value), pch=16, cex= c(0.4), col="paleturquoise4"))

Log in to answer this question.