//>>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,k,d,c,a,e,f,b){return n(null,{constructor:function(l){this.browser=l.browser;this.index=new b({blob:new f(l.tbi),browser:l.browser});this.data=new f(l.file);this.indexLoaded=this.index.load();this.chunkSizeLimit=l.chunkSizeLimit||
2E6},getLines:function(b,e,a,f,g,c){var d=this,h=Array.prototype.slice.call(arguments);this.indexLoaded.then(function(){d._fetch.apply(d,h)},c)},_fetch:function(b,e,m,c,g,f){f=f||function(b){console.error(b,b.stack)};var d=this.index.blocksForRange(b,e,m);if(d){d.toString=d.toUniqueString=function(){return this.join(", ")};for(var h=0;h<d.length;h++){var u=d[h].fetchedSize();if(u>this.chunkSizeLimit){f(new a.DataOverflow("Too much data. Chunk size "+k.commifyNumber(u)+" bytes exceeds chunkSizeLimit of "+
k.commifyNumber(this.chunkSizeLimit)+"."));return}}try{this._fetchChunkData(d,b,e,m,c,g,f)}catch(n){f(n)}}else f("Error in index fetch ("+[b,e,m].join()+")")},_fetchChunkData:function(b,e,a,f,g,d,s){if(b.length){var k=0,n=this.chunkCache=this.chunkCache||new c({name:"TabixIndexedFileChunkedCache",fillCallback:dojo.hitch(this,"_readChunkItems"),sizeFunction:function(b){return b.length},maxSize:1E5}),t=this.browser.regularizeReferenceName(e),r;h.forEach(b,function(e){n.get(e,function(e,p){p&&!r&&s(p);
if(!(r=r||p)){for(var c=0;c<e.length;c++){var h=e[c];if(h._regularizedRef==t)if(h.start>f)break;else h.end>=a&&g(h)}++k==b.length&&d()}})})}else d()},_readChunkItems:function(b,e){var a=this,f=[];a.data.read(b.minv.block,b.maxv.block-b.minv.block+1,function(b){b=new Uint8Array(b);b=new d.FromBytes({bytes:b,offset:0});try{a._parseItems(b,function(b){f.push(b)},function(){e(f)})}catch(l){e(null,l)}},function(b){e(null,b)})},_parseItems:function(b,e,a){for(var f=this,g=0;;)if(300>=g){var c=this.parseItem(b);
if(c)e(c),g++;else{a();break}}else{window.setTimeout(function(){f._parseItems(b,e,a)},1);break}},parseItem:function(b){var e=this.index.metaChar,a,f;do a=b.getline();while(a&&(a.charAt(0)==e||"\n"!=a.charAt(a.length-1)||!(f=this.tryParseLine(a))));return a&&f?f:null},tryParseLine:function(b){try{return this.parseLine(b)}catch(e){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,k){var d=n(null,{constructor:function(c){this.blob=c},blockSize:65536,slice:function(c,a){return new d(this.blob.slice(c,a))},fetch:function(c,a){this.blob.fetch(this._wrap(c),a)},read:function(c,a,e,f){this.blob.read(c,a+this.blockSize,this._wrap(e,a),f)},_wrap:function(c,
a){var e=this;return function(f){c(e.unbgzf(f,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 e=new Uint8Array(4),f=0;4>f;f++)e[f]=c[a+f];return(new Float32Array(e.buffer))[0]},unbgzf:function(c,a){a=Math.min(a||Infinity,c.byteLength-27);for(var e=[],f=0,b=[0];b[0]<a;b[0]+=8){var l=new Uint8Array(c,b[0],18);if(!(31==l[0]&&139==l[1])){console.error("invalid BGZF block header, skipping",l);break}var l=
this.readShort(l,10),l=b[0]+12+l,p;try{p=h(c,l,c.byteLength-l,b)}catch(m){if(/^Z_BUF_ERROR/.test(m.statusString)&&e.length)break;else throw m;}p.byteLength&&(f+=p.byteLength,e.push(p))}if(1==e.length)return e[0];f=new Uint8Array(f);for(p=b=0;p<e.length;++p)l=new Uint8Array(e[p]),k(l,0,f,b,l.length),b+=l.length;return f.buffer}});return d})},"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,k,d,c,a,e){var f=a.fastDeclare({constructor:function(b,e,a){this.minv=b;this.maxv=e;this.bin=a},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 e=new k;d("typed-arrays")?this.blob.fetch(function(a){b._parseIndex(a,e)},dojo.hitch(e,"reject")):e.reject("This web browser lacks support for JavaScript typed arrays.");return e}.call(this)},_parseIndex:function(b,l){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");
l.reject("Not a TBI file");return}var m=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(m);this._refNameToID={};var d=a.getInt32();this._parseNameBytes(a.getBytes(d,void 0,!1));this._indices=Array(m);for(d=0;d<m;++d){for(var g=a.getInt32(),q=this._indices[d]={binIndex:{}},h=0;h<g;++h){for(var k=
a.getInt32(),n=a.getInt32(),t=Array(n),r=0;r<n;++r){var v=new e(a.getBytes(8)),x=new e(a.getBytes(8));this._findFirstData(v);t[r]=new f(v,x,k)}q.binIndex[k]=t}g=a.getInt32();q=q.linearIndex=Array(g);for(r=0;r<g;++r)q[r]=new e(a.getBytes(8)),this._findFirstData(q[r])}l.resolve({success:!0})},_findFirstData:function(b){var e=this.firstDataLine;this.firstDataLine=e?0<e.compareTo(b)?b:e:b},_parseNameBytes:function(b){function e(){var a=b[f++];return a?String.fromCharCode(a):null}function a(){for(var b,
g="";b=e();)g+=b;return g.length?g:null}for(var f=0,c,g=0;c=a();g++)this._refIDToName[g]=c,this._refNameToID[this.browser.regularizeReferenceName(c)]=g},hasRefSeq:function(b,e,a){var f=this;b=f.browser.regularizeReferenceName(b);f.load().then(function(){b in f._refNameToID?e(!0):e(!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 d=b.linearIndex;
b=b.binIndex;c=this._reg2bins(a,c);var h=d.length?d[a>>this.TAD_LIDX_SHIFT>=d.length?d.length-1:a>>this.TAD_LIDX_SHIFT]:new e(0,0);for(a=d=0;a<c.length;++a)d+=(b[c[a]]||[]).length;if(0==d)return[];var g=[],q;for(a=d=0;a<c.length;++a)if(q=b[c[a]])for(var s=0;s<q.length;++s)0>h.compareTo(q[s].maxv)&&(g[d++]=new f(q[s].minv,q[s].maxv,q[s].bin));if(!g.length)return[];g=g.sort(function(b,a){return b.compareTo(a)});a=1;for(b=0;a<d;++a)0>g[b].maxv.compareTo(g[a].maxv)&&(++b,g[b].minv=g[a].minv,g[b].maxv=
g[a].maxv);d=b+1;for(a=1;a<d;++a)0<=g[a-1].maxv.compareTo(g[a].minv)&&(g[a-1].maxv=g[a].minv);a=1;for(b=0;a<d;++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,a){--a;return b>>14==a>>14?4681+(b>>14):b>>17==a>>17?585+(b>>17):b>>20==a>>20?73+(b>>20):b>>23==a>>23?9+(b>>23):b>>26==a>>26?1+(b>>26):0},_reg2bins:function(b,a){var e,f=[];--a;f.push(0);for(e=1+(b>>26);e<=1+(a>>26);++e)f.push(e);for(e=9+(b>>23);e<=9+(a>>23);++e)f.push(e);
for(e=73+(b>>20);e<=73+(a>>20);++e)f.push(e);for(e=585+(b>>17);e<=585+(a>>17);++e)f.push(e);for(e=4681+(b>>14);e<=4681+(a>>14);++e)f.push(e);return f}})})},"jDataView/jdataview":function(){define([],function(){var n={};(function(h){var k={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},d={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"},a=function(e,f,b,l){if(!(this instanceof a))throw Error("jDataView constructor may not be called as a function");this.buffer=e;if(!(k.NodeBuffer&&e instanceof Buffer)&&!(k.ArrayBuffer&&e instanceof ArrayBuffer)&&"string"!==typeof e)throw new TypeError("jDataView buffer has an incompatible type");this._isArrayBuffer=k.ArrayBuffer&&
e instanceof ArrayBuffer;this._isDataView=k.DataView&&this._isArrayBuffer;this._isNodeBuffer=k.NodeBuffer&&e instanceof Buffer;this._littleEndian=Boolean(l);var p=this._isArrayBuffer?e.byteLength:e.length;void 0===f&&(f=0);this.byteOffset=f;void 0===b&&(b=p-f);this.byteLength=b;if(!this._isDataView){if("number"!==typeof f)throw new TypeError("jDataView byteOffset is not a number");if("number"!==typeof b)throw new TypeError("jDataView byteLength is not a number");if(0>f)throw Error("jDataView byteOffset is negative");
if(0>b)throw Error("jDataView byteLength is negative");}this._isDataView&&(this._view=new DataView(e,f,b),this._start=0);this._start=f;if(f+b>p)throw Error("jDataView (byteOffset + byteLength) value is out of bounds");this._offset=0;if(this._isDataView)for(var m in d)d.hasOwnProperty(m)&&function(b,a){var e=d[b];a["get"+b]=function(f,c){void 0===c&&(c=a._littleEndian);void 0===f&&(f=a._offset);a._offset=f+e;return a._view["get"+b](f,c)}}(m,this);else if(this._isNodeBuffer&&k.NodeBuffer)for(m in d)d.hasOwnProperty(m)&&
function(b,a,e){var f=d[b];a["get"+b]=function(b,c){void 0===b&&(b=a._offset);a._offset=b+f;return a.buffer[e](a._start+b)}}(m,this,"Int8"===m||"Uint8"===m?"read"+c[m]:l?"read"+c[m]+"LE":"read"+c[m]+"BE");else for(m in d)d.hasOwnProperty(m)&&function(b,a){var e=d[b];a["get"+b]=function(f,c){void 0===c&&(c=a._littleEndian);void 0===f&&(f=a._offset);a._offset=f+e;if(a._isArrayBuffer&&0===(a._start+f)%e&&(1===e||c))return(new h[b+"Array"](a.buffer,a._start+f,1))[0];if("number"!==typeof f)throw new TypeError("jDataView byteOffset is not a number");
if(f+e>a.byteLength)throw Error("jDataView (byteOffset + size) value is out of bounds");return a["_get"+b](a._start+f,c)}}(m,this)};a.createBuffer=k.NodeBuffer?function(){return new Buffer(arguments)}:k.ArrayBuffer?function(){return(new Uint8Array(arguments)).buffer}:function(){return String.fromCharCode.apply(null,arguments)};a.prototype={compatibility:k,_getBytes:function(a,f,b){var c;void 0===b&&(b=this._littleEndian);void 0===f&&(f=this._offset);if("number"!==typeof f)throw new TypeError("jDataView byteOffset is not a number");
if(0>a||f+a>this.byteLength)throw Error("jDataView length or (byteOffset+length) value is out of bounds");f+=this._start;this._isArrayBuffer?c=new Uint8Array(this.buffer,f,a):(c=this.buffer.slice(f,f+a),this._isNodeBuffer||(c=Array.prototype.map.call(c,function(b){return b.charCodeAt(0)&255})));b&&1<a&&(c instanceof Array||(c=Array.prototype.slice.call(c)),c.reverse());this._offset=f-this._start+a;return c},getBytes:function(a,f,b){var c=this._getBytes.apply(this,arguments);c instanceof Array||(c=
Array.prototype.slice.call(c));return c},getString:function(a,f){var b;if(this._isNodeBuffer){void 0===f&&(f=this._offset);if("number"!==typeof f)throw new TypeError("jDataView byteOffset is not a number");if(0>a||f+a>this.byteLength)throw Error("jDataView length or (byteOffset+length) value is out of bounds");b=this.buffer.toString("ascii",this._start+f,this._start+f+a);this._offset=f+a}else b=String.fromCharCode.apply(null,this._getBytes(a,f,!1));return b},getChar:function(a){return this.getString(1,
a)},tell:function(){return this._offset},seek:function(a){if("number"!==typeof a)throw new TypeError("jDataView byteOffset is not a number");if(0>a||a>this.byteLength)throw Error("jDataView byteOffset value is out of bounds");return this._offset=a},_getFloat64:function(a,f){var b=this._getBytes(8,a,f),c=1-2*(b[0]>>7),d=((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===
d?0!==b?NaN:Infinity*c:-1023===d?c*b*Math.pow(2,-1074):c*(1+b*Math.pow(2,-52))*Math.pow(2,d)},_getFloat32:function(a,c){var b=this._getBytes(4,a,c),d=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*d:-127===h?d*b*Math.pow(2,-149):d*(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(c){return new a(c)}},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 d;try{d=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"),d=IEBinaryToArray_ByteStr(c)}c=IEBinaryToArray_ByteStr_Last(c);b="";for(var m=0,k=d.length%8,g;m<k;)g=d.charCodeAt(m++),b+=String.fromCharCode(g&255,g>>8);for(k=d.length;m<k;)b+=String.fromCharCode((g=d.charCodeAt(m++),g&255),g>>8,(g=d.charCodeAt(m++),g&255),g>>8,(g=d.charCodeAt(m++),g&255),g>>8,(g=d.charCodeAt(m++),g&255),g>>8,(g=d.charCodeAt(m++),g&255),g>>8,(g=d.charCodeAt(m++),g&255),g>>8,(g=d.charCodeAt(m++),g&255),g>>8,(g=d.charCodeAt(m++),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=a;"undefined"!==typeof module&&(module.exports=a)})(n);return n.jDataView})},"JBrowse/Model/BGZip/VirtualOffset":function(){define(["JBrowse/Util"],function(n){return n.fastDeclare({constructor:function(h,
k){2<=arguments.length?(this.block=h,this.offset=k):this._fromBytes(h)},_fromBytes:function(h,k){k=k||0;var d=1099511627776*h[k]+4294967296*h[k+1]+16777216*h[k+2]+65536*h[k+3]+256*h[k+4]+h[k+5],c=h[k+6]<<8|h[k+7];0==d&&0==c?this.block=this.offset=null:(this.block=d,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,k,d){return n(null,{_estimateGlobalStats:function(c){var a=new k;c=c||this.refSeq;var e=this.storeTimeout||3E3,f=new Date,b=function(a,b){var e=this,f=0.75*c.start+0.25*c.end,d=Math.max(0,Math.round(f-a/2)),k=Math.min(Math.round(f+a/2),c.end),l=[];this._getFeatures({ref:c.name,start:d,end:k},function(a){l.push(a)},function(f){l=h.filter(l,function(a){return a.get("start")>=d&&a.get("end")<=k});b.call(e,a,{featureDensity:l.length/a,
_statsSampleFeatures:l.length,_statsSampleInterval:{ref:c.name,start:d,end:k,length:a}})},function(c){b.call(e,a,null,c)})},l=function(h,k,n){if(n)n.isInstanceOf(d.DataOverflow)?a.resolve({featureDensity:0,error:"global stats estimation found chunkSizeError"}):a.reject(n);else{var g=c.end-c.start;300<=k._statsSampleFeatures||2*h>g||n?a.resolve(k):new Date-f<e?b.call(this,2*h,l):a.resolve({featureDensity:0,error:"global stats estimation timed out"})}};b.call(this,100,l);return a}})})},"JBrowse/Store/SeqFeature/GFF3/Parser":function(){define(["dojo/_base/declare",
"dojo/_base/array","dojo/_base/lang","dojo/json","JBrowse/Util/GFF3"],function(n,h,k,d,c){return n(null,{constructor:function(a){k.mixin(this,{featureCallback:a.featureCallback||function(){},endCallback:a.endCallback||function(){},commentCallback:a.commentCallback||function(){},errorCallback:a.errorCallback||function(a){console.error(a)},directiveCallback:a.directiveCallback||function(){},under_construction_top_level:[],under_construction_by_id:{},completed_references:{},under_construction_orphans:{},
eof:!1})},addLine:function(a){var e;if(!this.eof)if(/^\s*[^#\s>]/.test(a))a=c.parse_feature(a),this._buffer_feature(a);else if(e=/^\s*(\#+)(.*)/.exec(a)){var f=e[1];e=e[2];3==f.length?this._return_all_under_construction_features():2==f.length?(a=c.parse_directive(a),"FASTA"==a.directive?(this._return_all_under_construction_features(),this.eof=!0):this._return_item(a)):(e=e.replace(/\s*/,""),this._return_item({comment:e}))}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+"'.";},_return_item:function(a){a[0]?this.featureCallback(a):a.directive?this.directiveCallback(a):a.comment&&this.commentCallback(a)},finish:function(){this._return_all_under_construction_features();this.endCallback()},_return_all_under_construction_features:function(){h.forEach(this.under_construction_top_level,this._return_item,this);this.under_construction_top_level=[];this.under_construction_by_id={};this.completed_references=
{};for(var a in this.under_construction_orphans)for(var c in a)throw"parse error: orphans "+d.stringify(this.under_construction_orphans);},container_attributes:{Parent:"child_features",Derives_from:"derived_features"},_buffer_feature:function(a){a.child_features=[];a.derived_features=[];var c=a.attributes.ID||[],f=a.attributes.Parent||[],b=a.attributes.Derives_from||[];if(!c.length&&!f.length&&!b.length)this._return_item([a]);else{var d;h.forEach(c,function(c){var e;(e=this.under_construction_by_id[c])?
(e.push(a),d=e):(d=[a],!f.length&&!b.length&&this.under_construction_top_level.push(d),this.under_construction_by_id[c]=d,this._resolve_references_to(d,c))},this);this._resolve_references_from(d||[a],{Parent:f,Derives_from:b},c)}},_resolve_references_to:function(a,c){var d=this.under_construction_orphans[c];if(d)for(var b in d){var k=this.container_attributes[b]||b.toLowerCase();h.forEach(a,function(a){a[k].push(d[b]);delete d[b]})}},_resolve_references_from:function(a,c,d){var b,k;for(k in c)h.forEach(c[k],
function(c){var e;(e=this.under_construction_by_id[c])?(b||(b=this.container_attributes[k]||k.toLowerCase()),h.some(d,function(a){return this.completed_references[a+","+k+","+c]++},this)||h.forEach(e,function(c){c[b].push(a)})):((e=this.under_construction_orphans[c])||(e={}),e[k]=(e[k]||[]).push(a))},this)}})})},"JBrowse/Util/GFF3":function(){define(["dojo/_base/array","dojo/_base/lang"],function(n,h){var k="seq_id source type start end score strand phase attributes".split(" ");return{parse_feature:function(d){d=
n.map(d.split("\t"),function(a){return"."==a?null:a});d[0]=this.unescape(d[0]);d[1]=this.unescape(d[1]);d[8]=this.parse_attributes(d[8]);for(var c={},a=0;a<k.length;a++)c[k[a]]="."==d[a]?null:d[a];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(d){var c=/^\s*\#\#\s*(\S+)\s*(.*)/.exec(d);if(!c)return null;d=c[1];var a=c[2],
c={directive:d};a.length&&(a=a.replace(/\r?\n$/,""),c.value=a);"sequence-region"==d?(d=a.split(/\s+/,3),c.seq_id=d[0],c.start=d[1].replace(/\D/g,""),c.end=d[2].replace(/\D/g,"")):"genome-build"==d&&(d=a.split(/\s+/,2),c.source=d[0],c.buildname=d[1]);return c},unescape:function(d){return null===d?null:d.replace(/%([0-9A-Fa-f]{2})/g,function(c,a){return String.fromCharCode(parseInt(a,16))})},escape:function(d){return d.replace(/[\n\r\t;=%&,\x00-\x1f\x7f-\xff]/g,function(c){c=c.charCodeAt(0).toString(16).toUpperCase();
2>c.length&&(c="0"+c);return"%"+c})},parse_attributes:function(d){if(!d||!d.length||"."==d)return{};d=d.replace(/\r?\n$/,"");var c={};n.forEach(d.split(";"),function(a){a=a.split("\x3d",2);if(a[1]&&a[1].length){var e=c[a[0]];e||(e=c[a[0]]=[]);e.push.apply(e,n.map(a[1].split(","),this.unescape))}},this);return c},format_feature:function(d){for(var c=null===d.attributes||"undefined"==typeof d.attributes?".":this.format_attributes(d.attributes),a=["-",".","+"],e=[],f=0;8>f;f++){var b=d[k[f]];e[f]=6==
f?null===b||void 0===b?".":a[b+1]:null===b||void 0===b?".":this.escape(""+b)}e[8]=c;return e.join("\t")+"\n"},format_attributes:function(d){var c=[],a;for(a in d){var e=d[a],e=e.hasOwnProperty("toString")?this.escape(e.toString()):h.isArray(e.values)?h.isArray(e.values)?n.map(e.values,this.escape).join(","):this.escape(e.values):h.isArray(e)?n.map(e,this.escape).join(","):this.escape(e);c.push(this.escape(a)+"\x3d"+e)}return c.length?c.join(";"):"."}}})}}});
define("JBrowse/Store/SeqFeature/GFF3Tabix","dojo/_base/declare dojo/_base/lang dojo/_base/array dojo/Deferred JBrowse/Model/SimpleFeature JBrowse/Store/SeqFeature JBrowse/Store/DeferredStatsMixin JBrowse/Store/DeferredFeaturesMixin JBrowse/Store/TabixIndexedFile JBrowse/Store/SeqFeature/GlobalStatsEstimationMixin JBrowse/Model/XHRBlob JBrowse/Store/SeqFeature/GFF3/Parser JBrowse/Util/GFF3".split(" "),function(n,h,k,d,c,a,e,f,b,l,p,m,w){return n([a,e,f,l],{constructor:function(a){var c=this,e=a.tbi||
new p(this.resolveUrl(this.getConf("tbiUrlTemplate",[])||this.getConf("urlTemplate",[])+".tbi")),d=a.file||new p(this.resolveUrl(this.getConf("urlTemplate",[])));this.indexedData=new b({tbi:e,file:d,browser:this.browser,chunkSizeLimit:a.chunkSizeLimit||1E6});this.getHeader().then(function(a){c._deferred.features.resolve({success:!0});c._estimateGlobalStats().then(function(a){c.globalStats=a;c._deferred.stats.resolve(a)},h.hitch(c,"_failAllDeferred"))},h.hitch(c,"_failAllDeferred"))},getHeader:function(){var a=
this;return this._parsedHeader||(this._parsedHeader=function(){var b=new d,c=h.hitch(b,"reject");a.indexedData.indexLoaded.then(function(){a.indexedData.data.read(0,a.indexedData.index.firstDataLine?a.indexedData.index.firstDataLine.block+a.indexedData.data.blockSize-1:null,function(c){b.resolve(a.header)},c)},c);return b}.call(this))},_getFeatures:function(a,b,c,e){var d=this,f=new m({featureCallback:function(a){k.forEach(a,function(a){a=d._formatFeature(a);b(a)})},endCallback:function(){c()}});
d.getHeader().then(function(){d.indexedData.getLines(a.ref||d.refSeq.name,a.start,a.end,function(a){f._buffer_feature(d.lineToFeature(a))},function(){f.finish()},e)},e)},lineToFeature:function(a){var b=w.parse_attributes(a.fields[8]),c=a.fields[1],d=a.fields[2],e={"-":-1,".":0,"+":1}[a.fields[6]],f;b.ID||(b.ID=[a.fields.join("/")],f=!0);return{start:a.start,end:a.end,strand:e,child_features:[],seq_id:a.ref,attributes:b,type:d,source:c,remove_id:f}},_flattenOneLevel:function(a){for(var b=[],c=0;c<
a.length;c++)b.push.apply(b,a[c]);return b},_featureData:function(a){var b=h.mixin({},a);delete b.child_features;delete b.data;delete b.derived_features;b.start-=1;for(var c in a.attributes)b[c.toLowerCase()]=a.attributes[c].join(",");b.remove_id&&(delete b.remove_id,delete b.id);delete b.attributes;a=k.map(this._flattenOneLevel(a.child_features),this._featureData,this);a.length&&(b.subfeatures=a);return b},_formatFeature:function(a){var b=new c({data:this._featureData(a),id:(a.attributes.ID||[])[0]});
b._reg_seq_id=this.browser.regularizeReferenceName(a.seq_id);return 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=GFF3Tabix.js.map