hoffmangroup / segway

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

Segway layered bed file output is not sorted and breaks --bigBed option #83

Closed EricR86 closed 8 years ago

EricR86 commented 8 years ago

Original report (BitBucket issue) by Eric Roberts (Bitbucket: ericr86, GitHub: ericr86).


For DOHH2 hg38 an identify run with --bigBed produces the following error:

/mnt/work1/users/hoffmangroup/segway-protocol/tmp/segwayT3I9eP.bed is not case-sensitive sorted at line 11.  Please use "sort -k1,1 -k2,2n" with LC_COLLATE=C,  or bedSort and try again.
Traceback (most recent call last):
  File "/mnt/work1/users/home2/eric.roberts/.local/bin/segway", line 9, in <module>
    load_entry_point('segway', 'console_scripts', 'segway')()
  File "/mnt/work1/users/home2/eric.roberts/segway/segway/run.py", line 2971, in main
    return runner()
  File "/mnt/work1/users/home2/eric.roberts/segway/segway/run.py", line 2764, in __call__
    self.run(*args, **kwargs)
  File "/mnt/work1/users/home2/eric.roberts/segway/segway/run.py", line 2755, in run
    self.run_identify_posterior()
  File "/mnt/work1/users/home2/eric.roberts/segway/segway/run.py", line 2663, in run_identify_posterior
    self.save_identify_posterior()
  File "/mnt/work1/users/home2/eric.roberts/segway/segway/run.py", line 2606, in save_identify_posterior
    IdentifySaver(self)(world)
  File "/mnt/work1/users/home2/eric.roberts/segway/segway/output.py", line 148, in __call__
    bigbed_outfilename=self.make_filename(self.bigbed_filename, world))
  File "/mnt/work1/users/home2/eric.roberts/segway/segway/layer.py", line 358, in layer
    segmentation.save(outfilename, bigbed_outfilename)
  File "/mnt/work1/users/home2/eric.roberts/segway/segway/layer.py", line 270, in save
    BEDTOBIGBED_PROG(bigbed_infilename, sizes_file.name, bigbed_outfilename)
  File "/mnt/work1/users/home2/eric.roberts/segway/segway/layer.py", line 270, in save
    BEDTOBIGBED_PROG(bigbed_infilename, sizes_file.name, bigbed_outfilename)
  File "/mnt/work1/software/python/2.7/lib/python2.7/site-packages/optbuild.py", line 81, in __call__
    return self.run(*args, **kwargs)
  File "/mnt/work1/software/python/2.7/lib/python2.7/site-packages/optbuild.py", line 212, in run
    self._getoutput(args, kwargs)
  File "/mnt/work1/software/python/2.7/lib/python2.7/site-packages/optbuild.py", line 194, in _getoutput
    stdin, stdout, stderr, cwd)
  File "/mnt/work1/software/python/2.7/lib/python2.7/site-packages/optbuild.py", line 157, in _popen
    _returncode_error_factory(cmdline, returncode, output, error)
  File "/mnt/work1/software/python/2.7/lib/python2.7/site-packages/optbuild.py", line 57, in _returncode_error_factory
    raise error_cls, (cmdline, returncode, output, error)
optbuild.ReturncodeError: bedToBigBed returned 255

bedToBigBed is correctly reporting this issue as evidenced by the segway.layered.bed.gz output:

$ zcat segway.layered.bed.gz | head -n 12 | nl
     1  track autoScale=off description="segway 10-label segmentation of H3K4me1, H3K4me3, H3K27ac, H3K27me3, CTCF" viewLimits=0:1 visibility=full name=segway.151388ae750c11e686895254004fdc17 itemRgb=on
     2  chr20_GL383577v2_alt    0       128386  0       1000    .       0       128386  27,158,119      2       1,1     0,128385
     3  chr20_GL383577v2_alt    0       128386  1       1000    .       0       128386  217,95,2        1       128386  0
     4  chr20_GL383577v2_alt    0       128386  2       1000    .       0       128386  117,112,179     2       1,1     0,128385
     5  chr20_GL383577v2_alt    0       128386  3       1000    .       0       128386  231,41,138      2       1,1     0,128385
     6  chr20_GL383577v2_alt    0       128386  4       1000    .       0       128386  102,166,30      2       1,1     0,128385
     7  chr20_GL383577v2_alt    0       128386  5       1000    .       0       128386  230,171,2       2       1,1     0,128385
     8  chr20_GL383577v2_alt    0       128386  6       1000    .       0       128386  166,118,29      2       1,1     0,128385
     9  chr20_GL383577v2_alt    0       128386  7       1000    .       0       128386  102,102,102     2       1,1     0,128385
    10  chr20_GL383577v2_alt    0       128386  8       1000    .       0       128386  27,158,119      2       1,1     0,128385
    11  chr20_GL383577v2_alt    0       128386  9       1000    .       0       128386  217,95,2        2       1,1     0,128385
    12  chr17_KI270861v1_alt    0       196688  0       1000    .       0       196688  27,158,119      2       1,1     0,196687
EricR86 commented 8 years ago

Original comment by Eric Roberts (Bitbucket: ericr86, GitHub: ericr86).


EricR86 commented 8 years ago

Original comment by Eric Roberts (Bitbucket: ericr86, GitHub: ericr86).


Fixed in Pull Request #62