Error with the Volcano plot
1
1
Entering edit mode
6.4 years ago
ulapei ▴ 20

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 • 2.2k views
ADD COMMENT
1
Entering edit mode

Not a direct answer but you can use my R package (dev), which is currently passing checks for submission to Bioconductor: https://github.com/kevinblighe/EnhancedVolcano

library(devtools)
install_github("kevinblighe/EnhancedVolcano")

Then take a look at the vignette for examples.

Also take a look here,for earlier versions of this function:

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
1
Entering edit mode
6.4 years ago
ulapei ▴ 20

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"))
ADD COMMENT

Login before adding your answer.

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