mjsull / chromatiblock

Colinear block visualisation tool
GNU General Public License v3.0
30 stars 4 forks source link

Provide more helpful error messages #4

Closed samnooij closed 4 years ago

samnooij commented 4 years ago

I have been trying to run your tool on some E. coli sequences and I ran into a few errors. (I am using Version: 0.3.0 installed with conda.)

The first is when I inserted a bunch of predicted plasmid contigs. They were quite different contigs and not everything could be aligned into a 'core genome'. However, the only message Chromatiblock provided was "IndexError: list index out of range" (see below). If you could provide a little message with a clue for the user what the actual problem could be and how to fix this, that would be much appreciated.

Traceback (most recent call last):
  File "/miniconda3/envs/chromatiblock/bin/Chromatiblock.py", line 1410, in <module>
    order_blocks_core(block_dict)
  File "/miniconda3/envs/chromatiblock/bin/Chromatiblock.py", line 668, in order_blocks_core
    if k.block == core_order[0][0]:
IndexError: list index out of range

The second error was with a set of whole genomes (scaffolds from a WGS experiment). Chromatiblock started collecting fasta sequences into the input.fasta file, but stopped halfway. It just stopped, without a warning. I found the message "fasta entry duplicated" in a log file, but when I checked the input files, there were no duplicate fasta header lines. Besides, Chromatiblock seems to just count the sequences (naming them 0_0, 0_1, 0_2, ... 0_n), so I don't see how a duplicate would be a problem in the end. Will it not just become one of those numbers to Chromatiblock? Anyway, in such a case it would be helpful to know what the duplicate is, and where to find it (what file it is in). (E.g. print 'fasta' and 'zename' in line 444 of Chromatiblock.py.) That would also help users prepare their files properly for Chromatiblock.

mjsull commented 4 years ago

It now prints a helpful error message if no core blocks are found.

Ideally it would work if there are no core blocks, as it might be good for some fringe cases.

I removed the requirement that contigs have unique headers when automated.

Thanks for your input.