ParBLiSS / FastANI

Fast Whole-Genome Similarity (ANI) Estimation
Apache License 2.0
368 stars 66 forks source link

Segmentation fault (core dumped) #32

Closed dineshkumarsrk closed 5 years ago

dineshkumarsrk commented 5 years ago

@ Cjain7 I have been successfully running fastANI tool for the past 5 months, it works fine and very useful for my comparative genome analysis. But recently I have been facing an error like "Segmentation fault (core dumped)" The exact error is written below as shown in linux terminal . Please help me to fix this issue. Thank you in advance

arvind@arvind:~/Documents/dinesh/fastANI/fastani-Linux64-v1.0$ ./fastANI -q query.txt -r 1.txt -o test.txt

Reference = [1.txt] Query = [query.txt] Kmer size = 16 Fragment length = 3000 ANI output file = test.txt

INFO, skch::Sketch::build, minimizers picked from reference = 0 INFO, skch::Sketch::index, unique minimizers = 0 Segmentation fault (core dumped)

cjain7 commented 5 years ago

Not sure what changed. I'll need more details to help:

Is it consistently failing on all inputs or just the specific input above? Also, what version of FastANI are you using (1.0 or 1.1)? Did you compile from source or directly downloaded the binary? Which operating system and compiler are you using?

At this point, I can only suggest you to try different input and also try re-installing fastANI from scratch.

dineshkumarsrk commented 5 years ago

Thank you cjain for your valuable help, please find the answers of your queries,

Is it consistently failing on all inputs or just the specific input above? Yeah, Its consistently failing on all inputs, even i tried with multiple genomes input list (as --ql and --rl input).

Also, what version of FastANI are you using (1.0 or 1.1)? Since beginning, I have been using version 1.0, while I faced the Core dumped issue, I tried version 1.1, but the result is same.

Did you compile from source or directly downloaded the binary? I have directly downloaded the binary.

Which operating system and compiler are you using? I have been using ubuntu 14.04 LTS OS

Even, I re-installed and tried in another ubuntu 14.04 LTS computer as well. but the same error i am getting.

cjain7 commented 5 years ago

I'll suggest two things here: 1) Try running fastANI on the two sample genomes provided in data folder and see what happens. This is to make sure there is no issue with your input data. 2) You could also try building fastANI from source code using the provided installation instructions.

dineshkumarsrk commented 5 years ago

Dear cjain, As you suggested, I have tried with two sample genomes provided in data folder but getting the same error. So, the input has no issue. I tried to build fastANI from source code using the provided installation procedure, while doing the same I am getting an error as given below, arvind@arvind:~/Documents/dinesh/ANI/FastANI-1.1$ ./configure --prefix=/home/arvind/gsl checking for g++... g++ checking whether the C++ compiler works... yes checking for C++ compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking for g++ option to support OpenMP... -fopenmp checking how to run the C++ preprocessor... g++ -E checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking zlib.h usability... yes checking zlib.h presence... yes checking for zlib.h... yes checking gsl/gsl_cdf.h usability... no checking gsl/gsl_cdf.h presence... no checking for gsl/gsl_cdf.h... no configure: error: GNU Scientific Library headers not found.

dineshkumarsrk commented 5 years ago

Dear cjain, I have successfully installed GNU scientific library(GSL) and boost c++ aswell. As you told I have installed fastANI from source code. however I am getting core dumped error as follows,

arvind@arvind:~/Documents/dinesh/ANI/FastANI-1.1$ ./configure --with-gsl=/home/arvind/gsl --with-boost=/home/arvind/mathlib checking for g++... g++ checking whether the C++ compiler works... yes checking for C++ compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking for g++ option to support OpenMP... -fopenmp checking how to run the C++ preprocessor... g++ -E checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking zlib.h usability... yes checking zlib.h presence... yes checking for zlib.h... yes checking boost/math/distributions/binomial.hpp usability... yes checking boost/math/distributions/binomial.hpp presence... yes checking for boost/math/distributions/binomial.hpp... yes configure: creating ./config.status config.status: creating Makefile arvind@arvind:~/Documents/dinesh/ANI/FastANI-1.1$ ./fastANI -r r.txt -q q.txt -o out.txt

Reference = [r.txt] Query = [q.txt] Kmer size = 16 Fragment length = 3000 Threads = 1 ANI output file = out.txt

INFO [thread 0], skch::Sketch::build, minimizers picked from reference = 0 INFO [thread 0], skch::Sketch::index, unique minimizers = 0 Segmentation fault (core dumped)

Please help me to fix this issue

cjain7 commented 5 years ago

From the config log, it seems like the build process was successful. Did you again try the two sample input genomes and got the same error? Sorry I don't have much clue here what's going on..

cjain7 commented 5 years ago

There are easy ways to figure out the reason of seg faults using gdb, but that requires some knowledge of gdb.

patflick commented 5 years ago

if you don't know how to use gdb, can you try prepending your command with this and post the output:

gdb -batch -ex "run" -ex "bt" --args

i.e., run the following command in the same folder and post what you get:

gdb -batch -ex "run" -ex "bt" --args ./fastANI -r r.txt -q q.txt -o out.txt
dineshkumarsrk commented 5 years ago

@cjain7 , I have tried with sample genome (single genome), it works well. But when I tried to run multiple sample (List option), I am getting a new type of error like "Validate input file".

dineshkumarsrk commented 5 years ago

@patflick , I would let you know after running the same. Thank you for your valuable help.

cjain7 commented 5 years ago

Based on your latest response, it seems like the code is running fine now and it's mostly the issue with your input file. With the list option, make sure that i) your input file's format is correct according to our specified documentation and, ii) each genome path in this file is correct.

dineshkumarsrk commented 5 years ago

Dear cjain, Still I am facing the issue with list option, please see the error as given below. Please help me to fix it. arvind@arvind-Precision-WorkStation-T7500:~/Documents/dinesh/fastANI/fastani-Linux64-v1.0$ ./fastANI -r data/xap_119.fasta -q data/Xanthomonas_citri_pv_malvacearum_X18.fasta -o x.txt

Reference = [data/xap_119.fasta] Query = [data/Xanthomonas_citri_pv_malvacearum_X18.fasta] Kmer size = 16 Fragment length = 3000 ANI output file = x.txt

INFO, skch::Sketch::build, minimizers picked from reference = 398823 INFO, skch::Sketch::index, unique minimizers = 388043 INFO, skch::Sketch::computeFreqHist, Frequency histogram of minimizers = (1, 379741) ... (106, 2) INFO, skch::Sketch::computeFreqHist, With threshold 0.001%, ignore minimizers occurring >= 105 times during lookup. INFO, skch::main, Time spent sketching the reference : 0.563931 sec INFO, skch::main, Time spent mapping fragments in query #1 : 1.49721 sec INFO, skch::main, Time spent post mapping : 0.000341588 sec arvind@arvind-Precision-WorkStation-T7500:~/Documents/dinesh/fastANI/fastani-Linux64-v1.0$ ./fastANI --rl r1.txt --ql query.txt -o xn.txt

Reference = [/home/arvind/Documents/dinesh/fastANI/data/Xap_121.fasta, /home/arvind/Documents/dinesh/fastANI/data/xap_lmg859.fasta] Query = [/home/arvind/Documents/dinesh/fastANI/data/Xanthomonas_citri_pv_malvacearum_X18.fasta, /home/arvind/Documents/dinesh/fastANI/data/xap_119.fasta, ] Kmer size = 16 Fragment length = 3000 ANI output file = xn.txt

ERROR, skch::validateInputFiles, Could not open

cjain7 commented 5 years ago

Can you share your input files here which you were trying? r1.txt and query.txt

dineshkumarsrk commented 5 years ago

Dear cjain, Thank you for your continuous help and guidance. The issue, which i faced because of my server internal problem. Now everything working perfectly.

DanielleMStevens commented 3 years ago

Hi,

I'm not sure what the cause is, but it seems like I'm getting the same error. Normally I get this error when I don't have enough memory but usign htop and free -m, it seems like I do.

Output from free -m: ❯ free -m total used free shared buff/cache available Mem: 64334 13109 6467 311 44758 50210 Swap: 2047 4 2043 (ani_env)

Any other ideas on how to get past this error. It's weird though since I have an automated script to prep, run, and plot fastANI (from conda) and it was running great a few month ago.

For reference, I'm trying to run all-by-all comparisons on 1007 bacterial genomes from NCBI that range from 3 to 6 million base pairs in size. I have a 64 Gb, Ubuntu (18.04) computer I'm running it on.

Here's the error below: ❯ fastANI -r ./MAMP_diversification_ANI_file.txt -q ./MAMP_diversification_ANI_file.txt -o ANI_analysis

Reference = [./MAMP_diversification_ANI_file.txt] Query = [./MAMP_diversification_ANI_file.txt] Kmer size = 16 Fragment length = 3000 Threads = 1 ANI output file = ANI_analysis

INFO [thread 0], skch::main, Count of threads executing parallel_for : 1 INFO [thread 0], skch::Sketch::build, window size for minimizer sampling = 24 INFO [thread 0], skch::Sketch::build, minimizers picked from reference = 0 INFO [thread 0], skch::Sketch::index, unique minimizers = 0 INFO [thread 0], skch::Sketch::computeFreqHist, Frequency histogram of minimizers = (0, 0) ... [1] 12302 segmentation fault (core dumped) fastANI -r ./MAMP_diversification_ANI_file.txt -q -o ANI_analysis (ani_env)

Thought? Thank you so much in advance!!

cjain7 commented 3 years ago

Is MAMP_diversification_ANI_file.txt a genome or a list of genomes? You may want to use --rl, --ql instead of -r and -q if this is a list

DanielleMStevens commented 3 years ago

Hi cjain,

Yes, it's a list of paths of genomes. But you are totally right! Not sure why I never updated my script, but swapping the tags for --rl and --ql fixed it. Thanks so much for the speedy reply. Hopefully, if someone else ever runs into this error, they'll see this thread in the future.

Thannks again!!