Log2FC data type error in EnhansedVolcano package
2
0
Entering edit mode
sauuyer ▴ 10
@sauuyer-22090
Last seen 5.1 years ago

Hello,

When running function EnhancedVolcano(): I am receiving the error that, log2FC is not numeric, though type(log2FC) returns "double."

Here is the format of the function:

EnhancedVolcano(df, lab = 'Gene', x = 'log2FC', y = 'pvalue', xlim = c(-5, 8))

The format of df is:

Gene, log2FC, pvalue 12953, 0.888282, 5.66e-12 ...

Any ideas why this function is not liking our data input for x?

software error enhancedvolcano • 23k views
ADD COMMENT
0
Entering edit mode

Just FYI: you should add the package name as a tag so that the package maintainer is notified when you post a question about their package.

ADD REPLY
0
Entering edit mode

I think you'll have to provide an example, otherwise its impossible to recreate your problem. Just running EnhancedVolcano with numbers like yours does not give this error.

ADD REPLY
0
Entering edit mode
Kevin Blighe ★ 4.0k
@kevin
Last seen 14 days ago
Republic of Ireland

Hey, I developed this package, which is the same as the function name. Can you paste the output of str(df) ?; and also quote the version of the package that you are using? - thanks.

In particular, your 'log2FC' column is failing this simple QC check: https://github.com/kevinblighe/EnhancedVolcano/blob/master/R/EnhancedVolcano.R#L78

Kevin

ADD COMMENT
1
Entering edit mode

Hi Kevin,

Thanks for your response. I have been able to produce a volcano plot, by adding data.frame(df), even through it already seemed to be a data.frame.

Here is the output you have requested:

str(df) 'data.frame': 27179 obs. of 2 variables: $ log2FC: num 0.881 0.64 -1.27 -1.295 1.158 ... $ pvalue: num 5.67e-12 7.46e-12 3.16e-11 3.16e-11 4.83e-10 ...

I have run my original script again, and it is now working even without the data.frame(df) coercion.

ADD REPLY
0
Entering edit mode
sauuyer ▴ 10
@sauuyer-22090
Last seen 5.1 years ago

I was able to resolve this issue. The problem was caused by the data format being imported directly as a csv containing pvalue and log2fc values, rather than going through the data alterations detailed in the bioconductor tutorial (here). This post (here) was a great help in figuring this out.

Forcing the df to be a data.frame within the equation has fixed all of the errors.

EnhancedVolcano(data.frame(df), lab = rownames(df), x = 'log2FC', y = 'pvalue', xlim = c(-1.5, 1.5), ylim = c(0, max(-log10(df[,'pvalue']))), title = 'Your title here' )

ADD COMMENT
0
Entering edit mode

Okay, great. If your original data was in a tibble format, that will be supported in the next release of the package.

ADD REPLY

Login before adding your answer.

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