-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #472 from akmorrow13/fix-variant-track
Fix for VariantTrack failing to parse strings as ints
- Loading branch information
Showing
7 changed files
with
71 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* @flow */ | ||
'use strict'; | ||
|
||
import {expect} from 'chai'; | ||
import Feature from '../../main/data/feature'; | ||
import _ from 'underscore'; | ||
import RemoteFile from '../../main/RemoteFile'; | ||
|
||
describe('Feature', function() { | ||
var json; | ||
|
||
before(function () { | ||
return new RemoteFile('/test-data/features.ga4gh.chr1.120000-125000.json').getAllString().then(data => { | ||
json = data; | ||
}); | ||
}); | ||
|
||
it('should parse features from GA4GH', function(done) { | ||
|
||
// parse json | ||
var parsedJson = JSON.parse(json); | ||
var features = _.values(parsedJson.features).map(feature => Feature.fromGA4GH(feature)); | ||
|
||
expect(features).to.have.length(9); | ||
expect(features[0].contig).to.equal("chr1"); | ||
expect(features[0].start).to.equal(89295); | ||
expect(features[0].stop).to.equal(120932); | ||
expect(features[0].id).to.equal("WyIxa2dlbm9tZXMiLCJnZW5jb2RlX3YyNGxpZnQzNyIsIjE0MDUwOTE3MjM1NDE5MiJd"); | ||
expect(features[0].score).to.equal(1000); | ||
done(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* @flow */ | ||
'use strict'; | ||
|
||
import {expect} from 'chai'; | ||
import {Variant} from '../../main/data/variant'; | ||
import _ from 'underscore'; | ||
import RemoteFile from '../../main/RemoteFile'; | ||
|
||
describe('Variant', function() { | ||
var json; | ||
|
||
before(function () { | ||
return new RemoteFile('/test-data/variants.ga4gh.chr1.10000-11000.json').getAllString().then(data => { | ||
json = data; | ||
}); | ||
}); | ||
|
||
it('should parse variants from GA4GH', function(done) { | ||
|
||
// parse json | ||
var parsedJson = JSON.parse(json); | ||
var variants = _.values(parsedJson.variants).map(variant => Variant.fromGA4GH(variant)); | ||
|
||
expect(variants).to.have.length(11); | ||
expect(variants[0].contig).to.equal("1"); | ||
expect(variants[0].position).to.equal(10176); | ||
expect(variants[0].ref).to.equal("A"); | ||
expect(variants[0].alt[0]).to.equal("AC"); | ||
done(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.