This is a test version of Biostars. For the public version, visit https://www.biostars.org.
CrossMap Error With BigWig Files

I am attempting to liftover coordinates of several files in BigWig format from mm10 to mm9 using CrossMap. Below is an example of the output I am receiving with any of my files.

 python ~/python-2.7.9/bin/CrossMap.py bigwig mm10ToMm9.over.chain.gz KO_merged.bw KO_mm9
    @ 2017-03-13 15:16:16: Read chain_file:  mm10ToMm9.over.chain.gz
    @ 2017-03-13 15:16:18: Liftover bigwig file: KO_merged.bw ==> KO_mm9.bgr
    @ 2017-03-13 15:16:18: Merging overlapped entries in bedGraph file ...
    @ 2017-03-13 15:16:18: Sorting bedGraph file:KO_mm9.bgr
    Traceback (most recent call last):
      File "/home/kasowitz/python-2.7.9/bin/CrossMap.py", line 1636, in <module>
        crossmap_wig_file(mapTree, in_file, out_file, sourceChromSizes, targetChromSizes, in_format = 'bigwig')
      File "/home/kasowitz/python-2.7.9/bin/CrossMap.py", line 1445, in crossmap_wig_file
        for (chr, start, end, score) in bgrMerge.merge(out_prefix + '.bgr'):
      File "/home/kasowitz/python-2.7.9/lib/python2.7/site-packages/cmmodule/bgrMerge.py", line 95, in merge
        (last_chr, last_start, last_end, last_score) = lines[-1].split()
    IndexError: list index out of range

The error looks like it is resulting from receiving an empty bgr file, but I am not sure whats happening to cause the liftover to fail before this step.

Thanks for any advice

crossmap

Hello I was wondering if you managed to find out what the issue was, I am having the same problem Thanks a lot

1 answer

I encountered same problem. I found the key is the chromosome names in my wig file are numbers only (1,2,3...), but are chr1, chr2... in xx.over.chain.gz. After I added "chr" in my wig files, this problem was solved.

But how did you change your bigwig file? Isn't it an executable file?

Log in to answer this question.