Discussion:
[Gmod-gbrowse] Render error: illegal division by zero
Vaneet Lotay
2015-02-04 23:19:45 UTC
Permalink
I was trying to load several BigWig files from an external collaborator into our GBrowse and some of them displayed correctly while some of them couldn't display correctly due to an error. The ones that didn't load all came up with this error:

.....rendering error track: Illegal division by zero at /usr/local/share/perl5/Bio/Graphics/Glyph/wiggle_data.pm line 420. at /usr/local/lib64/perl5/Bio/Graphics/Browser2/Render.pm line 3693., referer: http://.....

I have successfully installed the Bio::DB::BigWig and Bio::DB::BigWigSet modules so there's nothing wrong there. Even if I change the glyph, the exact same error occurs except in that respective graph module instead of wiggle_data.pm. I unpacked some of these BigWig files to see their contents and it appears they more closely follow a bedGraph format as opposed to wiggle:

#bedGraph section Chr01:82-481773
Chr01 82 242 0.147608
Chr01 446 466 0.147608
Chr01 466 606 0.295216
Chr01 606 626 0.147608
Chr01 1267 1427 0.147608
Chr01 1782 1942 0.147608
Chr01 6055 6076 0.147608
Chr01 6076 6213 0.295216
.......

No header line is present in any of these files which is also weird as I thought that was required but it doesn't seem to affect the display of the other BigWig files which have an identical format underneath. I'm thinking it must be something in the content of the file but nothing obvious stands out and there isn't really a pattern to the files that do display and those that don't.

Please help if any of you have encountered this error before.

Thanks,

Vaneet
Timothy Parnell
2015-02-05 04:35:30 UTC
Permalink
Hi Vaneet,

Are you are using the latest version of Bio::Graphics (2.39 or from github)? The reason I ask is that there was some work on that section in the wiggle_data module year or more ago that pertained to bigWig files. There is a step there that could produce illegal division by zero if no data was present, but that is supposed to be checked before the division is even attempted. Which makes me wonder if faulty data is being returned from the bigWig file.

I have recently had an unusual experience with a particular bedGraph-formatted bigWig files and the bigWig perl adaptor. The values being returned made no sense compared to the actual input bedGraph text file. Reformatting the data as variableStep wig and then a new bigWig solved the error. I could also fix the error by re-downloading a recent copy of the UCSC source libraries (you can now simply download the userApps source file to do this) and recompiling the UCSC lib and then re-installing Bio::DB::BigFile using the new lib. UCSC has been committing some bug fixes to the bigWig code over the past year or so that might help. I was using an old version of UCSC code (290-ish) and the latest version (310) worked properly with my funny bigwig.

Some other things to try:

Run the UCSC utility bigWigInfo on you bigWig file. Include the -chroms option to make sure chromosome sizes are correct.

If you have a localized trouble spot, you can try using UCSC utilities bigWigSummary and bigWigAverageOverBed to check the values. Although in my experience with the bad bigWig file I mentioned above, the UCSC utilities returned valid values whereas the perl module did not. One additional way to test the perl module with your bigWig file would be to install the Bio::ToolBox package from CPAN (disclaimer: I am the author) and run the get_datasets program with a test bed file as input and your bigWig file as data, and see whether what you get out makes sense.

Since you have a bedGraph text file, you could also try regenerating a new bigWig file using the latest version of bedGraphToBigWig. If the bigWig was made with old utilities (and UCSC does update their code), then a new bigWig might work.

Make sure none of the intervals overlap with each other. I don’t think bigWigs tolerate that, but doesn’t hurt to check anyway. Bedtools is your friend here.

Oh, by the way, bigWig files can be generated with fixedStep wig, variableStep wig, and bedGraph source text files. Track lines are not required and are now ignored (but early convertor utilities failed if you had a track line in there).

Hope these ideas help. Troubleshooting these things is not always easy.
Tim

On Feb 4, 2015, at 4:19 PM, Vaneet Lotay <***@ucalgary.ca<mailto:***@ucalgary.ca>> wrote:

I was trying to load several BigWig files from an external collaborator into our GBrowse and some of them displayed correctly while some of them couldn’t display correctly due to an error. The ones that didn’t load all came up with this error:

…..rendering error track: Illegal division by zero at /usr/local/share/perl5/Bio/Graphics/Glyph/wiggle_data.pm line 420. at /usr/local/lib64/perl5/Bio/Graphics/Browser2/Render.pm line 3693., referer: http://.....

I have successfully installed the Bio::DB::BigWig and Bio::DB::BigWigSet modules so there’s nothing wrong there. Even if I change the glyph, the exact same error occurs except in that respective graph module instead of wiggle_data.pm. I unpacked some of these BigWig files to see their contents and it appears they more closely follow a bedGraph format as opposed to wiggle:

#bedGraph section Chr01:82-481773
Chr01 82 242 0.147608
Chr01 446 466 0.147608
Chr01 466 606 0.295216
Chr01 606 626 0.147608
Chr01 1267 1427 0.147608
Chr01 1782 1942 0.147608
Chr01 6055 6076 0.147608
Chr01 6076 6213 0.295216
…….

No header line is present in any of these files which is also weird as I thought that was required but it doesn’t seem to affect the display of the other BigWig files which have an identical format underneath. I’m thinking it must be something in the content of the file but nothing obvious stands out and there isn’t really a pattern to the files that do display and those that don’t.

Please help if any of you have encountered this error before.

Thanks,

Vaneet
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now.http://goparallel.sourceforge.net/_______________________________________________
Gmod-gbrowse mailing list
Gmod-***@lists.sourceforge.net<mailto:Gmod-***@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse

Loading...