ablab / spades

SPAdes Genome Assembler
http://ablab.github.io/spades/
Other
750 stars 135 forks source link

metaviralSPAdes compilation failed #543

Closed aag1 closed 4 years ago

aag1 commented 4 years ago

Dear SPAdes team,

I am trying to install metaviralSPAdes using the following commands:

export LDFLAGS=-lrt

dir='metaviralSPAdes'
git clone -b 'metaviral_publication' https://github.com/ablab/spades.git ${dir}
cd ${dir}
./assembler/spades_compile.sh

Compilation reaches 100%:

[100%] Built target form_truealignments
[100%] Linking CXX executable ../../bin/spades-edge-profiles
[100%] Built target spades-edge-profiles

But fails with the following error message:

../../ext/samtools/libsamtools.a(bam_import.c.o):bam_import.c:function __bam_get_lines: error: undefined reference to 'gzopen64'
../../ext/samtools/libsamtools.a(bam_import.c.o):bam_import.c:function sam_header_read2: error: undefined reference to 'gzopen64'
../../ext/samtools/libsamtools.a(bam_import.c.o):bam_import.c:function sam_open: error: undefined reference to 'gzopen64'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/spades-corrector-core] Error 1
make[1]: *** [projects/corrector/CMakeFiles/spades-corrector-core.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [all] Error 2

Could you please advise if I can fix it somehow?

Kind regards, Anastasia

aag1 commented 4 years ago

P.S. Please find attached full compilation log: metaviralSPAdes_compilation.log

Dmitry-Antipov commented 4 years ago

If you wish to compile any of the SPAdes family tools including metaviralSPAdes you will need the following libraries to be pre-installed:

g++ (version 5.3.1 or higher) cmake (version 3.5 or higher) zlib libbz2

This error looks like you do not have zlib installed.

aag1 commented 4 years ago

Dear Dmitry,

Thank you very much for pointing me to zlib! There was indeed a problem with it (apparently I had two versions, zlib 1.2.3 and zlib 1.2.11, loaded simultaneously), and after I fixed it compilation advanced beyond the point of previous error.

Unfortunately, after that the compilation failed with a new error message:

CMake Error at cmake_install.cmake:81 (file):
  file INSTALL cannot find
  "/PATH_TO_WORK_DIR/metaviralSPAdes/assembler/src/../manual.html".

make: *** [install] Error 1

Full compilation log: metaviralSPAdes_compilation2.log

Sorry for so many questions, but could you please advise if I can fix this new problem somehow?

Kind regards, Anastasia

Dmitry-Antipov commented 4 years ago

Oops - this is my fault. Please revert to previous revision, (git revert HEAD) prior to compiling.

aag1 commented 4 years ago

Thank you! I successfully reverted the last git commit.

Later, I faced a new problem: folders newly created during compilation were given wrong permissions on my server, resulting in compilation errors. I solved it by adding USE_SOURCE_PERMISSIONS to every install(DIRECTORY command in the following files:

assembler/src/CMakeLists.txt
assembler/src/projects/hammer/CMakeLists.txt
assembler/src/projects/ionhammer/CMakeLists.txt
assembler/src/projects/spades/CMakeLists.txt
assembler/src/spades_pipeline/CMakeLists.txt

After that, compilation run without error messages and bin/spades.py --test passed correctly.

There was no metaviralspades.py script or symlink in the bin/, so I created a symlink myself (ln -s spades.py metaviralspades.py). After that I was able to run bin/metaviralspades.py for a sample. Resulting files contigs.fasta and scaffolds.fasta were identical and contained 62 entries. The file K127/before_chromosome_removal.fasta contained 400,702 entries.

Could you please advise if my interpretation of the output is correct:

Kind regards, Anastasia

Dmitry-Antipov commented 4 years ago

Sorry, my fault again, thank you for noticing. With latest commit fixed this and previous issue. (Actually there is no need in metaviralspades.py script in /bin folder - usually run it from ./assembler/metaviralspades.py but still, it should be copied there also)

scaffolds.fasta contains the potential complete viral genomes K127/before_chromosome_removal.fasta contains all the assembled contigs

Yes, it is correct. However there can be some false-positives in potential complete viral sequences - can suggest to check with either viralverify (https://github.com/ablab/viralVerify ) or with recently released checkV tool

aag1 commented 4 years ago

Thank you very much!

Kind regards, Anastasia