The ZINBA code was written before C++11, which is when hash was added to the standard library, and so the authors used the g++ extension instead. Based on your output, the compiler is using C++11 (or later), so it has two versions of the class hash available and can't figure out which to use.
Quick Fix
You can temporarily direct the compiler to use a specific C++ version for installation using withr::makevars. Try
library(withr)
with_makevars(c(CXXFLAGS = "-std=gnu++98"), install.packages("zinba_2.03.1.tar.gz", repos = NULL))
Long Game
I hit different errors than you on both OS X (clang) and Linux (g++), so expect to hack on the code to get it working (I started to last year, but had other priorities). A more permanent workaround for your issue is to untar/zip the archive and add a Makevars file to the zinba/src directory containing the line:
PKG_CXXFLAGS = -std=gnu++98
Leave the source unzipped and install with install.packages("your/path/to/zinba", repos = NULL, type = "source").
I added code markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below:
Gave it a try and had the same error. Do you really need this peak caller? Except the original ATAC-seq paper, no one seems to use it for ATAC peak calling anymore. Even the first author said in the ATAC community once that they used it only because the second author was involved in Zinba development and therefore had expertise with it. After he left, they started using MACS (like everyone else now) because it is more straight-forward, still maintained and performs well.
Given that you have a typical paired-end dataset in bam format that has already been deduplicated, use:
Thank you for your answer. Actually I need Zinba to make a comparison between few peak calkers on my data set. But I also use MACS in my study. So I need to install Zinba...
Hello @anais1386, can you run
systemInfo()in your R terminal and paste the output to help us understand the issue ? Thanks you in advance.sysname : release
"Linux" : "3.10.0-693.17.1.el7.x86_64
version : nodename
"#1 SMP Thu Jan 25 20:13:58 UTC 2018" : "nic50"
machine: login
"x86_64" : "amontois"
user : effective_user
"amontois" : "amontois"
Hi anais1396,
I has come across the same problem as yours and tried the "Quick Fix" method. Unfortunately, the error keeps the same:
My R version is 3.5.0.
How can I solve this problem? Thanks in advance.
Please use
ADD COMMENTorADD REPLYto answer to previous reactions, as such this thread remains logically structured and easy to follow. I have now moved your reaction but as you can see it's not optimal. Adding an answer should only be used for providing a solution to the question asked.I added code markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below:
You are kindly informed, I will use those buttons latter.
Could you include some of the lines before the error? Specifically, it is useful to see the call to the compiler that generated the error and not just the error. This would help to both verify that the
-std=gnu++98is properly included and provide us insight into what compiler you're using and the associated includes.Also, do you get the same error when trying to install
zinba_2.03.1.tar.gz? I think that is the version @anais1396 got working.Thanks for your reply. I changed my R to version 3.2.3. Finally, it works.