BIMSBbioinfo/janggu

Invalid interval bounds when creating from bigwig

Closed this issue · 3 comments

Hello,

I'm trying to encode some data from bigwig using a custom bed file as roi. I wonder what may be causing the following problem:

File "/home/pedro.barbosa/software/miniconda3/envs/ml_genomics/lib/python3.7/site-packages/janggu/data/coverage.py", line 911, in create_from_bigwig
    verbose=verbose)
  File "/home/pedro.barbosa/software/miniconda3/envs/ml_genomics/lib/python3.7/site-packages/janggu/data/genomicarray.py", line 1191, in create_genomic_array
    verbose=verbose)
  File "/home/pedro.barbosa/software/miniconda3/envs/ml_genomics/lib/python3.7/site-packages/janggu/data/genomicarray.py", line 666, in __init__
    loader(self)
  File "/home/pedro.barbosa/software/miniconda3/envs/ml_genomics/lib/python3.7/site-packages/janggu/data/coverage.py", line 283, in __call__
    int(length)))
RuntimeError: Invalid interval bounds!

Is that some of the chromosome sizes in the bigwig file may be shorter than a given interval in the ROI?
Best,
Pedro

wkopp commented

Hi Pedro,

Did you use flank>0, by any chance?
In this case, janggu might have tried to load intervals beyond the chromosome size.

I have pushed a fix for this issue on github

pip install git+https://github.com/BIMSBbioinfo/janggu.git@master

Best,
Wolfgang

Hi Wolfgang,

Did you use flank>0, by any chance?

Sorry, I did not provide details on the setup. I didn't change flank argument. I wanted to extract single bp resolution coverage from a ROI file with many short intervals (e.g. 1bp, 2bp, 3bp). I set binsize and resolution to 1, collapser to None and flank to 0. I believe it's the correct configuration.

pip install git+https://github.com/BIMSBbioinfo/janggu.git@master

Thanks, I'll give it a try.
Best,
Pedro

The problem seems to be fixed, thanks @wkopp.