Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/GMOD/jbrowse
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Derohanian committed Oct 4, 2012
2 parents afcd046 + a0644b7 commit bde5413
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
1 change: 0 additions & 1 deletion tests/data/SL2.40_all_rna_seq.v1.bigwig

This file was deleted.

43 changes: 21 additions & 22 deletions tests/js_tests/spec/BigWig.spec.js
@@ -1,7 +1,7 @@
require(['JBrowse/Store/BigWig','JBrowse/Model/XHRBlob'], function( BigWig, XHRBlob ) {
describe( 'BigWig with tomato RNAseq coverage', function() {
var b = new BigWig({
blob: new XHRBlob('../data/SL2.40_all_rna_seq.v1.bigwig')
blob: new XHRBlob('../../sample_data/raw/volvox/volvox_microarray.bw')
});

it('constructs', function(){ expect(b).toBeTruthy(); });
Expand All @@ -21,53 +21,52 @@ require(['JBrowse/Store/BigWig','JBrowse/Model/XHRBlob'], function( BigWig, XHRB
it('reads some good data unzoomed', function() {
var v = b.getUnzoomedView();
var wigData;
v.readWigData( 'SL2.40ch01', 1, 100000, function(features) {
v.readWigData( 'ctgA', 0, 10000, function(features) {
wigData = features;
});
waitsFor(function() { return wigData; },1000);
runs(function() {
expect(wigData.length).toBeGreaterThan(10000);
dojo.forEach( wigData.slice(0,20), function(feature) {
expect(wigData.length).toBeGreaterThan(100);
dojo.forEach( wigData.slice(1,20), function(feature) {
expect(feature.get('start')).toBeGreaterThan(0);
expect(feature.get('end')).toBeLessThan(100001);
expect(feature.get('end')).toBeLessThan(10000);
});
//console.log(wigData);
});
});

it('reads some good data when zoomed', function() {
var v = b.getView( 1/100000 );
it('reads some good data when zoomed out', function() {
var v = b.getView( 1/20000 );
var wigData;
v.readWigData( 'SL2.40ch01', 100000, 2000000, function(features) {
v.readWigData( 'ctgA', 100, 20000, function(features) {
wigData = features;
});
waitsFor(function() { return wigData; },1000);
waitsFor(function() { return wigData; },500);
runs(function() {
expect(wigData.length).toBeGreaterThan(19);
expect(wigData.length).toBeLessThan(100);
expect(wigData.length).toEqual(2);
dojo.forEach( wigData, function(feature) {
expect(feature.get('start')).toBeGreaterThan(80000);
expect(feature.get('end')).toBeLessThan(2050000);
expect(feature.get('start')).toBeGreaterThan( -1 );
expect(feature.get('end')).toBeLessThan( 40000 );
});
//console.log(wigData);
console.log(wigData);
});
});

it('reads the file stats (the totalSummary section)', function() {
var stats = b.getGlobalStats();
expect(stats.basesCovered).toEqual(141149153);
expect(stats.minVal).toEqual(1);
expect(stats.maxVal).toEqual(62066);
expect(stats.sumData).toEqual(16922295025);
expect(stats.sumSquares).toEqual(45582937421360);
expect(stats.stdDev).toEqual(555.4891087210976);
expect(stats.mean).toEqual(119.88945498666932);
expect(stats.basesCovered).toEqual(50690);
expect(stats.minVal).toEqual(100);
expect(stats.maxVal).toEqual(899);
expect(stats.sumData).toEqual(16863706);
expect(stats.sumSquares).toEqual(8911515204);
expect(stats.stdDev).toEqual(255.20080383762445);
expect(stats.mean).toEqual(332.6830933122904);
});

it('reads good data when zoomed very little', function() {
var v = b.getView( 1/17.34 );
var wigData;
v.readWigData( 'SL2.40ch01', 19999, 24999, function(features) {
v.readWigData( 'ctgA', 19999, 24999, function(features) {
wigData = features;
});
waitsFor(function() { return wigData; },1000);
Expand Down

0 comments on commit bde5413

Please sign in to comment.