Question: Error with the Volcano plot
1
gravatar for ulapei
19 months ago by
ulapei20
ulapei20 wrote:

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
ADD COMMENTlink modified 19 months ago • written 19 months ago by ulapei20
1

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 REPLYlink modified 19 months ago • written 19 months ago by Kevin Blighe54k

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 REPLYlink written 19 months ago by ulapei20

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 REPLYlink modified 19 months ago • written 19 months ago by Kevin Blighe54k
1
gravatar for ulapei
19 months ago by
ulapei20
ulapei20 wrote:

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 COMMENTlink modified 19 months ago by genomax78k • written 19 months ago by ulapei20
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: 2330 users visited in the last hour