GATB / bcalm

compacted de Bruijn graph construction in low memory
MIT License
99 stars 20 forks source link

Improve error message for bad fasta input #64

Open pashadag opened 4 years ago

pashadag commented 4 years ago

BCALM doesn't crash nicely when the input is an incorrect fasta file. The current error message is:

>cat blin.fa
adfad
> bcalm -in blin.fa -kmer-size 3
BCALM 2, git commit e9ba83c
setting storage type to hdf5
HDF5-DIAG: Error detected in HDF5 (1.8.18) thread 0:
  #000: /home/pzm11/research/software/bcalm/gatb-core/gatb-core/thirdparty/hdf5/src/H5F.c line 604 in H5Fopen(): unable to open file
....
EXCEPTION: Unable to open bank 'blin.fa' (if it is a list of files, perhaps some of the files inside don't exist)

The error message could be improved to suggest that a possible reason for this exception is an improperly formatted fasta file.

rchikhi commented 4 years ago

I appreciate the suggestion. This change requires digging deep into the FASTA and list-of-FASTA parsing of GATB, so I'd rather bundle it with a future change rather than digging now.