Question: Log2FC data type error in EnhansedVolcano package
0
12 days ago by
sauuyer10
sauuyer10 wrote:

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?

modified 11 days ago • written 12 days ago by sauuyer10

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.

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.

Answer: Log2FC data type error in EnhansedVolcano package
0
11 days ago by
Kevin Blighe200
Kevin Blighe200 wrote:

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

1

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.

Answer: Log2FC data type error in EnhansedVolcano package
0
11 days ago by
sauuyer10
sauuyer10 wrote:

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' )