pointSize, labSize, and DrawConnectors error when plotting EnhancedVolcano
1
0
Entering edit mode
knholm • 0
@knholm-18825
Last seen 17 months ago

In case this was a compatability error, I have re-downloaded Rstudio (v1.3) and EnhancedVolcano from:

if (!requireNamespace('BiocManager', quietly = TRUE))
install.packages('BiocManager')
BiocManager::install('EnhancedVolcano')

But still encounter the same error.

pointSize, labSize, are not autocompleting when typing the condition in my EnhancedVolcano script, which leads me to believe it is not recognized in my package.

DrawConnectors autocompletes, but when used does not generate a plot (plot window in Rstudio is completely blank).

If I do not include DrawConnectors, pointSize, or labSize, the plot generates, but when included I lose the plot

Error in EnhancedVolcano(df1, lab = row.names(df1), x = "log2FC", y = "Age.Adjusted.FDR",  :
unused arguments (pointSize = c(ifelse(df1$log2FC > 0.3, 8, 1)), drawConnectors = TRUE) EnhancedVolcano(df1, lab = row.names(df1), x = "log2FC", y = "Age.Adjusted.FDR", ylab = bquote(~-Log[10]~italic(FDR)), title = "Volcano Plot", pCutoff = 0.2, FCcutoff = 0.3, legendPosition = "right", pointSize = c(ifelse(df1$log2FC > 0.3, 8, 1)),
labSize = 4.0,
col=c("black", "orange", "blue", "red"),
legend=c("NS","Log2 FC > |0.3|","FDR < 0.2","FDR < 0.2 & Log2 FC > |0.3|"),
drawConnectors = TRUE,
ylim = c(0,-log10(10e-4))
)

Is there an obvious reason I'm missing as to why these lines aren't working? Or an alternative method to increase the point size and label size of specific genes?

EnhancedVolcano • 1.4k views
0
Entering edit mode
@kevin
Last seen 22 hours ago
V&A Waterfront, Cape Town, South Africa

Hi,

You are likely using an old version of R and, therefore, an old version of EnhancedVolcano and Bioconductor. Please upgrade so that you can avail of the most recent functionality of this package.

Kevin

0
Entering edit mode

Thank you for the quick response,

I have updated R to the latest version - and attempted to reinstall Enhanced Volcano.

Is:

if (!requireNamespace('BiocManager', quietly = TRUE))
install.packages('BiocManager')
BiocManager::install('EnhancedVolcano')

sufficient to bring the package up to date, or is:

devtools::install_github('kevinblighe/EnhancedVolcano')

better?

0
Entering edit mode

I do not know which version of R you are using. Can you share the output of sessionInfo()?

Technically speaking, devtools::install_github('kevinblighe/EnhancedVolcano') will install the most updated version, but this will not solve the general issue of you using an old version of R. Some users cannot update their version for various reasons, like software installation being controlled centrally by IT Services, or something like this.

Can you please share the output of sessionInfo() after you have also loaded EnhancedVolcano via library()?

0
Entering edit mode

Yes here it is:

> sessionInfo()
R version 3.5.2 (2018-12-20)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS  10.15.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] EnhancedVolcano_1.0.1  calibrate_1.7.7        MASS_7.3-51.5          forcats_0.5.0          purrr_0.3.3            readr_1.3.1
[7] tibble_3.0.0           tidyverse_1.3.0        ggrepel_0.8.2          directlabels_2020.6.17 WGCNA_1.69             fastcluster_1.1.25
[13] dynamicTreeCut_1.63-1  data.table_1.12.8      broom_0.7.0            stringr_1.4.0          reshape2_1.4.4         gridExtra_2.3
[19] magrittr_1.5           tidyr_1.0.2            dplyr_0.8.5            ggplot2_3.3.2
0
Entering edit mode

I see, you may want to upgrade your version of R to version 4.0.x, which will also, in turn, upgrade all of your packages. The version of EnhancedVolcano that you're using is the very first official release.

0
Entering edit mode

OK.

Is there a reason why certain lines are giving me errors?

I just tried to install the latest Enhanced Volcano in Rstudio, and continue to get:

devtools::install_github('kevinblighe/EnhancedVolcano')

...

Error: Failed to install 'EnhancedVolcano' from GitHub:
(converted from warning) installation of package ‘ps’ had non-zero exit status

I also downloaded R-4.2.0 and downloaded EnhancedVolcano using devtools in R (not studio), which worked, but am still getting an error - this time with the legend = c("custom legend") line.

In R, this time it says 

"argument 14 matches multiple formal arguments"

, whereas before the error was

"unused arguments..."

and argument 14 was not an issue.

Every R and Rstudio version is the latest release.

0
Entering edit mode

Thank you for taking time to upgrade your R version. Now the issue is back in my court because, between version 1.0.1 and the current version, I changed some parameter names and general functionality (I am the maintainer of this packge)

Can you take a look at the current official vignette in order to get a feel of the correct parameters to use? - https://bioconductor.org/packages/release/bioc/vignettes/EnhancedVolcano/inst/doc/EnhancedVolcano.html

For all intents and purposes, I think that you just need to change this:

legend=c("NS","Log2 FC > |0.3|","FDR < 0.2","FDR < 0.2 & Log2 FC > |0.3|")

...to:

legendLabels = c("NS","Log2 FC > |0.3|","FDR < 0.2","FDR < 0.2 & Log2 FC > |0.3|")
0
Entering edit mode

Ah OK thank you!

I see the modified parameters in the latest vignette.

Last question - Is there a reason why I can't load the latest version of EnhancedVolcano in Rstudio, only in R?

0
Entering edit mode

What is the error message when you try to load it in RStudio?

0
Entering edit mode

When I use devtools, it stops at this step and the most updated commands do not work, so I don't think EnhancedVolcano successfully loads.

* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/ggrastr’
Error: Failed to install 'EnhancedVolcano' from GitHub:
(converted from warning) installation of package ‘ggrastr’ had non-zero exit status
0
Entering edit mode

Strange. What happens when you try to first install ggrastr?

BiocManager::install('ggrastr')
0
Entering edit mode

Ugh still not working.

And now it's giving me a different package error with 'ps' (instead of 'ggrastr') after I tried to install it after receiving this message.

Beginning to think it's not due to a specific package but some communication error.

ERROR: compilation failed for package ‘ps’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/ps’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/ps’
Error: Failed to install 'EnhancedVolcano' from GitHub:
(converted from warning) installation of package ‘ps’ had non-zero exit status
0
Entering edit mode

Getting stranger. As you have updated your R version, though, you may have to do some 're-compiling'. Could you try this in order to re-compile the package on your OS:

BiocManager::install('EnhancedVolcano', type = "source", checkBuilt = TRUE)

Another option is to try to install direct from GitHub:

devtools::install_github('kevinblighe/EnhancedVolcano')

...or:

remotes::install_github('kevinblighe/EnhancedVolcano')
0
Entering edit mode

Hi Kevin,

Back at EnhancedVolcano plotting again, and I can't escape the

Warning message:
ggrepel: 8 unlabeled data points (too many overlaps). Consider increasing max.overlaps

Using the above code and modifications, is there a clear reason why this is happening?

0
Entering edit mode

Hi, I cannot see which code you are running? It can be inferred from the warning message that the plot is nevertheless generated. Is it malformed in any way?

0
Entering edit mode

remotes::install_github('kevinblighe/EnhancedVolcano')

EnhancedVolcano(df1,
lab = row.names(df1),
x = "log2FC",
ylab = bquote(~-Log[10]~italic(FDR)),
title = "Volcano Plot",
pCutoff = 0.2,
FCcutoff = 0.3,
legendPosition = "right",
pointSize = c(ifelse(df1\$log2FC > 0.3, 8, 1)),
labSize = 4.0,
col=c("black", "orange", "blue", "red"),
legendLabels=c("NS","Log2 FC > |0.3|","FDR < 0.2","FDR < 0.2 & Log2 FC > |0.3|"),
drawConnectors = TRUE,
ylim = c(0,-log10(10e-4))
)
0
Entering edit mode

Thanks, but the plot still generates fine, is this correct? The warning message is deriving from ggrepel, a package used by EnhancedVolcano, and merely indicates that, at one specific location in the plot, there are too many variables (genes) that need to be labeled that can be feasibly labeled (I think). You can just ignore this warning.

0
Entering edit mode

Just realized the plot was only generating when I zoomed into the plot, so now I see it.

Last issue:

How can I increase the point (gene) label size?

The labSize = 4 parameter is generating

Error in EnhancedVolcano(df1, lab = row.names(df1), x = "log2FC", y = "Age.Adjusted.FDR",  :
formal argument "labSize" matched by multiple actual arguments

And I have not been able to sort out why it is matching to multiple arguments.

0
Entering edit mode

Please check the manual page for the version of the package that you are using. Some of the parameter names changed in the early versions of this package.

Try ?EnhancedVolcano

0
Entering edit mode

I've looked and labSize = is the parameter for my version. But I can also let this go unless I get pushback from a journal.

Thank you for all the help!