//>>built
require({cache:{"JBrowse/Store/TabixIndexedFile":function(){define("dojo/_base/declare dojo/_base/array JBrowse/Util JBrowse/Util/TextIterator JBrowse/Store/LRUCache JBrowse/Errors JBrowse/Model/XHRBlob JBrowse/Model/BGZip/BGZBlob JBrowse/Model/TabixIndex".split(" "),function(n,h,l,a,c,f,d,e,b){return n(null,{constructor:function(m){this.browser=m.browser;this.index=new b({blob:new e(m.tbi),browser:m.browser});this.data=new e(m.file);this.indexLoaded=this.index.load();this.chunkSizeLimit=m.chunkSizeLimit||
2E6},getLines:function(b,d,e,c,g,f){var a=this,t=Array.prototype.slice.call(arguments);this.indexLoaded.then(function(){a._fetch.apply(a,t)},f)},_fetch:function(b,d,e,c,g,a){a=a||function(b){console.error(b,b.stack)};var s=this.index.blocksForRange(b,d,e);if(s){s.toString=s.toUniqueString=function(){return this.join(", ")};for(var t=0;t<s.length;t++){var h=s[t].fetchedSize();if(h>this.chunkSizeLimit){a(new f.DataOverflow("Too much data. Chunk size "+l.commifyNumber(h)+" bytes exceeds chunkSizeLimit of "+
l.commifyNumber(this.chunkSizeLimit)+"."));return}}try{this._fetchChunkData(s,b,d,e,c,g,a)}catch(n){a(n)}}else a("Error in index fetch ("+[b,d,e].join()+")")},_fetchChunkData:function(b,d,e,q,g,a,f){if(b.length){var t=0,l=this.chunkCache=this.chunkCache||new c({name:"TabixIndexedFileChunkedCache",fillCallback:dojo.hitch(this,"_readChunkItems"),sizeFunction:function(b){return b.length},maxSize:1E5}),n=this.browser.regularizeReferenceName(d),r;h.forEach(b,function(d){l.get(d,function(d,p){p&&!r&&f(p);
if(!(r=r||p)){for(var c=0;c<d.length;c++){var h=d[c];if(h._regularizedRef==n)if(h.start>q)break;else h.end>=e&&g(h)}++t==b.length&&a()}})})}else a()},_readChunkItems:function(b,d){var e=this,c=[];e.data.read(b.minv.block,b.maxv.block-b.minv.block+1,function(b){b=new Uint8Array(b);b=new a.FromBytes({bytes:b,offset:0});try{e._parseItems(b,function(b){c.push(b)},function(){d(c)})}catch(m){d(null,m)}},function(b){d(null,b)})},_parseItems:function(b,d,e){for(var c=this,g=0;;)if(300>=g){var a=this.parseItem(b);
if(a)d(a),g++;else{e();break}}else{window.setTimeout(function(){c._parseItems(b,d,e)},1);break}},parseItem:function(b){var d=this.index.metaChar,e,c;do e=b.getline();while(e&&(e.charAt(0)==d||"\n"!=e.charAt(e.length-1)||!(c=this.tryParseLine(e))));return e&&c?c:null},tryParseLine:function(b){try{return this.parseLine(b)}catch(d){return null}},parseLine:function(b){b=b.split("\t");b[b.length-1]=b[b.length-1].replace(/\n$/,"");return{ref:b[this.index.columnNumbers.ref-1],_regularizedRef:this.browser.regularizeReferenceName(b[this.index.columnNumbers.ref-
1]),start:parseInt(b[this.index.columnNumbers.start-1]),end:parseInt(b[this.index.columnNumbers.end-1]),fields:b}}})})},"JBrowse/Model/BGZip/BGZBlob":function(){define(["dojo/_base/declare","jszlib/inflate","jszlib/arrayCopy"],function(n,h,l){var a=n(null,{constructor:function(c){this.blob=c},blockSize:65536,slice:function(c,f){return new a(this.blob.slice(c,f))},fetch:function(c,a){this.blob.fetch(this._wrap(c),a)},read:function(c,a,d,e){this.blob.read(c,a+this.blockSize,this._wrap(d,a),e)},_wrap:function(c,
a){var d=this;return function(e){c(d.unbgzf(e,a))}},readInt:function(c,a){return c[a+3]<<24|c[a+2]<<16|c[a+1]<<8|c[a]},readShort:function(c,a){return c[a+1]<<8|c[a]},readFloat:function(c,a){for(var d=new Uint8Array(4),e=0;4>e;e++)d[e]=c[a+e];return(new Float32Array(d.buffer))[0]},unbgzf:function(c,a){a=Math.min(a||Infinity,c.byteLength-27);for(var d=[],e=0,b=[0];b[0]<a;b[0]+=8){var m=new Uint8Array(c,b[0],18);if(!(31==m[0]&&139==m[1])){console.error("invalid BGZF block header, skipping",m);break}var m=
this.readShort(m,10),m=b[0]+12+m,p;try{p=h(c,m,c.byteLength-m,b)}catch(k){if(/^Z_BUF_ERROR/.test(k.statusString)&&d.length)break;else throw k;}p.byteLength&&(e+=p.byteLength,d.push(p))}if(1==d.length)return d[0];e=new Uint8Array(e);for(p=b=0;p<d.length;++p)m=new Uint8Array(d[p]),l(m,0,e,b,m.length),b+=m.length;return e.buffer}});return a})},"JBrowse/Model/TabixIndex":function(){define("dojo/_base/declare dojo/_base/array dojo/_base/Deferred JBrowse/has jDataView JBrowse/Util JBrowse/Model/BGZip/VirtualOffset".split(" "),
function(n,h,l,a,c,f,d){var e=f.fastDeclare({constructor:function(b,d,e){this.minv=b;this.maxv=d;this.bin=e},toUniqueString:function(){return this.minv+".."+this.maxv+" (bin "+this.bin+")"},toString:function(){return this.toUniqueString()},compareTo:function(b){return this.minv.compareTo(b.minv)||this.maxv.compareTo(b.maxv)||this.bin-b.bin},compare:function(b){return this.compareTo(b)},fetchedSize:function(){return this.maxv.block+65536-this.minv.block+1}});return n(null,{constructor:function(b){this.browser=
b.browser;this.blob=b.blob;this.load()},load:function(){var b=this;return this._loaded=this._loaded||function(){var d=new l;a("typed-arrays")?this.blob.fetch(function(e){b._parseIndex(e,d)},dojo.hitch(d,"reject")):d.reject("This web browser lacks support for JavaScript typed arrays.");return d}.call(this)},_parseIndex:function(b,m){this._littleEndian=!0;var a=new c(b,0,void 0,this._littleEndian);if(21578324!=a.getInt32()&&(this._littleEndian=!1,a=new c(b,0,void 0,this._littleEndian),21578324!=a.getInt32())){console.error("Not a TBI file");
m.reject("Not a TBI file");return}var k=a.getInt32();this.presetType=a.getInt32();this.columnNumbers={ref:a.getInt32(),start:a.getInt32(),end:a.getInt32()};this.metaChar=(this.metaValue=a.getInt32())?String.fromCharCode(this.metaValue):null;this.skipLines=a.getInt32();this._refIDToName=Array(k);this._refNameToID={};var q=a.getInt32();this._parseNameBytes(a.getBytes(q,void 0,!1));this._indices=Array(k);for(q=0;q<k;++q){for(var g=a.getInt32(),f=this._indices[q]={binIndex:{}},s=0;s<g;++s){for(var h=
a.getInt32(),l=a.getInt32(),n=Array(l),r=0;r<l;++r){var u=new d(a.getBytes(8)),v=new d(a.getBytes(8));this._findFirstData(u);n[r]=new e(u,v,h)}f.binIndex[h]=n}g=a.getInt32();f=f.linearIndex=Array(g);for(r=0;r<g;++r)f[r]=new d(a.getBytes(8)),this._findFirstData(f[r])}m.resolve({success:!0})},_findFirstData:function(b){var d=this.firstDataLine;this.firstDataLine=d?0<d.compareTo(b)?b:d:b},_parseNameBytes:function(b){function d(){var e=b[a++];return e?String.fromCharCode(e):null}function e(){for(var b,
a="";b=d();)a+=b;return a.length?a:null}for(var a=0,c,g=0;c=e();g++)this._refIDToName[g]=c,this._refNameToID[this.browser.regularizeReferenceName(c)]=g},hasRefSeq:function(b,d,e){var a=this;b=a.browser.regularizeReferenceName(b);a.load().then(function(){b in a._refNameToID?d(!0):d(!1)})},getRefId:function(b){b=this.browser.regularizeReferenceName(b);return this._refNameToID[b]},TAD_LIDX_SHIFT:14,blocksForRange:function(b,a,c){0>a&&(a=0);b=this.getRefId(b);b=this._indices[b];if(!b)return[];var k=b.linearIndex;
b=b.binIndex;c=this._reg2bins(a,c);var q=k.length?k[a>>this.TAD_LIDX_SHIFT>=k.length?k.length-1:a>>this.TAD_LIDX_SHIFT]:new d(0,0);for(a=k=0;a<c.length;++a)k+=(b[c[a]]||[]).length;if(0==k)return[];var g=[],f;for(a=k=0;a<c.length;++a)if(f=b[c[a]])for(var h=0;h<f.length;++h)0>q.compareTo(f[h].maxv)&&(g[k++]=new e(f[h].minv,f[h].maxv,f[h].bin));if(!g.length)return[];g=g.sort(function(b,d){return b.compareTo(d)});a=1;for(b=0;a<k;++a)0>g[b].maxv.compareTo(g[a].maxv)&&(++b,g[b].minv=g[a].minv,g[b].maxv=
g[a].maxv);k=b+1;for(a=1;a<k;++a)0<=g[a-1].maxv.compareTo(g[a].minv)&&(g[a-1].maxv=g[a].minv);a=1;for(b=0;a<k;++a)g[b].maxv.block!=g[a].minv.block&&(++b,g[b].minv=g[a].minv),g[b].maxv=g[a].maxv;return g.slice(0,b+1)},_reg2bin:function(b,d){--d;return b>>14==d>>14?4681+(b>>14):b>>17==d>>17?585+(b>>17):b>>20==d>>20?73+(b>>20):b>>23==d>>23?9+(b>>23):b>>26==d>>26?1+(b>>26):0},_reg2bins:function(b,d){var a,e=[];--d;e.push(0);for(a=1+(b>>26);a<=1+(d>>26);++a)e.push(a);for(a=9+(b>>23);a<=9+(d>>23);++a)e.push(a);
for(a=73+(b>>20);a<=73+(d>>20);++a)e.push(a);for(a=585+(b>>17);a<=585+(d>>17);++a)e.push(a);for(a=4681+(b>>14);a<=4681+(d>>14);++a)e.push(a);return e}})})},"jDataView/jdataview":function(){define([],function(){var n={};(function(h){var l={ArrayBuffer:"undefined"!==typeof ArrayBuffer,DataView:"undefined"!==typeof DataView&&("getFloat64"in DataView.prototype||"getFloat64"in new DataView(new ArrayBuffer(1))),NodeBuffer:"undefined"!==typeof Buffer&&"readInt16LE"in Buffer.prototype},a={Int8:1,Int16:2,
Int32:4,Uint8:1,Uint16:2,Uint32:4,Float32:4,Float64:8},c={Int8:"Int8",Int16:"Int16",Int32:"Int32",Uint8:"UInt8",Uint16:"UInt16",Uint32:"UInt32",Float32:"Float",Float64:"Double"},f=function(d,e,b,m){if(!(this instanceof f))throw Error("jDataView constructor may not be called as a function");this.buffer=d;if(!(l.NodeBuffer&&d instanceof Buffer)&&!(l.ArrayBuffer&&d instanceof ArrayBuffer)&&"string"!==typeof d)throw new TypeError("jDataView buffer has an incompatible type");this._isArrayBuffer=l.ArrayBuffer&&
d instanceof ArrayBuffer;this._isDataView=l.DataView&&this._isArrayBuffer;this._isNodeBuffer=l.NodeBuffer&&d instanceof Buffer;this._littleEndian=Boolean(m);var p=this._isArrayBuffer?d.byteLength:d.length;void 0===e&&(e=0);this.byteOffset=e;void 0===b&&(b=p-e);this.byteLength=b;if(!this._isDataView){if("number"!==typeof e)throw new TypeError("jDataView byteOffset is not a number");if("number"!==typeof b)throw new TypeError("jDataView byteLength is not a number");if(0>e)throw Error("jDataView byteOffset is negative");
if(0>b)throw Error("jDataView byteLength is negative");}this._isDataView&&(this._view=new DataView(d,e,b),this._start=0);this._start=e;if(e+b>p)throw Error("jDataView (byteOffset + byteLength) value is out of bounds");this._offset=0;if(this._isDataView)for(var k in a)a.hasOwnProperty(k)&&function(b,d){var e=a[b];d["get"+b]=function(a,c){void 0===c&&(c=d._littleEndian);void 0===a&&(a=d._offset);d._offset=a+e;return d._view["get"+b](a,c)}}(k,this);else if(this._isNodeBuffer&&l.NodeBuffer)for(k in a)a.hasOwnProperty(k)&&
function(b,d,e){var c=a[b];d["get"+b]=function(b,a){void 0===b&&(b=d._offset);d._offset=b+c;return d.buffer[e](d._start+b)}}(k,this,"Int8"===k||"Uint8"===k?"read"+c[k]:m?"read"+c[k]+"LE":"read"+c[k]+"BE");else for(k in a)a.hasOwnProperty(k)&&function(b,d){var e=a[b];d["get"+b]=function(a,c){void 0===c&&(c=d._littleEndian);void 0===a&&(a=d._offset);d._offset=a+e;if(d._isArrayBuffer&&0===(d._start+a)%e&&(1===e||c))return(new h[b+"Array"](d.buffer,d._start+a,1))[0];if("number"!==typeof a)throw new TypeError("jDataView byteOffset is not a number");
if(a+e>d.byteLength)throw Error("jDataView (byteOffset + size) value is out of bounds");return d["_get"+b](d._start+a,c)}}(k,this)};f.createBuffer=l.NodeBuffer?function(){return new Buffer(arguments)}:l.ArrayBuffer?function(){return(new Uint8Array(arguments)).buffer}:function(){return String.fromCharCode.apply(null,arguments)};f.prototype={compatibility:l,_getBytes:function(d,a,b){var c;void 0===b&&(b=this._littleEndian);void 0===a&&(a=this._offset);if("number"!==typeof a)throw new TypeError("jDataView byteOffset is not a number");
if(0>d||a+d>this.byteLength)throw Error("jDataView length or (byteOffset+length) value is out of bounds");a+=this._start;this._isArrayBuffer?c=new Uint8Array(this.buffer,a,d):(c=this.buffer.slice(a,a+d),this._isNodeBuffer||(c=Array.prototype.map.call(c,function(b){return b.charCodeAt(0)&255})));b&&1<d&&(c instanceof Array||(c=Array.prototype.slice.call(c)),c.reverse());this._offset=a-this._start+d;return c},getBytes:function(d,a,b){var c=this._getBytes.apply(this,arguments);c instanceof Array||(c=
Array.prototype.slice.call(c));return c},getString:function(d,a){var b;if(this._isNodeBuffer){void 0===a&&(a=this._offset);if("number"!==typeof a)throw new TypeError("jDataView byteOffset is not a number");if(0>d||a+d>this.byteLength)throw Error("jDataView length or (byteOffset+length) value is out of bounds");b=this.buffer.toString("ascii",this._start+a,this._start+a+d);this._offset=a+d}else b=String.fromCharCode.apply(null,this._getBytes(d,a,!1));return b},getChar:function(d){return this.getString(1,
d)},tell:function(){return this._offset},seek:function(d){if("number"!==typeof d)throw new TypeError("jDataView byteOffset is not a number");if(0>d||d>this.byteLength)throw Error("jDataView byteOffset value is out of bounds");return this._offset=d},_getFloat64:function(d,a){var b=this._getBytes(8,d,a),c=1-2*(b[0]>>7),f=((b[0]<<1&255)<<3|b[1]>>4)-(Math.pow(2,10)-1),b=(b[1]&15)*Math.pow(2,48)+b[2]*Math.pow(2,40)+b[3]*Math.pow(2,32)+b[4]*Math.pow(2,24)+b[5]*Math.pow(2,16)+b[6]*Math.pow(2,8)+b[7];return 1024===
f?0!==b?NaN:Infinity*c:-1023===f?c*b*Math.pow(2,-1074):c*(1+b*Math.pow(2,-52))*Math.pow(2,f)},_getFloat32:function(a,c){var b=this._getBytes(4,a,c),f=1-2*(b[0]>>7),h=(b[0]<<1&255|b[1]>>7)-127,b=(b[1]&127)<<16|b[2]<<8|b[3];return 128===h?0!==b?NaN:Infinity*f:-127===h?f*b*Math.pow(2,-149):f*(1+b*Math.pow(2,-23))*Math.pow(2,h)},_getInt32:function(a,c){var b=this._getUint32(a,c);return b>Math.pow(2,31)-1?b-Math.pow(2,32):b},_getUint32:function(a,c){var b=this._getBytes(4,a,c);return b[0]*Math.pow(2,24)+
(b[1]<<16)+(b[2]<<8)+b[3]},_getInt16:function(a,c){var b=this._getUint16(a,c);return b>Math.pow(2,15)-1?b-Math.pow(2,16):b},_getUint16:function(a,c){var b=this._getBytes(2,a,c);return(b[0]<<8)+b[1]},_getInt8:function(a){a=this._getUint8(a);return a>Math.pow(2,7)-1?a-Math.pow(2,8):a},_getUint8:function(a){return this._getBytes(1,a)[0]}};"undefined"!==typeof jQuery&&"1.6.2"<=jQuery.fn.jquery&&(jQuery.ajaxSetup({converters:{"* dataview":function(a){return new f(a)}},accepts:{dataview:"text/plain; charset\x3dx-user-defined"},
responseHandler:{dataview:function(a,c,b){if("mozResponseArrayBuffer"in b)a.text=b.mozResponseArrayBuffer;else if("responseType"in b&&"arraybuffer"===b.responseType&&b.response)a.text=b.response;else if("responseBody"in b){c=b.responseBody;var f;try{f=IEBinaryToArray_ByteStr(c)}catch(h){window.execScript("Function IEBinaryToArray_ByteStr(Binary)\r\n\tIEBinaryToArray_ByteStr \x3d CStr(Binary)\r\nEnd Function\r\nFunction IEBinaryToArray_ByteStr_Last(Binary)\r\n\tDim lastIndex\r\n\tlastIndex \x3d LenB(Binary)\r\n\tif lastIndex mod 2 Then\r\n\t\tIEBinaryToArray_ByteStr_Last \x3d AscB( MidB( Binary, lastIndex, 1 ) )\r\n\tElse\r\n\t\tIEBinaryToArray_ByteStr_Last \x3d -1\r\n\tEnd If\r\nEnd Function\r\n",
"vbscript"),f=IEBinaryToArray_ByteStr(c)}c=IEBinaryToArray_ByteStr_Last(c);b="";for(var k=0,q=f.length%8,g;k<q;)g=f.charCodeAt(k++),b+=String.fromCharCode(g&255,g>>8);for(q=f.length;k<q;)b+=String.fromCharCode((g=f.charCodeAt(k++),g&255),g>>8,(g=f.charCodeAt(k++),g&255),g>>8,(g=f.charCodeAt(k++),g&255),g>>8,(g=f.charCodeAt(k++),g&255),g>>8,(g=f.charCodeAt(k++),g&255),g>>8,(g=f.charCodeAt(k++),g&255),g>>8,(g=f.charCodeAt(k++),g&255),g>>8,(g=f.charCodeAt(k++),g&255),g>>8);-1<c&&(b+=String.fromCharCode(c));
a.text=b}else a.text=b.responseText}}}),jQuery.ajaxPrefilter("dataview",function(a,c,b){jQuery.support.ajaxResponseType&&(a.hasOwnProperty("xhrFields")||(a.xhrFields={}),a.xhrFields.responseType="arraybuffer");a.mimeType="text/plain; charset\x3dx-user-defined"}));h.jDataView=(h.module||{}).exports=f;"undefined"!==typeof module&&(module.exports=f)})(n);return n.jDataView})},"JBrowse/Model/BGZip/VirtualOffset":function(){define(["JBrowse/Util"],function(n){return n.fastDeclare({constructor:function(h,
l){2<=arguments.length?(this.block=h,this.offset=l):this._fromBytes(h)},_fromBytes:function(h,l){l=l||0;var a=1099511627776*h[l]+4294967296*h[l+1]+16777216*h[l+2]+65536*h[l+3]+256*h[l+4]+h[l+5],c=h[l+6]<<8|h[l+7];0==a&&0==c?this.block=this.offset=null:(this.block=a,this.offset=c)},toString:function(){return""+this.block+":"+this.offset},compareTo:function(h){return this.block-h.block||this.offset-h.offset},cmp:function(h){return this.compareTo(h)}})})},"JBrowse/Store/SeqFeature/GlobalStatsEstimationMixin":function(){define(["dojo/_base/declare",
"dojo/_base/array","dojo/Deferred","JBrowse/Errors"],function(n,h,l,a){return n(null,{_estimateGlobalStats:function(c){var f=new l;c=c||this.refSeq;var d=this.storeTimeout||3E3,e=new Date,b=function(a,b){var d=this,e=0.75*c.start+0.25*c.end,f=Math.max(0,Math.round(e-a/2)),l=Math.min(Math.round(e+a/2),c.end),m=[];this._getFeatures({ref:c.name,start:f,end:l},function(a){m.push(a)},function(e){m=h.filter(m,function(a){return a.get("start")>=f&&a.get("end")<=l});b.call(d,a,{featureDensity:m.length/a,
_statsSampleFeatures:m.length,_statsSampleInterval:{ref:c.name,start:f,end:l,length:a}})},function(c){b.call(d,a,null,c)})},m=function(h,k,q){if(q)q.isInstanceOf(a.DataOverflow)?f.resolve({featureDensity:0,error:"global stats estimation found chunkSizeError"}):f.reject(q);else{var g=c.end-c.start;300<=k._statsSampleFeatures||2*h>g||q?f.resolve(k):new Date-e<d?b.call(this,2*h,m):f.resolve({featureDensity:0,error:"global stats estimation timed out"})}};b.call(this,100,m);return f}})})},"JBrowse/Store/SeqFeature/BED/Parser":function(){define(["dojo/_base/declare",
"dojo/_base/array","dojo/_base/lang","JBrowse/Util/TextIterator","JBrowse/Util/GFF3"],function(n,h,l,a,c){var f="seq_id start end name score strand".split(" ");return n(null,{constructor:function(a){l.mixin(this,{featureCallback:a.featureCallback||function(){},endCallback:a.endCallback||function(){},commentCallback:a.commentCallback||function(){},errorCallback:a.errorCallback||function(a){console.error(a)},store:a.store,eof:!1})},parseHeader:function(d){var c={};d=new a.FromBytes({bytes:d});for(var b;b=
d.getline();)"#"==b[0]&&(b=(this.config.parseHeader||function(){})(b),c[b.key]=b.value);return this.header=c},finish:function(){this.endCallback()},addLine:function(a){var c;if(!this.eof)if(/^\s*[^#\s>]/.test(a))a=a.replace(/\r?\n?$/g,""),a=this.parse_feature(a),this.featureCallback(this._return_item([a]));else if(c=/^\s*(\#+)(.*)/.exec(a))a=c[2],a=a.replace(/\s*/,""),this._return_item({comment:a});else if(!/^\s*$/.test(a))if(/^\s*>/.test(a))this._return_all_under_construction_features(),this.eof=
!0;else throw a=a.replace(/\r?\n?$/g,""),"GFF3 parse error.  Cannot parse '"+a+"'.";},parse_feature:function(a){a=h.map(a.split("\t"),function(a){return"."==a?null:a});a[0]=c.unescape(a[0]);for(var e={},b=0;b<f.length;b++)a[b]&&(e[f[b]]="."==a[b]?null:a[b]);null!==e.start&&(e.start=parseInt(e.start,10));null!==e.end&&(e.end=parseInt(e.end,10));null!=e.score&&(e.score=parseFloat(e.score,10));e.strand={"+":1,"-":-1}[e.strand]||0;return e},_return_item:function(a){a[0]?this.featureCallback(a):a.comment&&
this.commentCallback(a,this.store)}})})},"JBrowse/Util/GFF3":function(){define(["dojo/_base/array","dojo/_base/lang"],function(n,h){var l="seq_id source type start end score strand phase attributes".split(" ");return{parse_feature:function(a){a=n.map(a.split("\t"),function(a){return"."==a?null:a});a[0]=this.unescape(a[0]);a[1]=this.unescape(a[1]);a[8]=this.parse_attributes(a[8]);for(var c={},f=0;f<l.length;f++)c[l[f]]="."==a[f]?null:a[f];null!==c.start&&(c.start=parseInt(c.start,10));null!==c.end&&
(c.end=parseInt(c.end,10));null!==c.score&&(c.score=parseFloat(c.score,10));null!=c.strand&&(c.strand={"+":1,"-":-1}[c.strand]||0);return c},parse_directive:function(a){var c=/^\s*\#\#\s*(\S+)\s*(.*)/.exec(a);if(!c)return null;a=c[1];var f=c[2],c={directive:a};f.length&&(f=f.replace(/\r?\n$/,""),c.value=f);"sequence-region"==a?(a=f.split(/\s+/,3),c.seq_id=a[0],c.start=a[1].replace(/\D/g,""),c.end=a[2].replace(/\D/g,"")):"genome-build"==a&&(a=f.split(/\s+/,2),c.source=a[0],c.buildname=a[1]);return c},
unescape:function(a){return null===a?null:a.replace(/%([0-9A-Fa-f]{2})/g,function(a,f){return String.fromCharCode(parseInt(f,16))})},escape:function(a){return a.replace(/[\n\r\t;=%&,\x00-\x1f\x7f-\xff]/g,function(a){a=a.charCodeAt(0).toString(16).toUpperCase();2>a.length&&(a="0"+a);return"%"+a})},parse_attributes:function(a){if(!a||!a.length||"."==a)return{};a=a.replace(/\r?\n$/,"");var c={};n.forEach(a.split(";"),function(a){a=a.split("\x3d",2);if(a[1]&&a[1].length){var d=c[a[0]];d||(d=c[a[0]]=[]);
d.push.apply(d,n.map(a[1].split(","),this.unescape))}},this);return c},format_feature:function(a){for(var c=null===a.attributes||"undefined"==typeof a.attributes?".":this.format_attributes(a.attributes),f=["-",".","+"],d=[],e=0;8>e;e++){var b=a[l[e]];d[e]=6==e?null===b||void 0===b?".":f[b+1]:null===b||void 0===b?".":this.escape(""+b)}d[8]=c;return d.join("\t")+"\n"},format_attributes:function(a){var c=[],f;for(f in a){var d=a[f],d=d.hasOwnProperty("toString")?this.escape(d.toString()):h.isArray(d.values)?
h.isArray(d.values)?n.map(d.values,this.escape).join(","):this.escape(d.values):h.isArray(d)?n.map(d,this.escape).join(","):this.escape(d);c.push(this.escape(f)+"\x3d"+d)}return c.length?c.join(";"):"."}}})}}});
define("JBrowse/Store/SeqFeature/BEDTabix","dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/Deferred JBrowse/Store/SeqFeature JBrowse/Store/DeferredStatsMixin JBrowse/Store/DeferredFeaturesMixin JBrowse/Store/TabixIndexedFile JBrowse/Store/SeqFeature/GlobalStatsEstimationMixin JBrowse/Model/XHRBlob JBrowse/Model/SimpleFeature ./BED/Parser".split(" "),function(n,h,l,a,c,f,d,e,b,m,p,k){return n([c,f,d,b,k],{constructor:function(a){var b=this,c=a.tbi||new m(this.resolveUrl(this.getConf("tbiUrlTemplate",
[])||this.getConf("urlTemplate",[])+".tbi")),d=a.file||new m(this.resolveUrl(this.getConf("urlTemplate",[])));this.indexedData=new e({tbi:c,file:d,browser:this.browser,chunkSizeLimit:a.chunkSizeLimit||1E6});this.parser=new k({commentCallback:this.config.commentCallback||function(a){},store:this});this.getHeader().then(function(a){b._deferred.features.resolve({success:!0});b._estimateGlobalStats().then(function(a){b.globalStats=a;b._deferred.stats.resolve(a)},h.hitch(b,"_failAllDeferred"))},h.hitch(b,
"_failAllDeferred"))},getHeader:function(){var b=this;return this._parsedHeader||(this._parsedHeader=function(){var c=new a,d=h.hitch(c,"reject");b.indexedData.indexLoaded.then(function(){b.indexedData.data.read(0,b.indexedData.index.firstDataLine?2*(b.indexedData.index.firstDataLine.block+b.indexedData.data.blockSize-1):null,function(a){b.parser.parseHeader(new Uint8Array(a));c.resolve(b.header)},d)},d);return c}.call(this))},_getFeatures:function(a,b,c,d){var e=this;e.getHeader().then(function(){e.indexedData.getLines(a.ref||
e.refSeq.name,a.start,a.end,function(a){a=e.lineToFeature(a);e.config.featureCallback?b(e.config.featureCallback(a,e)):b(a)},c,d)},d)},_featureData:function(a){var b=h.mixin({},a),c;for(c in a.matrix)b[c.toLowerCase()]=a.attributes[c].join(",");return b},_formatFeature:function(a){var b=new p({data:this._featureData(a),id:a.seq_id+"_"+a.start+"_"+a.end+"_"+a.name});b._reg_seq_id=this.browser.regularizeReferenceName(a.seq_id);return b},lineToFeature:function(a){for(var b=a.fields,c=0;c<b.length;c++)"."==
b[c]&&(b[c]=null);a={start:a.start,end:a.end,seq_id:a.ref,name:b[3],score:b[4]?+b[4]:null,strand:{"+":1,"-":-1}[b[5]]||0};return new p({id:b.slice(0,5).join("/"),data:a,fields:b})},hasRefSeq:function(a,b,c){return this.indexedData.index.hasRefSeq(a,b,c)},saveStore:function(){return{urlTemplate:this.config.file.url,tbiUrlTemplate:this.config.tbi.url}}})});
//# sourceMappingURL=BEDTabix.js.map