hoffmangroup / segway

Application for semi-automated genomic annotation.
http://segway.hoffmanlab.org/
GNU General Public License v2.0
13 stars 7 forks source link

Unclear error message when using space-delimited segment table #17

Open EricR86 opened 10 years ago

EricR86 commented 10 years ago

Original report (BitBucket issue) by ajshaw (Bitbucket: ajshaw).


If the user specifies a segment table with --seg-table=FILE, and the file separates by spaces rather than tabs (text editors sometimes replace tabs with spaces automatically depending on their configurations), segway fails on an assertion error which does not make clear what the problem is. Depending on whether this is common, it may help users to suggest that this may be the problem.

Traceback (most recent call last):
  File "/mnt/work1/users/home2/ashaw/bin/segway", line 9, in <module>
    load_entry_point('segway==1.2.0.dev-rel889-hg992cc54de504', 'console_scripts', 'segway')()
  File "/mnt/work1/users/home2/ashaw/bin/lib/python2.7/site-packages/segway-1.2.0.dev_rel889_hg992cc54de504-py2.7.egg/segway/run.py", line 2537, in main
    return runner()
  File "/mnt/work1/users/home2/ashaw/bin/lib/python2.7/site-packages/segway-1.2.0.dev_rel889_hg992cc54de504-py2.7.egg/segway/run.py", line 2359, in __call__
    self.run(*args, **kwargs)
  File "/mnt/work1/users/home2/ashaw/bin/lib/python2.7/site-packages/segway-1.2.0.dev_rel889_hg992cc54de504-py2.7.egg/segway/run.py", line 2320, in run
    self.save_observations_params()
  File "/mnt/work1/users/home2/ashaw/bin/lib/python2.7/site-packages/segway-1.2.0.dev_rel889_hg992cc54de504-py2.7.egg/segway/run.py", line 1460, in save_observations_params
    self.save_include()
  File "/mnt/work1/users/home2/ashaw/bin/lib/python2.7/site-packages/segway-1.2.0.dev_rel889_hg992cc54de504-py2.7.egg/segway/run.py", line 1337, in save_include
    IncludeSaver(self)(self.gmtk_include_filename, aux_dirpath,
  File "/mnt/work1/users/home2/ashaw/bin/lib/python2.7/site-packages/segway-1.2.0.dev_rel889_hg992cc54de504-py2.7.egg/segway/_util.py", line 136, in __init__
    copy_attrs(runner, self, self.copy_attrs)
  File "/mnt/work1/users/home2/ashaw/bin/lib/python2.7/site-packages/segway-1.2.0.dev_rel889_hg992cc54de504-py2.7.egg/segway/_util.py", line 128, in copy_attrs
    setattr(dst, attr, getattr(src, attr))
  File "/mnt/work1/users/home2/ashaw/bin/lib/python2.7/site-packages/segway-1.2.0.dev_rel889_hg992cc54de504-py2.7.egg/segway/_util.py", line 465, in __get__
    res = self.fget(instance or owner)
  File "/mnt/work1/users/home2/ashaw/bin/lib/python2.7/site-packages/segway-1.2.0.dev_rel889_hg992cc54de504-py2.7.egg/segway/run.py", line 1064, in card_seg_countdown
    return self.seg_countdowns_initial.max() + 1
  File "/mnt/work1/users/home2/ashaw/bin/lib/python2.7/site-packages/segway-1.2.0.dev_rel889_hg992cc54de504-py2.7.egg/segway/_util.py", line 465, in __get__
    res = self.fget(instance or owner)
  File "/mnt/work1/users/home2/ashaw/bin/lib/python2.7/site-packages/segway-1.2.0.dev_rel889_hg992cc54de504-py2.7.egg/segway/run.py", line 1038, in seg_countdowns_initial
    table = self.seg_table
  File "/mnt/work1/users/home2/ashaw/bin/lib/python2.7/site-packages/segway-1.2.0.dev_rel889_hg992cc54de504-py2.7.egg/segway/_util.py", line 465, in __get__
    res = self.fget(instance or owner)
  File "/mnt/work1/users/home2/ashaw/bin/lib/python2.7/site-packages/segway-1.2.0.dev_rel889_hg992cc54de504-py2.7.egg/segway/run.py", line 808, in seg_table
    label = row["label"]
KeyError: 'label'
EricR86 commented 10 years ago

Original comment by Jay Hesselberth (Bitbucket: jayhesselberth, GitHub: jayhesselberth).


Yes this has happened to me and it took a while to track down. Would be nice if segway checked for an incorrect format and threw an early error.