AlexanderLabWHOI / EUKulele

Automatic eukaryotic taxonomic classification
MIT License
28 stars 7 forks source link

Uninformative error when given empty fasta file #39

Closed jlw-ecoevo closed 1 year ago

jlw-ecoevo commented 3 years ago

Hi! Recently I had eukulele fail on a job run on a large number of fasta files in a folder with the ambiguous error "Alignment did not complete successfully" (after running alignment successfully on many of the files). I checked the logs and they didn't report any errors I could find. It turned out that one of my fasta files was totally empty and this was causing the issue. Obviously the problem way my own - but would be great if eukulele threw a more informative error in this case (I checked for an empty fasta on a whim and got lucky).

akrinos commented 3 years ago

Thanks so much for brining this to my attention! I have had this issue when the program runs out of memory as well, so definitely something that needs improvement. Do you mind sharing what the issue that caused the program to terminate was?

tuck82er commented 2 years ago

Alignment did not complete successfully.

Here is some more info as has been discussed. I was actually looking for this exact sub, but somehow missed it!

The issue is that submitting any empty MAGs (for me it was as .faa files) seems to result in a failed run (for me using the HPC with our SLURM manager with 400GB memory). Maybe Diamond getting hung up and exiting due to insufficient memory?

Here is a snippet of the tail of that output for documentation:

Diamond process exited for sample 43. Diamond process exited for sample 0. Diamond process exited for sample 42. Diamond process exited for sample 38. Diamond process exited for sample 10. Diamond process exited for sample 58. Diamond process exited for sample 65. Alignment did not complete successfully.

After scrolling up a bit I also found this snippet, pointing to sample 87:

Diamond process exited for sample 74. Aligning sample 87... Diamond process exited for sample 87. Diamond did not complete successfully for sample 87 with rc code 1 Aligning sample 16... Diamond process exited for sample 80. Aligning sample 72... Diamond process exited for sample 57.

So I went and had a look at sample 87. Seemingly my Prodigal output had generated bin 87, which was totally empty. After deleting that bin and rerunning the program I was able to progress to the taxonomic estimation and visualization steps!

Testing for empty bins beforehand and alerting/preventing users from starting a run may be an easy way to deal with this issue. If you have a recommendation on where a more detailed log of the Diamond aligner might be stored in Eukulele I'd be happy to get the information on what exactly caused the hang up! I was not able to track down any other information. Just also happened to get lucky and check to see what was in the .faa file for my sample 87.

akrinos commented 2 years ago

Hi @tuck82er , thanks so much - this is helpful! Because of the parallelization of DIAMOND, it has been difficult for me to always get it to behave and send out a log, depending on where it fails. You're completely right that the error handling should be of a higher priority. I'm sure you looked in log/full_diamond_align_<sample>.err in the output folder? The check you describe is a great one, and should be something printed both in the main log and in the DIAMOND log regardless of where the program exits.