medvedevgroup / TwoPaCo

A fast constructor of the compressed de Bruijn graph from many genomes
Other
40 stars 10 forks source link

Problem building TwoPaCo in BioLinux #12

Closed jflot closed 7 years ago

jflot commented 7 years ago

Hi @ilyaminkin,

I am trying to install TwoPaCo in BioLinux. I first installed tbb using sudo apt-get install libtbb-dev, then did git clone https://github.com/medvedevgroup/TwoPaCo.git, cd TwoPaCo, mkdir build, cd build, cmake ../src then finally make. Here is the ouput I get: $ cmake ../src
-- The C compiler identification is GNU 4.8.4 -- The CXX compiler identification is GNU 4.8.4 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Configuring done -- Generating done -- Build files have been written to: /home/manager/Programmes/TwoPaCo/build

$ make Scanning dependencies of target graphdump [ 8%] Building CXX object graphdump/CMakeFiles/graphdump.dir/graphdump.cpp.o [ 16%] Building CXX object graphdump/CMakeFiles/graphdump.dir//common/dnachar.cpp.o [ 25%] Building CXX object graphdump/CMakeFiles/graphdump.dir//common/streamfastaparser.cpp.o In file included from /home/manager/Programmes/TwoPaCo/src/common/streamfastaparser.cpp:4:0: /home/manager/Programmes/TwoPaCo/src/common/streamfastaparser.h:179:3: error: ‘auto_ptr’ in namespace ‘std’ does not name a type std::autoptr parser; ^ /home/manager/Programmes/TwoPaCo/src/common/streamfastaparser.h: In constructor ‘TwoPaCo::ChrReader::ChrReader(const std::vector<std::basicstring >&)’: /home/manager/Programmes/TwoPaCo/src/common/streamfastaparser.h:145:5: error: ‘parser’ was not declared in this scope parser.reset(new TwoPaCo::StreamFastaParser(fileName[0])); ^ /home/manager/Programmes/TwoPaCo/src/common/streamfastaparser.h: In member function ‘bool TwoPaCo::ChrReader::NextChr(std::string&)’: /home/manager/Programmes/TwoPaCo/src/common/streamfastaparser.h:154:9: error: ‘parser’ was not declared in this scope if (parser_->ReadRecord()) ^ make[2]: [graphdump/CMakeFiles/graphdump.dir/__/common/streamfastaparser.cpp.o] Error 1 make[1]: [graphdump/CMakeFiles/graphdump.dir/all] Error 2 make: *** [all] Error 2

How can I solve this problem? Thanks a lot in advance for your help.

rob-p commented 7 years ago

Looks like the header <memory> is missing from either streamfastaparser.h or dnachar.h. Adding #include <memory> to one (or both) of these files should fix that.

jflot commented 7 years ago

Thanks, it solved my problem! I now can build the DBG and get a DOT output, but for some reason I cannot manage to get a GFA1 or GFA2 output. For instance, using the example.fa file provided with TwoPaCo, here is what happens: twopaco -f 20 -k 11 example.fa -o example.dbg works fine graphdump -f dot example.dbg -k 11 > example.dot also works fine but then if I type graphdump -f gfa1 -k 11 example.dbg -s example.fa > example_gfa1.gfa I get

terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc zsh: abort graphdump -f gfa1 -k 11 example.dbg -s example.fa > example_gfa1.gfa

iminkin commented 7 years ago

@jflot how much memory do you have? Generating GFA requires about 4GB of free memory regardless of the size of the input graph. It is a price to pay for the fast graph transition to segment=vertices output of GFA.

jflot commented 7 years ago

Indeed I was running TwoPaCo in a virtual machine with only 2GB RAM. I increased the amount of RAM to 5GB and now the GFA output works well, thanks a lot!