Skip to content

Commit

Permalink
update bed tabix for new tabix
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuels committed Sep 8, 2018
1 parent 5b1e96f commit 3dfefac
Showing 1 changed file with 7 additions and 25 deletions.
32 changes: 7 additions & 25 deletions src/JBrowse/Store/SeqFeature/BEDTabix.js
Expand Up @@ -89,32 +89,14 @@ return declare( [ SeqFeatureStore, DeferredStatsMixin, DeferredFeaturesMixin, In

/**fetch and parse the Header line */
getHeader: function() {
var thisB = this;
return this._parsedHeader || ( this._parsedHeader = function() {
var d = new Deferred();
var reject = lang.hitch( d, 'reject' );

thisB.indexedData.indexLoaded.then( function() {
var maxFetch = thisB.indexedData.index.firstDataLine
? (thisB.indexedData.index.firstDataLine.block + thisB.indexedData.data.blockSize - 1) * 2
: null;

thisB.indexedData.data.read(
0,
maxFetch,
function( bytes ) {
thisB.parser.parseHeader( new Uint8Array( bytes ) );
d.resolve( thisB.header );
},
reject
);
},
reject
);

return d;
}.call(this));
if (!this._parsedHeader) {
this._parsedHeader = this.indexedData.featureCount('nonexistent')
.then(() => this.indexedData.getHeader())
.then(bytes => this.parser.parseHeader(bytes))
}
return this._parsedHeader
},

_getFeatures: function(query, featureCallback, finishCallback, errorCallback){
this.getHeader().then(() => {
this.indexedData.getLines(
Expand Down

0 comments on commit 3dfefac

Please sign in to comment.