").append(x.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Cn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?_n(_n(e,x.ajaxSettings),t):_n(x.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,l,u,c,p=x.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?x(f):x.event,h=x.Deferred(),g=x.Callbacks("once memory"),m=p.statusCode||{},y={},v={},b=0,w="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)m[t]=[m[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||w;return u&&u.abort(t),k(0,t),this}};if(h.promise(C).complete=g.add,C.success=C.done,C.error=C.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=x.trim(p.dataType||"*").toLowerCase().match(T)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(mn[3]||("http:"===mn[1]?"80":"443")))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=x.param(p.data,p.traditional)),qn(An,p,n,C),2===b)return C;l=p.global,l&&0===x.active++&&x.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Nn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(x.lastModified[o]&&C.setRequestHeader("If-Modified-Since",x.lastModified[o]),x.etag[o]&&C.setRequestHeader("If-None-Match",x.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)C.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,C,p)===!1||2===b))return C.abort();w="abort";for(i in{success:1,error:1,complete:1})C[i](p[i]);if(u=qn(jn,p,n,C)){C.readyState=1,l&&d.trigger("ajaxSend",[C,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){C.abort("timeout")},p.timeout));try{b=1,u.send(y,k)}catch(N){if(!(2>b))throw N;k(-1,N)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,N=n;2!==b&&(b=2,s&&clearTimeout(s),u=t,a=i||"",C.readyState=e>0?4:0,c=e>=200&&300>e||304===e,r&&(w=Mn(p,C,r)),w=On(p,w,C,c),c?(p.ifModified&&(T=C.getResponseHeader("Last-Modified"),T&&(x.lastModified[o]=T),T=C.getResponseHeader("etag"),T&&(x.etag[o]=T)),204===e||"HEAD"===p.type?N="nocontent":304===e?N="notmodified":(N=w.state,y=w.data,v=w.error,c=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),C.status=e,C.statusText=(n||N)+"",c?h.resolveWith(f,[y,N,C]):h.rejectWith(f,[C,N,v]),C.statusCode(m),m=t,l&&d.trigger(c?"ajaxSuccess":"ajaxError",[C,p,c?y:v]),g.fireWith(f,[C,N]),l&&(d.trigger("ajaxComplete",[C,p]),--x.active||x.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,n){return x.get(e,t,n,"script")}}),x.each(["get","post"],function(e,n){x[n]=function(e,r,i,o){return x.isFunction(r)&&(o=o||i,i=r,r=t),x.ajax({url:e,type:n,dataType:o,data:r,success:i})}});function Mn(e,n,r){var i,o,a,s,l=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in l)if(l[s]&&l[s].test(o)){u.unshift(s);break}if(u[0]in r)a=u[0];else{for(s in r){if(!u[0]||e.converters[s+" "+u[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==u[0]&&u.unshift(a),r[a]):t}function On(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(a=u[l+" "+o]||u["* "+o],!a)for(i in u)if(s=i.split(" "),s[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){a===!0?a=u[i]:u[i]!==!0&&(o=s[0],c.unshift(s[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(p){return{state:"parsererror",error:a?p:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),x.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=a.head||x("head")[0]||a.documentElement;return{send:function(t,i){n=a.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Fn=[],Bn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Fn.pop()||x.expando+"_"+vn++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,l=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return l||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=x.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,l?n[l]=n[l].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||x.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Fn.push(o)),s&&x.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}x.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=x.ajaxSettings.xhr(),x.support.cors=!!Rn&&"withCredentials"in Rn,Rn=x.support.ajax=!!Rn,Rn&&x.ajaxTransport(function(n){if(!n.crossDomain||x.support.cors){var r;return{send:function(i,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)l.setRequestHeader(s,i[s])}catch(u){}l.send(n.hasContent&&n.data||null),r=function(e,i){var s,u,c,p;try{if(r&&(i||4===l.readyState))if(r=t,a&&(l.onreadystatechange=x.noop,$n&&delete Pn[a]),i)4!==l.readyState&&l.abort();else{p={},s=l.status,u=l.getAllResponseHeaders(),"string"==typeof l.responseText&&(p.text=l.responseText);try{c=l.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,u)},n.async?4===l.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},x(e).unload($n)),Pn[a]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+w+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Yn.exec(t),o=i&&i[3]||(x.cssNumber[e]?"":"px"),a=(x.cssNumber[e]||"px"!==o&&+r)&&Yn.exec(x.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||".5",a/=s,x.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=x.now()}function Zn(e,t,n){var r,i=(Qn[t]||[]).concat(Qn["*"]),o=0,a=i.length;for(;a>o;o++)if(r=i[o].call(n,t,e))return r}function er(e,t,n){var r,i,o=0,a=Gn.length,s=x.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,u.startTime+u.duration-t),r=n/u.duration||0,o=1-r,a=0,l=u.tweens.length;for(;l>a;a++)u.tweens[a].run(o);return s.notifyWith(e,[u,o,n]),1>o&&l?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)u.tweens[n].run(1);return t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]),this}}),c=u.props;for(tr(c,u.opts.specialEasing);a>o;o++)if(r=Gn[o].call(u,e,c,u.opts))return r;return x.map(c,Zn,u),x.isFunction(u.opts.start)&&u.opts.start.call(e,u),x.fx.timer(x.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function tr(e,t){var n,r,i,o,a;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=x.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(er,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,l,u=this,c={},p=e.style,f=e.nodeType&&nn(e),d=x._data(e,"fxshow");n.queue||(s=x._queueHooks(e,"fx"),null==s.unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,u.always(function(){u.always(function(){s.unqueued--,x.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===x.css(e,"display")&&"none"===x.css(e,"float")&&(x.support.inlineBlockNeedsLayout&&"inline"!==ln(e.nodeName)?p.zoom=1:p.display="inline-block")),n.overflow&&(p.overflow="hidden",x.support.shrinkWrapBlocks||u.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],Vn.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(f?"hide":"show"))continue;c[r]=d&&d[r]||x.style(e,r)}if(!x.isEmptyObject(c)){d?"hidden"in d&&(f=d.hidden):d=x._data(e,"fxshow",{}),o&&(d.hidden=!f),f?x(e).show():u.done(function(){x(e).hide()}),u.done(function(){var t;x._removeData(e,"fxshow");for(t in c)x.style(e,t,c[t])});for(r in c)a=Zn(f?d[r]:0,r,u),r in d||(d[r]=a.start,f&&(a.end=a.start,a.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}x.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),a=function(){var t=er(this,x.extend({},e),o);(i||x._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=x.timers,a=x._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=x._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,a=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=rr.prototype.init,x.fx.tick=function(){var e,n=x.timers,r=0;for(Xn=x.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||x.fx.stop(),Xn=t},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){Un||(Un=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(Un),Un=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){x.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,x.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},x.offset={setOffset:function(e,t,n){var r=x.css(e,"position");"static"===r&&(e.style.position="relative");var i=x(e),o=i.offset(),a=x.css(e,"top"),s=x.css(e,"left"),l=("absolute"===r||"fixed"===r)&&x.inArray("auto",[a,s])>-1,u={},c={},p,f;l?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),x.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(u.top=t.top-o.top+p),null!=t.left&&(u.left=t.left-o.left+f),"using"in t?t.using.call(e,u):i.css(u)}},x.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===x.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(n=e.offset()),n.top+=x.css(e[0],"borderTopWidth",!0),n.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-x.css(r,"marginTop",!0),left:t.left-n.left-x.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);x.fn[e]=function(i){return x.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?x(a).scrollLeft():o,r?o:x(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return x.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}x.each({Height:"height",Width:"width"},function(e,n){x.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){x.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return x.access(this,function(n,r,i){var o;return x.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?x.css(n,r,s):x.style(n,r,i,s)},n,a?i:t,a,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=x:(e.jQuery=e.$=x,"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}))})(window);
diff --git a/site/make_api.py b/site/make_api.py
deleted file mode 100644
index b8b61c1..0000000
--- a/site/make_api.py
+++ /dev/null
@@ -1,406 +0,0 @@
-# API generator script
-#
-# Sebastian Raschka 2014-2016
-# biopandas Machine Learning Library Extensions
-#
-# Author: Sebastian Raschka
-#
-# License: BSD 3 clause
-
-
-import string
-import inspect
-import os
-import sys
-import pkgutil
-import shutil
-
-
-def _obj_name(obj):
- if hasattr(obj, '__name__'):
- return obj.__name__
-
-
-def docstring_to_markdown(docstring):
- """Convert a Python object's docstring to markdown
-
- Parameters
- ----------
- docstring : str
- The docstring body.
-
- Returns
- ----------
- clean_lst : list
- The markdown formatted docstring as lines (str) in a Python list.
-
- """
- new_docstring_lst = []
-
- for idx, line in enumerate(docstring.split('\n')):
- line = line.strip()
- if set(line) in ({'-'}, {'='}):
- new_docstring_lst[idx-1] = '**%s**' % new_docstring_lst[idx-1]
- elif line.startswith('>>>'):
- line = ' %s' % line
- new_docstring_lst.append(line)
-
- for idx, line in enumerate(new_docstring_lst[1:]):
- if line:
- if line.startswith('Description : '):
- new_docstring_lst[idx+1] = (new_docstring_lst[idx+1]
- .replace('Description : ', ''))
- elif ' : ' in line:
- line = line.replace(' : ', '` : ')
- new_docstring_lst[idx+1] = '\n- `%s\n' % line
- elif '**' in new_docstring_lst[idx-1] and '**' not in line:
- new_docstring_lst[idx+1] = '\n%s' % line.lstrip()
- elif '**' not in line:
- new_docstring_lst[idx+1] = ' %s' % line.lstrip()
-
- clean_lst = []
- for line in new_docstring_lst:
- if set(line.strip()) not in ({'-'}, {'='}):
- clean_lst.append(line)
- return clean_lst
-
-
-def object_to_markdownpage(obj_name, obj, s=''):
- """Generate the markdown documentation of a Python object.
-
- Parameters
- ----------
- obj_name : str
- Name of the Python object.
- obj : object
- Python object (class, method, function, ...)
- s : str (default: '')
- A string to which the documentation will be appended to.
-
- Returns
- ---------
- s : str
- The markdown page.
-
- """
- # header
- s += '## %s\n' % obj_name
-
- # function/class/method signature
- sig = str(inspect.signature(obj)).replace('(self, ', '(')
- s += '\n*%s%s*\n\n' % (obj_name, sig)
-
- # docstring body
- doc = str(inspect.getdoc(obj))
- ds = docstring_to_markdown(doc)
- s += '\n'.join(ds)
-
- # document methods
- if inspect.isclass(obj):
- methods, properties = '\n\n### Methods', '\n\n### Properties'
- members = inspect.getmembers(obj)
- for m in members:
- if not m[0].startswith('_') and len(m) >= 2:
- if isinstance(m[1], property):
- properties += '\n\n
\n\n*%s*\n\n' % m[0]
- m_doc = docstring_to_markdown(str(inspect.getdoc(m[1])))
- properties += '\n'.join(m_doc)
- else:
- sig = str(inspect.signature(m[1]))
- sig = sig.replace('(self, ', '(').replace('(self)', '()')
- sig = sig.replace('(self)', '()')
- methods += '\n\n
\n\n*%s%s*\n\n' % (m[0], sig)
- m_doc = docstring_to_markdown(str(inspect.getdoc(m[1])))
- methods += '\n'.join(m_doc)
- s += methods
- s += properties
- return s + '\n\n'
-
-
-def import_package(rel_path_to_package, package_name):
- """Imports a python package into the current namespace.
-
- Parameters
- ----------
- rel_path_to_package : str
- Path to the package containing director relative from this script's
- directory.
- package_name : str
- The name of the package to be imported.
-
- Returns
- ---------
- package : The imported package object.
-
- """
- try:
- curr_dir = os.path.dirname(os.path.realpath(__file__))
- except NameError:
- curr_dir = os.path.dirname(os.path.realpath(os.getcwd()))
- package_path = os.path.join(curr_dir, rel_path_to_package)
- if package_path not in sys.path:
- sys.path = [package_path] + sys.path
- package = __import__(package_name)
- return package
-
-
-def get_subpackages(package):
- """Return subpackages of a package.
-
- Parameters
- ----------
- package : python package object
-
- Returns
- --------
- list : list containing (importer, subpackage_name) tuples
-
- """
- return [i for i in pkgutil.iter_modules(package.__path__) if i[2]]
-
-
-def get_modules(package):
- """Return modules of a package.
-
- Parameters
- ----------
- package : python package object
-
- Returns
- --------
- list : list containing (importer, subpackage_name) tuples
-
- """
- return [i for i in pkgutil.iter_modules(package.__path__)]
-
-
-def get_functions_and_classes(package):
- """Retun lists of functions and classes from a package.
-
- Parameters
- ----------
- package : python package object
-
- Returns
- --------
- list, list : list of classes and functions
- Each sublist consists of [name, member] sublists.
-
- """
- classes, functions = [], []
- for name, member in inspect.getmembers(package):
- if not name.startswith('_'):
- if inspect.isclass(member):
- classes.append([name, member])
- elif inspect.isfunction(member):
- functions.append([name, member])
- return classes, functions
-
-
-def generate_api_docs(package, api_dir, clean=False, printlog=True):
- """Generate a module level API documentation of a python package.
-
- Description
- -----------
- Generates markdown API files for each module in a Python package whereas
- the structure is as follows:
- `package/package.subpackage/package.subpackage.module.md`
-
- Parameters
- -----------
- package : Python package object
- api_dir : str
- Output directory path for the top-level package directory
- clean : bool (default: False)
- Removes previously existing API directory if True.
- printlog : bool (default: True)
- Prints a progress log to the standard output screen if True.
-
- """
- if printlog:
- print('\n\nGenerating Module Files\n%s\n' % (50 * '='))
-
- prefix = package.__name__ + "."
-
- # clear the previous version
- if clean:
- if os.path.isdir(api_dir):
- shutil.rmtree(api_dir)
-
- # get subpackages
- api_docs = {}
- for importer, pkg_name, is_pkg in pkgutil.iter_modules(
- package.__path__,
- prefix):
- if is_pkg:
- subpackage = __import__(pkg_name, fromlist="dummy")
- prefix = subpackage.__name__ + "."
-
- # get functions and classes
- classes, functions = get_functions_and_classes(subpackage)
-
- target_dir = os.path.join(api_dir, subpackage.__name__)
-
- # create the subdirs
- if not os.path.isdir(target_dir):
- os.makedirs(target_dir)
- if printlog:
- print('created %s' % target_dir)
-
- # create markdown documents in memory
- for obj in classes + functions:
- md_path = os.path.join(target_dir, obj[0]) + '.md'
- if md_path not in api_docs:
- api_docs[md_path] = object_to_markdownpage(obj_name=obj[0],
- obj=obj[1],
- s='')
- else:
- api_docs[md_path] += object_to_markdownpage(obj_name=(
- obj[0]),
- obj=obj[1],
- s='')
-
- # write to files
- for d in sorted(api_docs):
- prev = ''
- if os.path.isfile(d):
- with open(d, 'r') as f:
- prev = f.read()
- if prev == api_docs[d]:
- msg = 'skipped'
- else:
- msg = 'updated'
- else:
- msg = 'created'
-
- if msg != 'skipped':
- with open(d, 'w') as f:
- f.write(api_docs[d])
-
- if printlog:
- print('%s %s' % (msg, d))
-
-
-def summarize_methdods_and_functions(api_modules, out_dir,
- printlog=False, clean=True,
- str_above_header=''):
- """Generates subpacke-level summary files.
-
- Description
- -----------
- A function to generate subpacke-level summary markdown API files from
- a module-level API documentation previously created via the
- `generate_api_docs` function.
- The output structure is:
- package/package.subpackage.md
-
- Parameters
- ----------
- api_modules : str
- Path to the API documentation crated via `generate_api_docs`
- out_dir : str
- Path to the desired output directory for the new markdown files.
- clean : bool (default: False)
- Removes previously existing API directory if True.
- printlog : bool (default: True)
- Prints a progress log to the standard output screen if True.
- str_above_header : str (default: '')
- Places a string just above the header.
-
- """
- if printlog:
- print('\n\nGenerating Subpackage Files\n%s\n' % (50 * '='))
-
- if clean:
- if os.path.isdir(out_dir):
- shutil.rmtree(out_dir)
-
- if not os.path.isdir(out_dir):
- os.mkdir(out_dir)
- if printlog:
- print('created %s' % out_dir)
-
- subdir_paths = [os.path.join(api_modules, d)
- for d in os.listdir(api_modules)
- if not d.startswith('.')]
-
- out_files = [os.path.join(out_dir, os.path.basename(d)) + '.md'
- for d in subdir_paths]
-
- for sub_p, out_f in zip(subdir_paths, out_files):
- module_paths = (os.path.join(sub_p, m)
- for m in os.listdir(sub_p)
- if not m.startswith('.'))
-
- new_output = []
- if str_above_header:
- new_output.append(str_above_header)
- for p in module_paths:
- with open(p, 'r') as r:
- new_output.extend(r.readlines())
-
- msg = ''
- if not os.path.isfile(out_f):
- msg = 'created'
-
- if msg != 'created':
- with open(out_f, 'r') as f:
- prev = f.readlines()
- if prev != new_output:
- msg = 'updated'
- else:
- msg = 'skipped'
-
- if msg != 'skipped':
- with open(out_f, 'w') as f:
- f.write(''.join(new_output))
-
- if printlog:
- print('%s %s' % (msg, out_f))
-
-
-if __name__ == "__main__":
-
- import argparse
- parser = argparse.ArgumentParser(
- description='Convert docstring into a markdown API documentation.',
- formatter_class=argparse.RawTextHelpFormatter)
-
- parser.add_argument('-n', '--package_name',
- default='biopandas',
- help='Name of the package')
- parser.add_argument('-d', '--package_dir',
- default='../../biopandas/',
- help="Path to the package's enclosing directory")
- parser.add_argument('-o1', '--output_module_api',
- default='../docs/sources/api_modules',
- help=('Target directory for the module-level'
- ' API Markdown files'))
- parser.add_argument('-o2', '--output_subpackage_api',
- default='../docs/sources/api_subpackages',
- help=('Target directory for the'
- 'subpackage-level API Markdown files'))
- parser.add_argument('-c', '--clean',
- action='store_true',
- help='Remove previous API files')
- parser.add_argument('-s', '--silent',
- action='store_true',
- help='Suppress log printed to the screen')
- parser.add_argument('-v', '--version',
- action='version',
- version='v. 0.1')
-
- args = parser.parse_args()
-
- package = import_package(args.package_dir, args.package_name)
- generate_api_docs(package=package,
- api_dir=args.output_module_api,
- clean=args.clean,
- printlog=not(args.silent))
- summarize_methdods_and_functions(api_modules=args.output_module_api,
- out_dir=args.output_subpackage_api,
- printlog=not(args.silent),
- clean=args.clean,
- str_above_header=('biopandas'
- ' version: %s\n' % (
- package.__version__)))
diff --git a/site/mathjaxhelper.js b/site/mathjaxhelper.js
deleted file mode 100644
index 08bf844..0000000
--- a/site/mathjaxhelper.js
+++ /dev/null
@@ -1,8 +0,0 @@
-MathJax.Hub.Config({
- "tex2jax": { inlineMath: [ [ '$', '$' ] ] }
-});
-MathJax.Hub.Config({
- config: ["MMLorHTML.js"],
- jax: ["input/TeX", "output/HTML-CSS", "output/NativeMML"],
- extensions: ["MathMenu.js", "MathZoom.js"]
-});
diff --git a/site/search/lunr.js b/site/search/lunr.js
deleted file mode 100644
index c218cc8..0000000
--- a/site/search/lunr.js
+++ /dev/null
@@ -1,2986 +0,0 @@
-/**
- * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.1.6
- * Copyright (C) 2018 Oliver Nightingale
- * @license MIT
- */
-
-;(function(){
-
-/**
- * A convenience function for configuring and constructing
- * a new lunr Index.
- *
- * A lunr.Builder instance is created and the pipeline setup
- * with a trimmer, stop word filter and stemmer.
- *
- * This builder object is yielded to the configuration function
- * that is passed as a parameter, allowing the list of fields
- * and other builder parameters to be customised.
- *
- * All documents _must_ be added within the passed config function.
- *
- * @example
- * var idx = lunr(function () {
- * this.field('title')
- * this.field('body')
- * this.ref('id')
- *
- * documents.forEach(function (doc) {
- * this.add(doc)
- * }, this)
- * })
- *
- * @see {@link lunr.Builder}
- * @see {@link lunr.Pipeline}
- * @see {@link lunr.trimmer}
- * @see {@link lunr.stopWordFilter}
- * @see {@link lunr.stemmer}
- * @namespace {function} lunr
- */
-var lunr = function (config) {
- var builder = new lunr.Builder
-
- builder.pipeline.add(
- lunr.trimmer,
- lunr.stopWordFilter,
- lunr.stemmer
- )
-
- builder.searchPipeline.add(
- lunr.stemmer
- )
-
- config.call(builder, builder)
- return builder.build()
-}
-
-lunr.version = "2.1.6"
-/*!
- * lunr.utils
- * Copyright (C) 2018 Oliver Nightingale
- */
-
-/**
- * A namespace containing utils for the rest of the lunr library
- */
-lunr.utils = {}
-
-/**
- * Print a warning message to the console.
- *
- * @param {String} message The message to be printed.
- * @memberOf Utils
- */
-lunr.utils.warn = (function (global) {
- /* eslint-disable no-console */
- return function (message) {
- if (global.console && console.warn) {
- console.warn(message)
- }
- }
- /* eslint-enable no-console */
-})(this)
-
-/**
- * Convert an object to a string.
- *
- * In the case of `null` and `undefined` the function returns
- * the empty string, in all other cases the result of calling
- * `toString` on the passed object is returned.
- *
- * @param {Any} obj The object to convert to a string.
- * @return {String} string representation of the passed object.
- * @memberOf Utils
- */
-lunr.utils.asString = function (obj) {
- if (obj === void 0 || obj === null) {
- return ""
- } else {
- return obj.toString()
- }
-}
-lunr.FieldRef = function (docRef, fieldName, stringValue) {
- this.docRef = docRef
- this.fieldName = fieldName
- this._stringValue = stringValue
-}
-
-lunr.FieldRef.joiner = "/"
-
-lunr.FieldRef.fromString = function (s) {
- var n = s.indexOf(lunr.FieldRef.joiner)
-
- if (n === -1) {
- throw "malformed field ref string"
- }
-
- var fieldRef = s.slice(0, n),
- docRef = s.slice(n + 1)
-
- return new lunr.FieldRef (docRef, fieldRef, s)
-}
-
-lunr.FieldRef.prototype.toString = function () {
- if (this._stringValue == undefined) {
- this._stringValue = this.fieldName + lunr.FieldRef.joiner + this.docRef
- }
-
- return this._stringValue
-}
-/**
- * A function to calculate the inverse document frequency for
- * a posting. This is shared between the builder and the index
- *
- * @private
- * @param {object} posting - The posting for a given term
- * @param {number} documentCount - The total number of documents.
- */
-lunr.idf = function (posting, documentCount) {
- var documentsWithTerm = 0
-
- for (var fieldName in posting) {
- if (fieldName == '_index') continue // Ignore the term index, its not a field
- documentsWithTerm += Object.keys(posting[fieldName]).length
- }
-
- var x = (documentCount - documentsWithTerm + 0.5) / (documentsWithTerm + 0.5)
-
- return Math.log(1 + Math.abs(x))
-}
-
-/**
- * A token wraps a string representation of a token
- * as it is passed through the text processing pipeline.
- *
- * @constructor
- * @param {string} [str=''] - The string token being wrapped.
- * @param {object} [metadata={}] - Metadata associated with this token.
- */
-lunr.Token = function (str, metadata) {
- this.str = str || ""
- this.metadata = metadata || {}
-}
-
-/**
- * Returns the token string that is being wrapped by this object.
- *
- * @returns {string}
- */
-lunr.Token.prototype.toString = function () {
- return this.str
-}
-
-/**
- * A token update function is used when updating or optionally
- * when cloning a token.
- *
- * @callback lunr.Token~updateFunction
- * @param {string} str - The string representation of the token.
- * @param {Object} metadata - All metadata associated with this token.
- */
-
-/**
- * Applies the given function to the wrapped string token.
- *
- * @example
- * token.update(function (str, metadata) {
- * return str.toUpperCase()
- * })
- *
- * @param {lunr.Token~updateFunction} fn - A function to apply to the token string.
- * @returns {lunr.Token}
- */
-lunr.Token.prototype.update = function (fn) {
- this.str = fn(this.str, this.metadata)
- return this
-}
-
-/**
- * Creates a clone of this token. Optionally a function can be
- * applied to the cloned token.
- *
- * @param {lunr.Token~updateFunction} [fn] - An optional function to apply to the cloned token.
- * @returns {lunr.Token}
- */
-lunr.Token.prototype.clone = function (fn) {
- fn = fn || function (s) { return s }
- return new lunr.Token (fn(this.str, this.metadata), this.metadata)
-}
-/*!
- * lunr.tokenizer
- * Copyright (C) 2018 Oliver Nightingale
- */
-
-/**
- * A function for splitting a string into tokens ready to be inserted into
- * the search index. Uses `lunr.tokenizer.separator` to split strings, change
- * the value of this property to change how strings are split into tokens.
- *
- * This tokenizer will convert its parameter to a string by calling `toString` and
- * then will split this string on the character in `lunr.tokenizer.separator`.
- * Arrays will have their elements converted to strings and wrapped in a lunr.Token.
- *
- * @static
- * @param {?(string|object|object[])} obj - The object to convert into tokens
- * @returns {lunr.Token[]}
- */
-lunr.tokenizer = function (obj) {
- if (obj == null || obj == undefined) {
- return []
- }
-
- if (Array.isArray(obj)) {
- return obj.map(function (t) {
- return new lunr.Token(lunr.utils.asString(t).toLowerCase())
- })
- }
-
- var str = obj.toString().trim().toLowerCase(),
- len = str.length,
- tokens = []
-
- for (var sliceEnd = 0, sliceStart = 0; sliceEnd <= len; sliceEnd++) {
- var char = str.charAt(sliceEnd),
- sliceLength = sliceEnd - sliceStart
-
- if ((char.match(lunr.tokenizer.separator) || sliceEnd == len)) {
-
- if (sliceLength > 0) {
- tokens.push(
- new lunr.Token (str.slice(sliceStart, sliceEnd), {
- position: [sliceStart, sliceLength],
- index: tokens.length
- })
- )
- }
-
- sliceStart = sliceEnd + 1
- }
-
- }
-
- return tokens
-}
-
-/**
- * The separator used to split a string into tokens. Override this property to change the behaviour of
- * `lunr.tokenizer` behaviour when tokenizing strings. By default this splits on whitespace and hyphens.
- *
- * @static
- * @see lunr.tokenizer
- */
-lunr.tokenizer.separator = /[\s\-]+/
-/*!
- * lunr.Pipeline
- * Copyright (C) 2018 Oliver Nightingale
- */
-
-/**
- * lunr.Pipelines maintain an ordered list of functions to be applied to all
- * tokens in documents entering the search index and queries being ran against
- * the index.
- *
- * An instance of lunr.Index created with the lunr shortcut will contain a
- * pipeline with a stop word filter and an English language stemmer. Extra
- * functions can be added before or after either of these functions or these
- * default functions can be removed.
- *
- * When run the pipeline will call each function in turn, passing a token, the
- * index of that token in the original list of all tokens and finally a list of
- * all the original tokens.
- *
- * The output of functions in the pipeline will be passed to the next function
- * in the pipeline. To exclude a token from entering the index the function
- * should return undefined, the rest of the pipeline will not be called with
- * this token.
- *
- * For serialisation of pipelines to work, all functions used in an instance of
- * a pipeline should be registered with lunr.Pipeline. Registered functions can
- * then be loaded. If trying to load a serialised pipeline that uses functions
- * that are not registered an error will be thrown.
- *
- * If not planning on serialising the pipeline then registering pipeline functions
- * is not necessary.
- *
- * @constructor
- */
-lunr.Pipeline = function () {
- this._stack = []
-}
-
-lunr.Pipeline.registeredFunctions = Object.create(null)
-
-/**
- * A pipeline function maps lunr.Token to lunr.Token. A lunr.Token contains the token
- * string as well as all known metadata. A pipeline function can mutate the token string
- * or mutate (or add) metadata for a given token.
- *
- * A pipeline function can indicate that the passed token should be discarded by returning
- * null. This token will not be passed to any downstream pipeline functions and will not be
- * added to the index.
- *
- * Multiple tokens can be returned by returning an array of tokens. Each token will be passed
- * to any downstream pipeline functions and all will returned tokens will be added to the index.
- *
- * Any number of pipeline functions may be chained together using a lunr.Pipeline.
- *
- * @interface lunr.PipelineFunction
- * @param {lunr.Token} token - A token from the document being processed.
- * @param {number} i - The index of this token in the complete list of tokens for this document/field.
- * @param {lunr.Token[]} tokens - All tokens for this document/field.
- * @returns {(?lunr.Token|lunr.Token[])}
- */
-
-/**
- * Register a function with the pipeline.
- *
- * Functions that are used in the pipeline should be registered if the pipeline
- * needs to be serialised, or a serialised pipeline needs to be loaded.
- *
- * Registering a function does not add it to a pipeline, functions must still be
- * added to instances of the pipeline for them to be used when running a pipeline.
- *
- * @param {lunr.PipelineFunction} fn - The function to check for.
- * @param {String} label - The label to register this function with
- */
-lunr.Pipeline.registerFunction = function (fn, label) {
- if (label in this.registeredFunctions) {
- lunr.utils.warn('Overwriting existing registered function: ' + label)
- }
-
- fn.label = label
- lunr.Pipeline.registeredFunctions[fn.label] = fn
-}
-
-/**
- * Warns if the function is not registered as a Pipeline function.
- *
- * @param {lunr.PipelineFunction} fn - The function to check for.
- * @private
- */
-lunr.Pipeline.warnIfFunctionNotRegistered = function (fn) {
- var isRegistered = fn.label && (fn.label in this.registeredFunctions)
-
- if (!isRegistered) {
- lunr.utils.warn('Function is not registered with pipeline. This may cause problems when serialising the index.\n', fn)
- }
-}
-
-/**
- * Loads a previously serialised pipeline.
- *
- * All functions to be loaded must already be registered with lunr.Pipeline.
- * If any function from the serialised data has not been registered then an
- * error will be thrown.
- *
- * @param {Object} serialised - The serialised pipeline to load.
- * @returns {lunr.Pipeline}
- */
-lunr.Pipeline.load = function (serialised) {
- var pipeline = new lunr.Pipeline
-
- serialised.forEach(function (fnName) {
- var fn = lunr.Pipeline.registeredFunctions[fnName]
-
- if (fn) {
- pipeline.add(fn)
- } else {
- throw new Error('Cannot load unregistered function: ' + fnName)
- }
- })
-
- return pipeline
-}
-
-/**
- * Adds new functions to the end of the pipeline.
- *
- * Logs a warning if the function has not been registered.
- *
- * @param {lunr.PipelineFunction[]} functions - Any number of functions to add to the pipeline.
- */
-lunr.Pipeline.prototype.add = function () {
- var fns = Array.prototype.slice.call(arguments)
-
- fns.forEach(function (fn) {
- lunr.Pipeline.warnIfFunctionNotRegistered(fn)
- this._stack.push(fn)
- }, this)
-}
-
-/**
- * Adds a single function after a function that already exists in the
- * pipeline.
- *
- * Logs a warning if the function has not been registered.
- *
- * @param {lunr.PipelineFunction} existingFn - A function that already exists in the pipeline.
- * @param {lunr.PipelineFunction} newFn - The new function to add to the pipeline.
- */
-lunr.Pipeline.prototype.after = function (existingFn, newFn) {
- lunr.Pipeline.warnIfFunctionNotRegistered(newFn)
-
- var pos = this._stack.indexOf(existingFn)
- if (pos == -1) {
- throw new Error('Cannot find existingFn')
- }
-
- pos = pos + 1
- this._stack.splice(pos, 0, newFn)
-}
-
-/**
- * Adds a single function before a function that already exists in the
- * pipeline.
- *
- * Logs a warning if the function has not been registered.
- *
- * @param {lunr.PipelineFunction} existingFn - A function that already exists in the pipeline.
- * @param {lunr.PipelineFunction} newFn - The new function to add to the pipeline.
- */
-lunr.Pipeline.prototype.before = function (existingFn, newFn) {
- lunr.Pipeline.warnIfFunctionNotRegistered(newFn)
-
- var pos = this._stack.indexOf(existingFn)
- if (pos == -1) {
- throw new Error('Cannot find existingFn')
- }
-
- this._stack.splice(pos, 0, newFn)
-}
-
-/**
- * Removes a function from the pipeline.
- *
- * @param {lunr.PipelineFunction} fn The function to remove from the pipeline.
- */
-lunr.Pipeline.prototype.remove = function (fn) {
- var pos = this._stack.indexOf(fn)
- if (pos == -1) {
- return
- }
-
- this._stack.splice(pos, 1)
-}
-
-/**
- * Runs the current list of functions that make up the pipeline against the
- * passed tokens.
- *
- * @param {Array} tokens The tokens to run through the pipeline.
- * @returns {Array}
- */
-lunr.Pipeline.prototype.run = function (tokens) {
- var stackLength = this._stack.length
-
- for (var i = 0; i < stackLength; i++) {
- var fn = this._stack[i]
- var memo = []
-
- for (var j = 0; j < tokens.length; j++) {
- var result = fn(tokens[j], j, tokens)
-
- if (result === void 0 || result === '') continue
-
- if (result instanceof Array) {
- for (var k = 0; k < result.length; k++) {
- memo.push(result[k])
- }
- } else {
- memo.push(result)
- }
- }
-
- tokens = memo
- }
-
- return tokens
-}
-
-/**
- * Convenience method for passing a string through a pipeline and getting
- * strings out. This method takes care of wrapping the passed string in a
- * token and mapping the resulting tokens back to strings.
- *
- * @param {string} str - The string to pass through the pipeline.
- * @returns {string[]}
- */
-lunr.Pipeline.prototype.runString = function (str) {
- var token = new lunr.Token (str)
-
- return this.run([token]).map(function (t) {
- return t.toString()
- })
-}
-
-/**
- * Resets the pipeline by removing any existing processors.
- *
- */
-lunr.Pipeline.prototype.reset = function () {
- this._stack = []
-}
-
-/**
- * Returns a representation of the pipeline ready for serialisation.
- *
- * Logs a warning if the function has not been registered.
- *
- * @returns {Array}
- */
-lunr.Pipeline.prototype.toJSON = function () {
- return this._stack.map(function (fn) {
- lunr.Pipeline.warnIfFunctionNotRegistered(fn)
-
- return fn.label
- })
-}
-/*!
- * lunr.Vector
- * Copyright (C) 2018 Oliver Nightingale
- */
-
-/**
- * A vector is used to construct the vector space of documents and queries. These
- * vectors support operations to determine the similarity between two documents or
- * a document and a query.
- *
- * Normally no parameters are required for initializing a vector, but in the case of
- * loading a previously dumped vector the raw elements can be provided to the constructor.
- *
- * For performance reasons vectors are implemented with a flat array, where an elements
- * index is immediately followed by its value. E.g. [index, value, index, value]. This
- * allows the underlying array to be as sparse as possible and still offer decent
- * performance when being used for vector calculations.
- *
- * @constructor
- * @param {Number[]} [elements] - The flat list of element index and element value pairs.
- */
-lunr.Vector = function (elements) {
- this._magnitude = 0
- this.elements = elements || []
-}
-
-
-/**
- * Calculates the position within the vector to insert a given index.
- *
- * This is used internally by insert and upsert. If there are duplicate indexes then
- * the position is returned as if the value for that index were to be updated, but it
- * is the callers responsibility to check whether there is a duplicate at that index
- *
- * @param {Number} insertIdx - The index at which the element should be inserted.
- * @returns {Number}
- */
-lunr.Vector.prototype.positionForIndex = function (index) {
- // For an empty vector the tuple can be inserted at the beginning
- if (this.elements.length == 0) {
- return 0
- }
-
- var start = 0,
- end = this.elements.length / 2,
- sliceLength = end - start,
- pivotPoint = Math.floor(sliceLength / 2),
- pivotIndex = this.elements[pivotPoint * 2]
-
- while (sliceLength > 1) {
- if (pivotIndex < index) {
- start = pivotPoint
- }
-
- if (pivotIndex > index) {
- end = pivotPoint
- }
-
- if (pivotIndex == index) {
- break
- }
-
- sliceLength = end - start
- pivotPoint = start + Math.floor(sliceLength / 2)
- pivotIndex = this.elements[pivotPoint * 2]
- }
-
- if (pivotIndex == index) {
- return pivotPoint * 2
- }
-
- if (pivotIndex > index) {
- return pivotPoint * 2
- }
-
- if (pivotIndex < index) {
- return (pivotPoint + 1) * 2
- }
-}
-
-/**
- * Inserts an element at an index within the vector.
- *
- * Does not allow duplicates, will throw an error if there is already an entry
- * for this index.
- *
- * @param {Number} insertIdx - The index at which the element should be inserted.
- * @param {Number} val - The value to be inserted into the vector.
- */
-lunr.Vector.prototype.insert = function (insertIdx, val) {
- this.upsert(insertIdx, val, function () {
- throw "duplicate index"
- })
-}
-
-/**
- * Inserts or updates an existing index within the vector.
- *
- * @param {Number} insertIdx - The index at which the element should be inserted.
- * @param {Number} val - The value to be inserted into the vector.
- * @param {function} fn - A function that is called for updates, the existing value and the
- * requested value are passed as arguments
- */
-lunr.Vector.prototype.upsert = function (insertIdx, val, fn) {
- this._magnitude = 0
- var position = this.positionForIndex(insertIdx)
-
- if (this.elements[position] == insertIdx) {
- this.elements[position + 1] = fn(this.elements[position + 1], val)
- } else {
- this.elements.splice(position, 0, insertIdx, val)
- }
-}
-
-/**
- * Calculates the magnitude of this vector.
- *
- * @returns {Number}
- */
-lunr.Vector.prototype.magnitude = function () {
- if (this._magnitude) return this._magnitude
-
- var sumOfSquares = 0,
- elementsLength = this.elements.length
-
- for (var i = 1; i < elementsLength; i += 2) {
- var val = this.elements[i]
- sumOfSquares += val * val
- }
-
- return this._magnitude = Math.sqrt(sumOfSquares)
-}
-
-/**
- * Calculates the dot product of this vector and another vector.
- *
- * @param {lunr.Vector} otherVector - The vector to compute the dot product with.
- * @returns {Number}
- */
-lunr.Vector.prototype.dot = function (otherVector) {
- var dotProduct = 0,
- a = this.elements, b = otherVector.elements,
- aLen = a.length, bLen = b.length,
- aVal = 0, bVal = 0,
- i = 0, j = 0
-
- while (i < aLen && j < bLen) {
- aVal = a[i], bVal = b[j]
- if (aVal < bVal) {
- i += 2
- } else if (aVal > bVal) {
- j += 2
- } else if (aVal == bVal) {
- dotProduct += a[i + 1] * b[j + 1]
- i += 2
- j += 2
- }
- }
-
- return dotProduct
-}
-
-/**
- * Calculates the cosine similarity between this vector and another
- * vector.
- *
- * @param {lunr.Vector} otherVector - The other vector to calculate the
- * similarity with.
- * @returns {Number}
- */
-lunr.Vector.prototype.similarity = function (otherVector) {
- return this.dot(otherVector) / (this.magnitude() * otherVector.magnitude())
-}
-
-/**
- * Converts the vector to an array of the elements within the vector.
- *
- * @returns {Number[]}
- */
-lunr.Vector.prototype.toArray = function () {
- var output = new Array (this.elements.length / 2)
-
- for (var i = 1, j = 0; i < this.elements.length; i += 2, j++) {
- output[j] = this.elements[i]
- }
-
- return output
-}
-
-/**
- * A JSON serializable representation of the vector.
- *
- * @returns {Number[]}
- */
-lunr.Vector.prototype.toJSON = function () {
- return this.elements
-}
-/* eslint-disable */
-/*!
- * lunr.stemmer
- * Copyright (C) 2018 Oliver Nightingale
- * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt
- */
-
-/**
- * lunr.stemmer is an english language stemmer, this is a JavaScript
- * implementation of the PorterStemmer taken from http://tartarus.org/~martin
- *
- * @static
- * @implements {lunr.PipelineFunction}
- * @param {lunr.Token} token - The string to stem
- * @returns {lunr.Token}
- * @see {@link lunr.Pipeline}
- */
-lunr.stemmer = (function(){
- var step2list = {
- "ational" : "ate",
- "tional" : "tion",
- "enci" : "ence",
- "anci" : "ance",
- "izer" : "ize",
- "bli" : "ble",
- "alli" : "al",
- "entli" : "ent",
- "eli" : "e",
- "ousli" : "ous",
- "ization" : "ize",
- "ation" : "ate",
- "ator" : "ate",
- "alism" : "al",
- "iveness" : "ive",
- "fulness" : "ful",
- "ousness" : "ous",
- "aliti" : "al",
- "iviti" : "ive",
- "biliti" : "ble",
- "logi" : "log"
- },
-
- step3list = {
- "icate" : "ic",
- "ative" : "",
- "alize" : "al",
- "iciti" : "ic",
- "ical" : "ic",
- "ful" : "",
- "ness" : ""
- },
-
- c = "[^aeiou]", // consonant
- v = "[aeiouy]", // vowel
- C = c + "[^aeiouy]*", // consonant sequence
- V = v + "[aeiou]*", // vowel sequence
-
- mgr0 = "^(" + C + ")?" + V + C, // [C]VC... is m>0
- meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$", // [C]VC[V] is m=1
- mgr1 = "^(" + C + ")?" + V + C + V + C, // [C]VCVC... is m>1
- s_v = "^(" + C + ")?" + v; // vowel in stem
-
- var re_mgr0 = new RegExp(mgr0);
- var re_mgr1 = new RegExp(mgr1);
- var re_meq1 = new RegExp(meq1);
- var re_s_v = new RegExp(s_v);
-
- var re_1a = /^(.+?)(ss|i)es$/;
- var re2_1a = /^(.+?)([^s])s$/;
- var re_1b = /^(.+?)eed$/;
- var re2_1b = /^(.+?)(ed|ing)$/;
- var re_1b_2 = /.$/;
- var re2_1b_2 = /(at|bl|iz)$/;
- var re3_1b_2 = new RegExp("([^aeiouylsz])\\1$");
- var re4_1b_2 = new RegExp("^" + C + v + "[^aeiouwxy]$");
-
- var re_1c = /^(.+?[^aeiou])y$/;
- var re_2 = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;
-
- var re_3 = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;
-
- var re_4 = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;
- var re2_4 = /^(.+?)(s|t)(ion)$/;
-
- var re_5 = /^(.+?)e$/;
- var re_5_1 = /ll$/;
- var re3_5 = new RegExp("^" + C + v + "[^aeiouwxy]$");
-
- var porterStemmer = function porterStemmer(w) {
- var stem,
- suffix,
- firstch,
- re,
- re2,
- re3,
- re4;
-
- if (w.length < 3) { return w; }
-
- firstch = w.substr(0,1);
- if (firstch == "y") {
- w = firstch.toUpperCase() + w.substr(1);
- }
-
- // Step 1a
- re = re_1a
- re2 = re2_1a;
-
- if (re.test(w)) { w = w.replace(re,"$1$2"); }
- else if (re2.test(w)) { w = w.replace(re2,"$1$2"); }
-
- // Step 1b
- re = re_1b;
- re2 = re2_1b;
- if (re.test(w)) {
- var fp = re.exec(w);
- re = re_mgr0;
- if (re.test(fp[1])) {
- re = re_1b_2;
- w = w.replace(re,"");
- }
- } else if (re2.test(w)) {
- var fp = re2.exec(w);
- stem = fp[1];
- re2 = re_s_v;
- if (re2.test(stem)) {
- w = stem;
- re2 = re2_1b_2;
- re3 = re3_1b_2;
- re4 = re4_1b_2;
- if (re2.test(w)) { w = w + "e"; }
- else if (re3.test(w)) { re = re_1b_2; w = w.replace(re,""); }
- else if (re4.test(w)) { w = w + "e"; }
- }
- }
-
- // Step 1c - replace suffix y or Y by i if preceded by a non-vowel which is not the first letter of the word (so cry -> cri, by -> by, say -> say)
- re = re_1c;
- if (re.test(w)) {
- var fp = re.exec(w);
- stem = fp[1];
- w = stem + "i";
- }
-
- // Step 2
- re = re_2;
- if (re.test(w)) {
- var fp = re.exec(w);
- stem = fp[1];
- suffix = fp[2];
- re = re_mgr0;
- if (re.test(stem)) {
- w = stem + step2list[suffix];
- }
- }
-
- // Step 3
- re = re_3;
- if (re.test(w)) {
- var fp = re.exec(w);
- stem = fp[1];
- suffix = fp[2];
- re = re_mgr0;
- if (re.test(stem)) {
- w = stem + step3list[suffix];
- }
- }
-
- // Step 4
- re = re_4;
- re2 = re2_4;
- if (re.test(w)) {
- var fp = re.exec(w);
- stem = fp[1];
- re = re_mgr1;
- if (re.test(stem)) {
- w = stem;
- }
- } else if (re2.test(w)) {
- var fp = re2.exec(w);
- stem = fp[1] + fp[2];
- re2 = re_mgr1;
- if (re2.test(stem)) {
- w = stem;
- }
- }
-
- // Step 5
- re = re_5;
- if (re.test(w)) {
- var fp = re.exec(w);
- stem = fp[1];
- re = re_mgr1;
- re2 = re_meq1;
- re3 = re3_5;
- if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) {
- w = stem;
- }
- }
-
- re = re_5_1;
- re2 = re_mgr1;
- if (re.test(w) && re2.test(w)) {
- re = re_1b_2;
- w = w.replace(re,"");
- }
-
- // and turn initial Y back to y
-
- if (firstch == "y") {
- w = firstch.toLowerCase() + w.substr(1);
- }
-
- return w;
- };
-
- return function (token) {
- return token.update(porterStemmer);
- }
-})();
-
-lunr.Pipeline.registerFunction(lunr.stemmer, 'stemmer')
-/*!
- * lunr.stopWordFilter
- * Copyright (C) 2018 Oliver Nightingale
- */
-
-/**
- * lunr.generateStopWordFilter builds a stopWordFilter function from the provided
- * list of stop words.
- *
- * The built in lunr.stopWordFilter is built using this generator and can be used
- * to generate custom stopWordFilters for applications or non English languages.
- *
- * @param {Array} token The token to pass through the filter
- * @returns {lunr.PipelineFunction}
- * @see lunr.Pipeline
- * @see lunr.stopWordFilter
- */
-lunr.generateStopWordFilter = function (stopWords) {
- var words = stopWords.reduce(function (memo, stopWord) {
- memo[stopWord] = stopWord
- return memo
- }, {})
-
- return function (token) {
- if (token && words[token.toString()] !== token.toString()) return token
- }
-}
-
-/**
- * lunr.stopWordFilter is an English language stop word list filter, any words
- * contained in the list will not be passed through the filter.
- *
- * This is intended to be used in the Pipeline. If the token does not pass the
- * filter then undefined will be returned.
- *
- * @implements {lunr.PipelineFunction}
- * @params {lunr.Token} token - A token to check for being a stop word.
- * @returns {lunr.Token}
- * @see {@link lunr.Pipeline}
- */
-lunr.stopWordFilter = lunr.generateStopWordFilter([
- 'a',
- 'able',
- 'about',
- 'across',
- 'after',
- 'all',
- 'almost',
- 'also',
- 'am',
- 'among',
- 'an',
- 'and',
- 'any',
- 'are',
- 'as',
- 'at',
- 'be',
- 'because',
- 'been',
- 'but',
- 'by',
- 'can',
- 'cannot',
- 'could',
- 'dear',
- 'did',
- 'do',
- 'does',
- 'either',
- 'else',
- 'ever',
- 'every',
- 'for',
- 'from',
- 'get',
- 'got',
- 'had',
- 'has',
- 'have',
- 'he',
- 'her',
- 'hers',
- 'him',
- 'his',
- 'how',
- 'however',
- 'i',
- 'if',
- 'in',
- 'into',
- 'is',
- 'it',
- 'its',
- 'just',
- 'least',
- 'let',
- 'like',
- 'likely',
- 'may',
- 'me',
- 'might',
- 'most',
- 'must',
- 'my',
- 'neither',
- 'no',
- 'nor',
- 'not',
- 'of',
- 'off',
- 'often',
- 'on',
- 'only',
- 'or',
- 'other',
- 'our',
- 'own',
- 'rather',
- 'said',
- 'say',
- 'says',
- 'she',
- 'should',
- 'since',
- 'so',
- 'some',
- 'than',
- 'that',
- 'the',
- 'their',
- 'them',
- 'then',
- 'there',
- 'these',
- 'they',
- 'this',
- 'tis',
- 'to',
- 'too',
- 'twas',
- 'us',
- 'wants',
- 'was',
- 'we',
- 'were',
- 'what',
- 'when',
- 'where',
- 'which',
- 'while',
- 'who',
- 'whom',
- 'why',
- 'will',
- 'with',
- 'would',
- 'yet',
- 'you',
- 'your'
-])
-
-lunr.Pipeline.registerFunction(lunr.stopWordFilter, 'stopWordFilter')
-/*!
- * lunr.trimmer
- * Copyright (C) 2018 Oliver Nightingale
- */
-
-/**
- * lunr.trimmer is a pipeline function for trimming non word
- * characters from the beginning and end of tokens before they
- * enter the index.
- *
- * This implementation may not work correctly for non latin
- * characters and should either be removed or adapted for use
- * with languages with non-latin characters.
- *
- * @static
- * @implements {lunr.PipelineFunction}
- * @param {lunr.Token} token The token to pass through the filter
- * @returns {lunr.Token}
- * @see lunr.Pipeline
- */
-lunr.trimmer = function (token) {
- return token.update(function (s) {
- return s.replace(/^\W+/, '').replace(/\W+$/, '')
- })
-}
-
-lunr.Pipeline.registerFunction(lunr.trimmer, 'trimmer')
-/*!
- * lunr.TokenSet
- * Copyright (C) 2018 Oliver Nightingale
- */
-
-/**
- * A token set is used to store the unique list of all tokens
- * within an index. Token sets are also used to represent an
- * incoming query to the index, this query token set and index
- * token set are then intersected to find which tokens to look
- * up in the inverted index.
- *
- * A token set can hold multiple tokens, as in the case of the
- * index token set, or it can hold a single token as in the
- * case of a simple query token set.
- *
- * Additionally token sets are used to perform wildcard matching.
- * Leading, contained and trailing wildcards are supported, and
- * from this edit distance matching can also be provided.
- *
- * Token sets are implemented as a minimal finite state automata,
- * where both common prefixes and suffixes are shared between tokens.
- * This helps to reduce the space used for storing the token set.
- *
- * @constructor
- */
-lunr.TokenSet = function () {
- this.final = false
- this.edges = {}
- this.id = lunr.TokenSet._nextId
- lunr.TokenSet._nextId += 1
-}
-
-/**
- * Keeps track of the next, auto increment, identifier to assign
- * to a new tokenSet.
- *
- * TokenSets require a unique identifier to be correctly minimised.
- *
- * @private
- */
-lunr.TokenSet._nextId = 1
-
-/**
- * Creates a TokenSet instance from the given sorted array of words.
- *
- * @param {String[]} arr - A sorted array of strings to create the set from.
- * @returns {lunr.TokenSet}
- * @throws Will throw an error if the input array is not sorted.
- */
-lunr.TokenSet.fromArray = function (arr) {
- var builder = new lunr.TokenSet.Builder
-
- for (var i = 0, len = arr.length; i < len; i++) {
- builder.insert(arr[i])
- }
-
- builder.finish()
- return builder.root
-}
-
-/**
- * Creates a token set from a query clause.
- *
- * @private
- * @param {Object} clause - A single clause from lunr.Query.
- * @param {string} clause.term - The query clause term.
- * @param {number} [clause.editDistance] - The optional edit distance for the term.
- * @returns {lunr.TokenSet}
- */
-lunr.TokenSet.fromClause = function (clause) {
- if ('editDistance' in clause) {
- return lunr.TokenSet.fromFuzzyString(clause.term, clause.editDistance)
- } else {
- return lunr.TokenSet.fromString(clause.term)
- }
-}
-
-/**
- * Creates a token set representing a single string with a specified
- * edit distance.
- *
- * Insertions, deletions, substitutions and transpositions are each
- * treated as an edit distance of 1.
- *
- * Increasing the allowed edit distance will have a dramatic impact
- * on the performance of both creating and intersecting these TokenSets.
- * It is advised to keep the edit distance less than 3.
- *
- * @param {string} str - The string to create the token set from.
- * @param {number} editDistance - The allowed edit distance to match.
- * @returns {lunr.Vector}
- */
-lunr.TokenSet.fromFuzzyString = function (str, editDistance) {
- var root = new lunr.TokenSet
-
- var stack = [{
- node: root,
- editsRemaining: editDistance,
- str: str
- }]
-
- while (stack.length) {
- var frame = stack.pop()
-
- // no edit
- if (frame.str.length > 0) {
- var char = frame.str.charAt(0),
- noEditNode
-
- if (char in frame.node.edges) {
- noEditNode = frame.node.edges[char]
- } else {
- noEditNode = new lunr.TokenSet
- frame.node.edges[char] = noEditNode
- }
-
- if (frame.str.length == 1) {
- noEditNode.final = true
- } else {
- stack.push({
- node: noEditNode,
- editsRemaining: frame.editsRemaining,
- str: frame.str.slice(1)
- })
- }
- }
-
- // deletion
- // can only do a deletion if we have enough edits remaining
- // and if there are characters left to delete in the string
- if (frame.editsRemaining > 0 && frame.str.length > 1) {
- var char = frame.str.charAt(1),
- deletionNode
-
- if (char in frame.node.edges) {
- deletionNode = frame.node.edges[char]
- } else {
- deletionNode = new lunr.TokenSet
- frame.node.edges[char] = deletionNode
- }
-
- if (frame.str.length <= 2) {
- deletionNode.final = true
- } else {
- stack.push({
- node: deletionNode,
- editsRemaining: frame.editsRemaining - 1,
- str: frame.str.slice(2)
- })
- }
- }
-
- // deletion
- // just removing the last character from the str
- if (frame.editsRemaining > 0 && frame.str.length == 1) {
- frame.node.final = true
- }
-
- // substitution
- // can only do a substitution if we have enough edits remaining
- // and if there are characters left to substitute
- if (frame.editsRemaining > 0 && frame.str.length >= 1) {
- if ("*" in frame.node.edges) {
- var substitutionNode = frame.node.edges["*"]
- } else {
- var substitutionNode = new lunr.TokenSet
- frame.node.edges["*"] = substitutionNode
- }
-
- if (frame.str.length == 1) {
- substitutionNode.final = true
- } else {
- stack.push({
- node: substitutionNode,
- editsRemaining: frame.editsRemaining - 1,
- str: frame.str.slice(1)
- })
- }
- }
-
- // insertion
- // can only do insertion if there are edits remaining
- if (frame.editsRemaining > 0) {
- if ("*" in frame.node.edges) {
- var insertionNode = frame.node.edges["*"]
- } else {
- var insertionNode = new lunr.TokenSet
- frame.node.edges["*"] = insertionNode
- }
-
- if (frame.str.length == 0) {
- insertionNode.final = true
- } else {
- stack.push({
- node: insertionNode,
- editsRemaining: frame.editsRemaining - 1,
- str: frame.str
- })
- }
- }
-
- // transposition
- // can only do a transposition if there are edits remaining
- // and there are enough characters to transpose
- if (frame.editsRemaining > 0 && frame.str.length > 1) {
- var charA = frame.str.charAt(0),
- charB = frame.str.charAt(1),
- transposeNode
-
- if (charB in frame.node.edges) {
- transposeNode = frame.node.edges[charB]
- } else {
- transposeNode = new lunr.TokenSet
- frame.node.edges[charB] = transposeNode
- }
-
- if (frame.str.length == 1) {
- transposeNode.final = true
- } else {
- stack.push({
- node: transposeNode,
- editsRemaining: frame.editsRemaining - 1,
- str: charA + frame.str.slice(2)
- })
- }
- }
- }
-
- return root
-}
-
-/**
- * Creates a TokenSet from a string.
- *
- * The string may contain one or more wildcard characters (*)
- * that will allow wildcard matching when intersecting with
- * another TokenSet.
- *
- * @param {string} str - The string to create a TokenSet from.
- * @returns {lunr.TokenSet}
- */
-lunr.TokenSet.fromString = function (str) {
- var node = new lunr.TokenSet,
- root = node,
- wildcardFound = false
-
- /*
- * Iterates through all characters within the passed string
- * appending a node for each character.
- *
- * As soon as a wildcard character is found then a self
- * referencing edge is introduced to continually match
- * any number of any characters.
- */
- for (var i = 0, len = str.length; i < len; i++) {
- var char = str[i],
- final = (i == len - 1)
-
- if (char == "*") {
- wildcardFound = true
- node.edges[char] = node
- node.final = final
-
- } else {
- var next = new lunr.TokenSet
- next.final = final
-
- node.edges[char] = next
- node = next
-
- // TODO: is this needed anymore?
- if (wildcardFound) {
- node.edges["*"] = root
- }
- }
- }
-
- return root
-}
-
-/**
- * Converts this TokenSet into an array of strings
- * contained within the TokenSet.
- *
- * @returns {string[]}
- */
-lunr.TokenSet.prototype.toArray = function () {
- var words = []
-
- var stack = [{
- prefix: "",
- node: this
- }]
-
- while (stack.length) {
- var frame = stack.pop(),
- edges = Object.keys(frame.node.edges),
- len = edges.length
-
- if (frame.node.final) {
- words.push(frame.prefix)
- }
-
- for (var i = 0; i < len; i++) {
- var edge = edges[i]
-
- stack.push({
- prefix: frame.prefix.concat(edge),
- node: frame.node.edges[edge]
- })
- }
- }
-
- return words
-}
-
-/**
- * Generates a string representation of a TokenSet.
- *
- * This is intended to allow TokenSets to be used as keys
- * in objects, largely to aid the construction and minimisation
- * of a TokenSet. As such it is not designed to be a human
- * friendly representation of the TokenSet.
- *
- * @returns {string}
- */
-lunr.TokenSet.prototype.toString = function () {
- // NOTE: Using Object.keys here as this.edges is very likely
- // to enter 'hash-mode' with many keys being added
- //
- // avoiding a for-in loop here as it leads to the function
- // being de-optimised (at least in V8). From some simple
- // benchmarks the performance is comparable, but allowing
- // V8 to optimize may mean easy performance wins in the future.
-
- if (this._str) {
- return this._str
- }
-
- var str = this.final ? '1' : '0',
- labels = Object.keys(this.edges).sort(),
- len = labels.length
-
- for (var i = 0; i < len; i++) {
- var label = labels[i],
- node = this.edges[label]
-
- str = str + label + node.id
- }
-
- return str
-}
-
-/**
- * Returns a new TokenSet that is the intersection of
- * this TokenSet and the passed TokenSet.
- *
- * This intersection will take into account any wildcards
- * contained within the TokenSet.
- *
- * @param {lunr.TokenSet} b - An other TokenSet to intersect with.
- * @returns {lunr.TokenSet}
- */
-lunr.TokenSet.prototype.intersect = function (b) {
- var output = new lunr.TokenSet,
- frame = undefined
-
- var stack = [{
- qNode: b,
- output: output,
- node: this
- }]
-
- while (stack.length) {
- frame = stack.pop()
-
- // NOTE: As with the #toString method, we are using
- // Object.keys and a for loop instead of a for-in loop
- // as both of these objects enter 'hash' mode, causing
- // the function to be de-optimised in V8
- var qEdges = Object.keys(frame.qNode.edges),
- qLen = qEdges.length,
- nEdges = Object.keys(frame.node.edges),
- nLen = nEdges.length
-
- for (var q = 0; q < qLen; q++) {
- var qEdge = qEdges[q]
-
- for (var n = 0; n < nLen; n++) {
- var nEdge = nEdges[n]
-
- if (nEdge == qEdge || qEdge == '*') {
- var node = frame.node.edges[nEdge],
- qNode = frame.qNode.edges[qEdge],
- final = node.final && qNode.final,
- next = undefined
-
- if (nEdge in frame.output.edges) {
- // an edge already exists for this character
- // no need to create a new node, just set the finality
- // bit unless this node is already final
- next = frame.output.edges[nEdge]
- next.final = next.final || final
-
- } else {
- // no edge exists yet, must create one
- // set the finality bit and insert it
- // into the output
- next = new lunr.TokenSet
- next.final = final
- frame.output.edges[nEdge] = next
- }
-
- stack.push({
- qNode: qNode,
- output: next,
- node: node
- })
- }
- }
- }
- }
-
- return output
-}
-lunr.TokenSet.Builder = function () {
- this.previousWord = ""
- this.root = new lunr.TokenSet
- this.uncheckedNodes = []
- this.minimizedNodes = {}
-}
-
-lunr.TokenSet.Builder.prototype.insert = function (word) {
- var node,
- commonPrefix = 0
-
- if (word < this.previousWord) {
- throw new Error ("Out of order word insertion")
- }
-
- for (var i = 0; i < word.length && i < this.previousWord.length; i++) {
- if (word[i] != this.previousWord[i]) break
- commonPrefix++
- }
-
- this.minimize(commonPrefix)
-
- if (this.uncheckedNodes.length == 0) {
- node = this.root
- } else {
- node = this.uncheckedNodes[this.uncheckedNodes.length - 1].child
- }
-
- for (var i = commonPrefix; i < word.length; i++) {
- var nextNode = new lunr.TokenSet,
- char = word[i]
-
- node.edges[char] = nextNode
-
- this.uncheckedNodes.push({
- parent: node,
- char: char,
- child: nextNode
- })
-
- node = nextNode
- }
-
- node.final = true
- this.previousWord = word
-}
-
-lunr.TokenSet.Builder.prototype.finish = function () {
- this.minimize(0)
-}
-
-lunr.TokenSet.Builder.prototype.minimize = function (downTo) {
- for (var i = this.uncheckedNodes.length - 1; i >= downTo; i--) {
- var node = this.uncheckedNodes[i],
- childKey = node.child.toString()
-
- if (childKey in this.minimizedNodes) {
- node.parent.edges[node.char] = this.minimizedNodes[childKey]
- } else {
- // Cache the key for this node since
- // we know it can't change anymore
- node.child._str = childKey
-
- this.minimizedNodes[childKey] = node.child
- }
-
- this.uncheckedNodes.pop()
- }
-}
-/*!
- * lunr.Index
- * Copyright (C) 2018 Oliver Nightingale
- */
-
-/**
- * An index contains the built index of all documents and provides a query interface
- * to the index.
- *
- * Usually instances of lunr.Index will not be created using this constructor, instead
- * lunr.Builder should be used to construct new indexes, or lunr.Index.load should be
- * used to load previously built and serialized indexes.
- *
- * @constructor
- * @param {Object} attrs - The attributes of the built search index.
- * @param {Object} attrs.invertedIndex - An index of term/field to document reference.
- * @param {Object} attrs.documentVectors - Document vectors keyed by document reference.
- * @param {lunr.TokenSet} attrs.tokenSet - An set of all corpus tokens.
- * @param {string[]} attrs.fields - The names of indexed document fields.
- * @param {lunr.Pipeline} attrs.pipeline - The pipeline to use for search terms.
- */
-lunr.Index = function (attrs) {
- this.invertedIndex = attrs.invertedIndex
- this.fieldVectors = attrs.fieldVectors
- this.tokenSet = attrs.tokenSet
- this.fields = attrs.fields
- this.pipeline = attrs.pipeline
-}
-
-/**
- * A result contains details of a document matching a search query.
- * @typedef {Object} lunr.Index~Result
- * @property {string} ref - The reference of the document this result represents.
- * @property {number} score - A number between 0 and 1 representing how similar this document is to the query.
- * @property {lunr.MatchData} matchData - Contains metadata about this match including which term(s) caused the match.
- */
-
-/**
- * Although lunr provides the ability to create queries using lunr.Query, it also provides a simple
- * query language which itself is parsed into an instance of lunr.Query.
- *
- * For programmatically building queries it is advised to directly use lunr.Query, the query language
- * is best used for human entered text rather than program generated text.
- *
- * At its simplest queries can just be a single term, e.g. `hello`, multiple terms are also supported
- * and will be combined with OR, e.g `hello world` will match documents that contain either 'hello'
- * or 'world', though those that contain both will rank higher in the results.
- *
- * Wildcards can be included in terms to match one or more unspecified characters, these wildcards can
- * be inserted anywhere within the term, and more than one wildcard can exist in a single term. Adding
- * wildcards will increase the number of documents that will be found but can also have a negative
- * impact on query performance, especially with wildcards at the beginning of a term.
- *
- * Terms can be restricted to specific fields, e.g. `title:hello`, only documents with the term
- * hello in the title field will match this query. Using a field not present in the index will lead
- * to an error being thrown.
- *
- * Modifiers can also be added to terms, lunr supports edit distance and boost modifiers on terms. A term
- * boost will make documents matching that term score higher, e.g. `foo^5`. Edit distance is also supported
- * to provide fuzzy matching, e.g. 'hello~2' will match documents with hello with an edit distance of 2.
- * Avoid large values for edit distance to improve query performance.
- *
- * To escape special characters the backslash character '\' can be used, this allows searches to include
- * characters that would normally be considered modifiers, e.g. `foo\~2` will search for a term "foo~2" instead
- * of attempting to apply a boost of 2 to the search term "foo".
- *
- * @typedef {string} lunr.Index~QueryString
- * @example Simple single term query
- * hello
- * @example Multiple term query
- * hello world
- * @example term scoped to a field
- * title:hello
- * @example term with a boost of 10
- * hello^10
- * @example term with an edit distance of 2
- * hello~2
- */
-
-/**
- * Performs a search against the index using lunr query syntax.
- *
- * Results will be returned sorted by their score, the most relevant results
- * will be returned first.
- *
- * For more programmatic querying use lunr.Index#query.
- *
- * @param {lunr.Index~QueryString} queryString - A string containing a lunr query.
- * @throws {lunr.QueryParseError} If the passed query string cannot be parsed.
- * @returns {lunr.Index~Result[]}
- */
-lunr.Index.prototype.search = function (queryString) {
- return this.query(function (query) {
- var parser = new lunr.QueryParser(queryString, query)
- parser.parse()
- })
-}
-
-/**
- * A query builder callback provides a query object to be used to express
- * the query to perform on the index.
- *
- * @callback lunr.Index~queryBuilder
- * @param {lunr.Query} query - The query object to build up.
- * @this lunr.Query
- */
-
-/**
- * Performs a query against the index using the yielded lunr.Query object.
- *
- * If performing programmatic queries against the index, this method is preferred
- * over lunr.Index#search so as to avoid the additional query parsing overhead.
- *
- * A query object is yielded to the supplied function which should be used to
- * express the query to be run against the index.
- *
- * Note that although this function takes a callback parameter it is _not_ an
- * asynchronous operation, the callback is just yielded a query object to be
- * customized.
- *
- * @param {lunr.Index~queryBuilder} fn - A function that is used to build the query.
- * @returns {lunr.Index~Result[]}
- */
-lunr.Index.prototype.query = function (fn) {
- // for each query clause
- // * process terms
- // * expand terms from token set
- // * find matching documents and metadata
- // * get document vectors
- // * score documents
-
- var query = new lunr.Query(this.fields),
- matchingFields = Object.create(null),
- queryVectors = Object.create(null),
- termFieldCache = Object.create(null)
-
- fn.call(query, query)
-
- for (var i = 0; i < query.clauses.length; i++) {
- /*
- * Unless the pipeline has been disabled for this term, which is
- * the case for terms with wildcards, we need to pass the clause
- * term through the search pipeline. A pipeline returns an array
- * of processed terms. Pipeline functions may expand the passed
- * term, which means we may end up performing multiple index lookups
- * for a single query term.
- */
- var clause = query.clauses[i],
- terms = null
-
- if (clause.usePipeline) {
- terms = this.pipeline.runString(clause.term)
- } else {
- terms = [clause.term]
- }
-
- for (var m = 0; m < terms.length; m++) {
- var term = terms[m]
-
- /*
- * Each term returned from the pipeline needs to use the same query
- * clause object, e.g. the same boost and or edit distance. The
- * simplest way to do this is to re-use the clause object but mutate
- * its term property.
- */
- clause.term = term
-
- /*
- * From the term in the clause we create a token set which will then
- * be used to intersect the indexes token set to get a list of terms
- * to lookup in the inverted index
- */
- var termTokenSet = lunr.TokenSet.fromClause(clause),
- expandedTerms = this.tokenSet.intersect(termTokenSet).toArray()
-
- for (var j = 0; j < expandedTerms.length; j++) {
- /*
- * For each term get the posting and termIndex, this is required for
- * building the query vector.
- */
- var expandedTerm = expandedTerms[j],
- posting = this.invertedIndex[expandedTerm],
- termIndex = posting._index
-
- for (var k = 0; k < clause.fields.length; k++) {
- /*
- * For each field that this query term is scoped by (by default
- * all fields are in scope) we need to get all the document refs
- * that have this term in that field.
- *
- * The posting is the entry in the invertedIndex for the matching
- * term from above.
- */
- var field = clause.fields[k],
- fieldPosting = posting[field],
- matchingDocumentRefs = Object.keys(fieldPosting),
- termField = expandedTerm + "/" + field
-
- /*
- * To support field level boosts a query vector is created per
- * field. This vector is populated using the termIndex found for
- * the term and a unit value with the appropriate boost applied.
- *
- * If the query vector for this field does not exist yet it needs
- * to be created.
- */
- if (queryVectors[field] === undefined) {
- queryVectors[field] = new lunr.Vector
- }
-
- /*
- * Using upsert because there could already be an entry in the vector
- * for the term we are working with. In that case we just add the scores
- * together.
- */
- queryVectors[field].upsert(termIndex, 1 * clause.boost, function (a, b) { return a + b })
-
- /**
- * If we've already seen this term, field combo then we've already collected
- * the matching documents and metadata, no need to go through all that again
- */
- if (termFieldCache[termField]) {
- continue
- }
-
- for (var l = 0; l < matchingDocumentRefs.length; l++) {
- /*
- * All metadata for this term/field/document triple
- * are then extracted and collected into an instance
- * of lunr.MatchData ready to be returned in the query
- * results
- */
- var matchingDocumentRef = matchingDocumentRefs[l],
- matchingFieldRef = new lunr.FieldRef (matchingDocumentRef, field),
- metadata = fieldPosting[matchingDocumentRef],
- fieldMatch
-
- if ((fieldMatch = matchingFields[matchingFieldRef]) === undefined) {
- matchingFields[matchingFieldRef] = new lunr.MatchData (expandedTerm, field, metadata)
- } else {
- fieldMatch.add(expandedTerm, field, metadata)
- }
-
- }
-
- termFieldCache[termField] = true
- }
- }
- }
- }
-
- var matchingFieldRefs = Object.keys(matchingFields),
- results = [],
- matches = Object.create(null)
-
- for (var i = 0; i < matchingFieldRefs.length; i++) {
- /*
- * Currently we have document fields that match the query, but we
- * need to return documents. The matchData and scores are combined
- * from multiple fields belonging to the same document.
- *
- * Scores are calculated by field, using the query vectors created
- * above, and combined into a final document score using addition.
- */
- var fieldRef = lunr.FieldRef.fromString(matchingFieldRefs[i]),
- docRef = fieldRef.docRef,
- fieldVector = this.fieldVectors[fieldRef],
- score = queryVectors[fieldRef.fieldName].similarity(fieldVector),
- docMatch
-
- if ((docMatch = matches[docRef]) !== undefined) {
- docMatch.score += score
- docMatch.matchData.combine(matchingFields[fieldRef])
- } else {
- var match = {
- ref: docRef,
- score: score,
- matchData: matchingFields[fieldRef]
- }
- matches[docRef] = match
- results.push(match)
- }
- }
-
- /*
- * Sort the results objects by score, highest first.
- */
- return results.sort(function (a, b) {
- return b.score - a.score
- })
-}
-
-/**
- * Prepares the index for JSON serialization.
- *
- * The schema for this JSON blob will be described in a
- * separate JSON schema file.
- *
- * @returns {Object}
- */
-lunr.Index.prototype.toJSON = function () {
- var invertedIndex = Object.keys(this.invertedIndex)
- .sort()
- .map(function (term) {
- return [term, this.invertedIndex[term]]
- }, this)
-
- var fieldVectors = Object.keys(this.fieldVectors)
- .map(function (ref) {
- return [ref, this.fieldVectors[ref].toJSON()]
- }, this)
-
- return {
- version: lunr.version,
- fields: this.fields,
- fieldVectors: fieldVectors,
- invertedIndex: invertedIndex,
- pipeline: this.pipeline.toJSON()
- }
-}
-
-/**
- * Loads a previously serialized lunr.Index
- *
- * @param {Object} serializedIndex - A previously serialized lunr.Index
- * @returns {lunr.Index}
- */
-lunr.Index.load = function (serializedIndex) {
- var attrs = {},
- fieldVectors = {},
- serializedVectors = serializedIndex.fieldVectors,
- invertedIndex = {},
- serializedInvertedIndex = serializedIndex.invertedIndex,
- tokenSetBuilder = new lunr.TokenSet.Builder,
- pipeline = lunr.Pipeline.load(serializedIndex.pipeline)
-
- if (serializedIndex.version != lunr.version) {
- lunr.utils.warn("Version mismatch when loading serialised index. Current version of lunr '" + lunr.version + "' does not match serialized index '" + serializedIndex.version + "'")
- }
-
- for (var i = 0; i < serializedVectors.length; i++) {
- var tuple = serializedVectors[i],
- ref = tuple[0],
- elements = tuple[1]
-
- fieldVectors[ref] = new lunr.Vector(elements)
- }
-
- for (var i = 0; i < serializedInvertedIndex.length; i++) {
- var tuple = serializedInvertedIndex[i],
- term = tuple[0],
- posting = tuple[1]
-
- tokenSetBuilder.insert(term)
- invertedIndex[term] = posting
- }
-
- tokenSetBuilder.finish()
-
- attrs.fields = serializedIndex.fields
-
- attrs.fieldVectors = fieldVectors
- attrs.invertedIndex = invertedIndex
- attrs.tokenSet = tokenSetBuilder.root
- attrs.pipeline = pipeline
-
- return new lunr.Index(attrs)
-}
-/*!
- * lunr.Builder
- * Copyright (C) 2018 Oliver Nightingale
- */
-
-/**
- * lunr.Builder performs indexing on a set of documents and
- * returns instances of lunr.Index ready for querying.
- *
- * All configuration of the index is done via the builder, the
- * fields to index, the document reference, the text processing
- * pipeline and document scoring parameters are all set on the
- * builder before indexing.
- *
- * @constructor
- * @property {string} _ref - Internal reference to the document reference field.
- * @property {string[]} _fields - Internal reference to the document fields to index.
- * @property {object} invertedIndex - The inverted index maps terms to document fields.
- * @property {object} documentTermFrequencies - Keeps track of document term frequencies.
- * @property {object} documentLengths - Keeps track of the length of documents added to the index.
- * @property {lunr.tokenizer} tokenizer - Function for splitting strings into tokens for indexing.
- * @property {lunr.Pipeline} pipeline - The pipeline performs text processing on tokens before indexing.
- * @property {lunr.Pipeline} searchPipeline - A pipeline for processing search terms before querying the index.
- * @property {number} documentCount - Keeps track of the total number of documents indexed.
- * @property {number} _b - A parameter to control field length normalization, setting this to 0 disabled normalization, 1 fully normalizes field lengths, the default value is 0.75.
- * @property {number} _k1 - A parameter to control how quickly an increase in term frequency results in term frequency saturation, the default value is 1.2.
- * @property {number} termIndex - A counter incremented for each unique term, used to identify a terms position in the vector space.
- * @property {array} metadataWhitelist - A list of metadata keys that have been whitelisted for entry in the index.
- */
-lunr.Builder = function () {
- this._ref = "id"
- this._fields = []
- this.invertedIndex = Object.create(null)
- this.fieldTermFrequencies = {}
- this.fieldLengths = {}
- this.tokenizer = lunr.tokenizer
- this.pipeline = new lunr.Pipeline
- this.searchPipeline = new lunr.Pipeline
- this.documentCount = 0
- this._b = 0.75
- this._k1 = 1.2
- this.termIndex = 0
- this.metadataWhitelist = []
-}
-
-/**
- * Sets the document field used as the document reference. Every document must have this field.
- * The type of this field in the document should be a string, if it is not a string it will be
- * coerced into a string by calling toString.
- *
- * The default ref is 'id'.
- *
- * The ref should _not_ be changed during indexing, it should be set before any documents are
- * added to the index. Changing it during indexing can lead to inconsistent results.
- *
- * @param {string} ref - The name of the reference field in the document.
- */
-lunr.Builder.prototype.ref = function (ref) {
- this._ref = ref
-}
-
-/**
- * Adds a field to the list of document fields that will be indexed. Every document being
- * indexed should have this field. Null values for this field in indexed documents will
- * not cause errors but will limit the chance of that document being retrieved by searches.
- *
- * All fields should be added before adding documents to the index. Adding fields after
- * a document has been indexed will have no effect on already indexed documents.
- *
- * @param {string} field - The name of a field to index in all documents.
- */
-lunr.Builder.prototype.field = function (field) {
- this._fields.push(field)
-}
-
-/**
- * A parameter to tune the amount of field length normalisation that is applied when
- * calculating relevance scores. A value of 0 will completely disable any normalisation
- * and a value of 1 will fully normalise field lengths. The default is 0.75. Values of b
- * will be clamped to the range 0 - 1.
- *
- * @param {number} number - The value to set for this tuning parameter.
- */
-lunr.Builder.prototype.b = function (number) {
- if (number < 0) {
- this._b = 0
- } else if (number > 1) {
- this._b = 1
- } else {
- this._b = number
- }
-}
-
-/**
- * A parameter that controls the speed at which a rise in term frequency results in term
- * frequency saturation. The default value is 1.2. Setting this to a higher value will give
- * slower saturation levels, a lower value will result in quicker saturation.
- *
- * @param {number} number - The value to set for this tuning parameter.
- */
-lunr.Builder.prototype.k1 = function (number) {
- this._k1 = number
-}
-
-/**
- * Adds a document to the index.
- *
- * Before adding fields to the index the index should have been fully setup, with the document
- * ref and all fields to index already having been specified.
- *
- * The document must have a field name as specified by the ref (by default this is 'id') and
- * it should have all fields defined for indexing, though null or undefined values will not
- * cause errors.
- *
- * @param {object} doc - The document to add to the index.
- */
-lunr.Builder.prototype.add = function (doc) {
- var docRef = doc[this._ref]
-
- this.documentCount += 1
-
- for (var i = 0; i < this._fields.length; i++) {
- var fieldName = this._fields[i],
- field = doc[fieldName],
- tokens = this.tokenizer(field),
- terms = this.pipeline.run(tokens),
- fieldRef = new lunr.FieldRef (docRef, fieldName),
- fieldTerms = Object.create(null)
-
- this.fieldTermFrequencies[fieldRef] = fieldTerms
- this.fieldLengths[fieldRef] = 0
-
- // store the length of this field for this document
- this.fieldLengths[fieldRef] += terms.length
-
- // calculate term frequencies for this field
- for (var j = 0; j < terms.length; j++) {
- var term = terms[j]
-
- if (fieldTerms[term] == undefined) {
- fieldTerms[term] = 0
- }
-
- fieldTerms[term] += 1
-
- // add to inverted index
- // create an initial posting if one doesn't exist
- if (this.invertedIndex[term] == undefined) {
- var posting = Object.create(null)
- posting["_index"] = this.termIndex
- this.termIndex += 1
-
- for (var k = 0; k < this._fields.length; k++) {
- posting[this._fields[k]] = Object.create(null)
- }
-
- this.invertedIndex[term] = posting
- }
-
- // add an entry for this term/fieldName/docRef to the invertedIndex
- if (this.invertedIndex[term][fieldName][docRef] == undefined) {
- this.invertedIndex[term][fieldName][docRef] = Object.create(null)
- }
-
- // store all whitelisted metadata about this token in the
- // inverted index
- for (var l = 0; l < this.metadataWhitelist.length; l++) {
- var metadataKey = this.metadataWhitelist[l],
- metadata = term.metadata[metadataKey]
-
- if (this.invertedIndex[term][fieldName][docRef][metadataKey] == undefined) {
- this.invertedIndex[term][fieldName][docRef][metadataKey] = []
- }
-
- this.invertedIndex[term][fieldName][docRef][metadataKey].push(metadata)
- }
- }
-
- }
-}
-
-/**
- * Calculates the average document length for this index
- *
- * @private
- */
-lunr.Builder.prototype.calculateAverageFieldLengths = function () {
-
- var fieldRefs = Object.keys(this.fieldLengths),
- numberOfFields = fieldRefs.length,
- accumulator = {},
- documentsWithField = {}
-
- for (var i = 0; i < numberOfFields; i++) {
- var fieldRef = lunr.FieldRef.fromString(fieldRefs[i]),
- field = fieldRef.fieldName
-
- documentsWithField[field] || (documentsWithField[field] = 0)
- documentsWithField[field] += 1
-
- accumulator[field] || (accumulator[field] = 0)
- accumulator[field] += this.fieldLengths[fieldRef]
- }
-
- for (var i = 0; i < this._fields.length; i++) {
- var field = this._fields[i]
- accumulator[field] = accumulator[field] / documentsWithField[field]
- }
-
- this.averageFieldLength = accumulator
-}
-
-/**
- * Builds a vector space model of every document using lunr.Vector
- *
- * @private
- */
-lunr.Builder.prototype.createFieldVectors = function () {
- var fieldVectors = {},
- fieldRefs = Object.keys(this.fieldTermFrequencies),
- fieldRefsLength = fieldRefs.length,
- termIdfCache = Object.create(null)
-
- for (var i = 0; i < fieldRefsLength; i++) {
- var fieldRef = lunr.FieldRef.fromString(fieldRefs[i]),
- field = fieldRef.fieldName,
- fieldLength = this.fieldLengths[fieldRef],
- fieldVector = new lunr.Vector,
- termFrequencies = this.fieldTermFrequencies[fieldRef],
- terms = Object.keys(termFrequencies),
- termsLength = terms.length
-
- for (var j = 0; j < termsLength; j++) {
- var term = terms[j],
- tf = termFrequencies[term],
- termIndex = this.invertedIndex[term]._index,
- idf, score, scoreWithPrecision
-
- if (termIdfCache[term] === undefined) {
- idf = lunr.idf(this.invertedIndex[term], this.documentCount)
- termIdfCache[term] = idf
- } else {
- idf = termIdfCache[term]
- }
-
- score = idf * ((this._k1 + 1) * tf) / (this._k1 * (1 - this._b + this._b * (fieldLength / this.averageFieldLength[field])) + tf)
- scoreWithPrecision = Math.round(score * 1000) / 1000
- // Converts 1.23456789 to 1.234.
- // Reducing the precision so that the vectors take up less
- // space when serialised. Doing it now so that they behave
- // the same before and after serialisation. Also, this is
- // the fastest approach to reducing a number's precision in
- // JavaScript.
-
- fieldVector.insert(termIndex, scoreWithPrecision)
- }
-
- fieldVectors[fieldRef] = fieldVector
- }
-
- this.fieldVectors = fieldVectors
-}
-
-/**
- * Creates a token set of all tokens in the index using lunr.TokenSet
- *
- * @private
- */
-lunr.Builder.prototype.createTokenSet = function () {
- this.tokenSet = lunr.TokenSet.fromArray(
- Object.keys(this.invertedIndex).sort()
- )
-}
-
-/**
- * Builds the index, creating an instance of lunr.Index.
- *
- * This completes the indexing process and should only be called
- * once all documents have been added to the index.
- *
- * @returns {lunr.Index}
- */
-lunr.Builder.prototype.build = function () {
- this.calculateAverageFieldLengths()
- this.createFieldVectors()
- this.createTokenSet()
-
- return new lunr.Index({
- invertedIndex: this.invertedIndex,
- fieldVectors: this.fieldVectors,
- tokenSet: this.tokenSet,
- fields: this._fields,
- pipeline: this.searchPipeline
- })
-}
-
-/**
- * Applies a plugin to the index builder.
- *
- * A plugin is a function that is called with the index builder as its context.
- * Plugins can be used to customise or extend the behaviour of the index
- * in some way. A plugin is just a function, that encapsulated the custom
- * behaviour that should be applied when building the index.
- *
- * The plugin function will be called with the index builder as its argument, additional
- * arguments can also be passed when calling use. The function will be called
- * with the index builder as its context.
- *
- * @param {Function} plugin The plugin to apply.
- */
-lunr.Builder.prototype.use = function (fn) {
- var args = Array.prototype.slice.call(arguments, 1)
- args.unshift(this)
- fn.apply(this, args)
-}
-/**
- * Contains and collects metadata about a matching document.
- * A single instance of lunr.MatchData is returned as part of every
- * lunr.Index~Result.
- *
- * @constructor
- * @param {string} term - The term this match data is associated with
- * @param {string} field - The field in which the term was found
- * @param {object} metadata - The metadata recorded about this term in this field
- * @property {object} metadata - A cloned collection of metadata associated with this document.
- * @see {@link lunr.Index~Result}
- */
-lunr.MatchData = function (term, field, metadata) {
- var clonedMetadata = Object.create(null),
- metadataKeys = Object.keys(metadata)
-
- // Cloning the metadata to prevent the original
- // being mutated during match data combination.
- // Metadata is kept in an array within the inverted
- // index so cloning the data can be done with
- // Array#slice
- for (var i = 0; i < metadataKeys.length; i++) {
- var key = metadataKeys[i]
- clonedMetadata[key] = metadata[key].slice()
- }
-
- this.metadata = Object.create(null)
- this.metadata[term] = Object.create(null)
- this.metadata[term][field] = clonedMetadata
-}
-
-/**
- * An instance of lunr.MatchData will be created for every term that matches a
- * document. However only one instance is required in a lunr.Index~Result. This
- * method combines metadata from another instance of lunr.MatchData with this
- * objects metadata.
- *
- * @param {lunr.MatchData} otherMatchData - Another instance of match data to merge with this one.
- * @see {@link lunr.Index~Result}
- */
-lunr.MatchData.prototype.combine = function (otherMatchData) {
- var terms = Object.keys(otherMatchData.metadata)
-
- for (var i = 0; i < terms.length; i++) {
- var term = terms[i],
- fields = Object.keys(otherMatchData.metadata[term])
-
- if (this.metadata[term] == undefined) {
- this.metadata[term] = Object.create(null)
- }
-
- for (var j = 0; j < fields.length; j++) {
- var field = fields[j],
- keys = Object.keys(otherMatchData.metadata[term][field])
-
- if (this.metadata[term][field] == undefined) {
- this.metadata[term][field] = Object.create(null)
- }
-
- for (var k = 0; k < keys.length; k++) {
- var key = keys[k]
-
- if (this.metadata[term][field][key] == undefined) {
- this.metadata[term][field][key] = otherMatchData.metadata[term][field][key]
- } else {
- this.metadata[term][field][key] = this.metadata[term][field][key].concat(otherMatchData.metadata[term][field][key])
- }
-
- }
- }
- }
-}
-
-/**
- * Add metadata for a term/field pair to this instance of match data.
- *
- * @param {string} term - The term this match data is associated with
- * @param {string} field - The field in which the term was found
- * @param {object} metadata - The metadata recorded about this term in this field
- */
-lunr.MatchData.prototype.add = function (term, field, metadata) {
- if (!(term in this.metadata)) {
- this.metadata[term] = Object.create(null)
- this.metadata[term][field] = metadata
- return
- }
-
- if (!(field in this.metadata[term])) {
- this.metadata[term][field] = metadata
- return
- }
-
- var metadataKeys = Object.keys(metadata)
-
- for (var i = 0; i < metadataKeys.length; i++) {
- var key = metadataKeys[i]
-
- if (key in this.metadata[term][field]) {
- this.metadata[term][field][key] = this.metadata[term][field][key].concat(metadata[key])
- } else {
- this.metadata[term][field][key] = metadata[key]
- }
- }
-}
-/**
- * A lunr.Query provides a programmatic way of defining queries to be performed
- * against a {@link lunr.Index}.
- *
- * Prefer constructing a lunr.Query using the {@link lunr.Index#query} method
- * so the query object is pre-initialized with the right index fields.
- *
- * @constructor
- * @property {lunr.Query~Clause[]} clauses - An array of query clauses.
- * @property {string[]} allFields - An array of all available fields in a lunr.Index.
- */
-lunr.Query = function (allFields) {
- this.clauses = []
- this.allFields = allFields
-}
-
-/**
- * Constants for indicating what kind of automatic wildcard insertion will be used when constructing a query clause.
- *
- * This allows wildcards to be added to the beginning and end of a term without having to manually do any string
- * concatenation.
- *
- * The wildcard constants can be bitwise combined to select both leading and trailing wildcards.
- *
- * @constant
- * @default
- * @property {number} wildcard.NONE - The term will have no wildcards inserted, this is the default behaviour
- * @property {number} wildcard.LEADING - Prepend the term with a wildcard, unless a leading wildcard already exists
- * @property {number} wildcard.TRAILING - Append a wildcard to the term, unless a trailing wildcard already exists
- * @see lunr.Query~Clause
- * @see lunr.Query#clause
- * @see lunr.Query#term
- * @example query term with trailing wildcard
- * query.term('foo', { wildcard: lunr.Query.wildcard.TRAILING })
- * @example query term with leading and trailing wildcard
- * query.term('foo', {
- * wildcard: lunr.Query.wildcard.LEADING | lunr.Query.wildcard.TRAILING
- * })
- */
-lunr.Query.wildcard = new String ("*")
-lunr.Query.wildcard.NONE = 0
-lunr.Query.wildcard.LEADING = 1
-lunr.Query.wildcard.TRAILING = 2
-
-/**
- * A single clause in a {@link lunr.Query} contains a term and details on how to
- * match that term against a {@link lunr.Index}.
- *
- * @typedef {Object} lunr.Query~Clause
- * @property {string[]} fields - The fields in an index this clause should be matched against.
- * @property {number} [boost=1] - Any boost that should be applied when matching this clause.
- * @property {number} [editDistance] - Whether the term should have fuzzy matching applied, and how fuzzy the match should be.
- * @property {boolean} [usePipeline] - Whether the term should be passed through the search pipeline.
- * @property {number} [wildcard=0] - Whether the term should have wildcards appended or prepended.
- */
-
-/**
- * Adds a {@link lunr.Query~Clause} to this query.
- *
- * Unless the clause contains the fields to be matched all fields will be matched. In addition
- * a default boost of 1 is applied to the clause.
- *
- * @param {lunr.Query~Clause} clause - The clause to add to this query.
- * @see lunr.Query~Clause
- * @returns {lunr.Query}
- */
-lunr.Query.prototype.clause = function (clause) {
- if (!('fields' in clause)) {
- clause.fields = this.allFields
- }
-
- if (!('boost' in clause)) {
- clause.boost = 1
- }
-
- if (!('usePipeline' in clause)) {
- clause.usePipeline = true
- }
-
- if (!('wildcard' in clause)) {
- clause.wildcard = lunr.Query.wildcard.NONE
- }
-
- if ((clause.wildcard & lunr.Query.wildcard.LEADING) && (clause.term.charAt(0) != lunr.Query.wildcard)) {
- clause.term = "*" + clause.term
- }
-
- if ((clause.wildcard & lunr.Query.wildcard.TRAILING) && (clause.term.slice(-1) != lunr.Query.wildcard)) {
- clause.term = "" + clause.term + "*"
- }
-
- this.clauses.push(clause)
-
- return this
-}
-
-/**
- * Adds a term to the current query, under the covers this will create a {@link lunr.Query~Clause}
- * to the list of clauses that make up this query.
- *
- * @param {string} term - The term to add to the query.
- * @param {Object} [options] - Any additional properties to add to the query clause.
- * @returns {lunr.Query}
- * @see lunr.Query#clause
- * @see lunr.Query~Clause
- * @example adding a single term to a query
- * query.term("foo")
- * @example adding a single term to a query and specifying search fields, term boost and automatic trailing wildcard
- * query.term("foo", {
- * fields: ["title"],
- * boost: 10,
- * wildcard: lunr.Query.wildcard.TRAILING
- * })
- */
-lunr.Query.prototype.term = function (term, options) {
- var clause = options || {}
- clause.term = term
-
- this.clause(clause)
-
- return this
-}
-lunr.QueryParseError = function (message, start, end) {
- this.name = "QueryParseError"
- this.message = message
- this.start = start
- this.end = end
-}
-
-lunr.QueryParseError.prototype = new Error
-lunr.QueryLexer = function (str) {
- this.lexemes = []
- this.str = str
- this.length = str.length
- this.pos = 0
- this.start = 0
- this.escapeCharPositions = []
-}
-
-lunr.QueryLexer.prototype.run = function () {
- var state = lunr.QueryLexer.lexText
-
- while (state) {
- state = state(this)
- }
-}
-
-lunr.QueryLexer.prototype.sliceString = function () {
- var subSlices = [],
- sliceStart = this.start,
- sliceEnd = this.pos
-
- for (var i = 0; i < this.escapeCharPositions.length; i++) {
- sliceEnd = this.escapeCharPositions[i]
- subSlices.push(this.str.slice(sliceStart, sliceEnd))
- sliceStart = sliceEnd + 1
- }
-
- subSlices.push(this.str.slice(sliceStart, this.pos))
- this.escapeCharPositions.length = 0
-
- return subSlices.join('')
-}
-
-lunr.QueryLexer.prototype.emit = function (type) {
- this.lexemes.push({
- type: type,
- str: this.sliceString(),
- start: this.start,
- end: this.pos
- })
-
- this.start = this.pos
-}
-
-lunr.QueryLexer.prototype.escapeCharacter = function () {
- this.escapeCharPositions.push(this.pos - 1)
- this.pos += 1
-}
-
-lunr.QueryLexer.prototype.next = function () {
- if (this.pos >= this.length) {
- return lunr.QueryLexer.EOS
- }
-
- var char = this.str.charAt(this.pos)
- this.pos += 1
- return char
-}
-
-lunr.QueryLexer.prototype.width = function () {
- return this.pos - this.start
-}
-
-lunr.QueryLexer.prototype.ignore = function () {
- if (this.start == this.pos) {
- this.pos += 1
- }
-
- this.start = this.pos
-}
-
-lunr.QueryLexer.prototype.backup = function () {
- this.pos -= 1
-}
-
-lunr.QueryLexer.prototype.acceptDigitRun = function () {
- var char, charCode
-
- do {
- char = this.next()
- charCode = char.charCodeAt(0)
- } while (charCode > 47 && charCode < 58)
-
- if (char != lunr.QueryLexer.EOS) {
- this.backup()
- }
-}
-
-lunr.QueryLexer.prototype.more = function () {
- return this.pos < this.length
-}
-
-lunr.QueryLexer.EOS = 'EOS'
-lunr.QueryLexer.FIELD = 'FIELD'
-lunr.QueryLexer.TERM = 'TERM'
-lunr.QueryLexer.EDIT_DISTANCE = 'EDIT_DISTANCE'
-lunr.QueryLexer.BOOST = 'BOOST'
-
-lunr.QueryLexer.lexField = function (lexer) {
- lexer.backup()
- lexer.emit(lunr.QueryLexer.FIELD)
- lexer.ignore()
- return lunr.QueryLexer.lexText
-}
-
-lunr.QueryLexer.lexTerm = function (lexer) {
- if (lexer.width() > 1) {
- lexer.backup()
- lexer.emit(lunr.QueryLexer.TERM)
- }
-
- lexer.ignore()
-
- if (lexer.more()) {
- return lunr.QueryLexer.lexText
- }
-}
-
-lunr.QueryLexer.lexEditDistance = function (lexer) {
- lexer.ignore()
- lexer.acceptDigitRun()
- lexer.emit(lunr.QueryLexer.EDIT_DISTANCE)
- return lunr.QueryLexer.lexText
-}
-
-lunr.QueryLexer.lexBoost = function (lexer) {
- lexer.ignore()
- lexer.acceptDigitRun()
- lexer.emit(lunr.QueryLexer.BOOST)
- return lunr.QueryLexer.lexText
-}
-
-lunr.QueryLexer.lexEOS = function (lexer) {
- if (lexer.width() > 0) {
- lexer.emit(lunr.QueryLexer.TERM)
- }
-}
-
-// This matches the separator used when tokenising fields
-// within a document. These should match otherwise it is
-// not possible to search for some tokens within a document.
-//
-// It is possible for the user to change the separator on the
-// tokenizer so it _might_ clash with any other of the special
-// characters already used within the search string, e.g. :.
-//
-// This means that it is possible to change the separator in
-// such a way that makes some words unsearchable using a search
-// string.
-lunr.QueryLexer.termSeparator = lunr.tokenizer.separator
-
-lunr.QueryLexer.lexText = function (lexer) {
- while (true) {
- var char = lexer.next()
-
- if (char == lunr.QueryLexer.EOS) {
- return lunr.QueryLexer.lexEOS
- }
-
- // Escape character is '\'
- if (char.charCodeAt(0) == 92) {
- lexer.escapeCharacter()
- continue
- }
-
- if (char == ":") {
- return lunr.QueryLexer.lexField
- }
-
- if (char == "~") {
- lexer.backup()
- if (lexer.width() > 0) {
- lexer.emit(lunr.QueryLexer.TERM)
- }
- return lunr.QueryLexer.lexEditDistance
- }
-
- if (char == "^") {
- lexer.backup()
- if (lexer.width() > 0) {
- lexer.emit(lunr.QueryLexer.TERM)
- }
- return lunr.QueryLexer.lexBoost
- }
-
- if (char.match(lunr.QueryLexer.termSeparator)) {
- return lunr.QueryLexer.lexTerm
- }
- }
-}
-
-lunr.QueryParser = function (str, query) {
- this.lexer = new lunr.QueryLexer (str)
- this.query = query
- this.currentClause = {}
- this.lexemeIdx = 0
-}
-
-lunr.QueryParser.prototype.parse = function () {
- this.lexer.run()
- this.lexemes = this.lexer.lexemes
-
- var state = lunr.QueryParser.parseFieldOrTerm
-
- while (state) {
- state = state(this)
- }
-
- return this.query
-}
-
-lunr.QueryParser.prototype.peekLexeme = function () {
- return this.lexemes[this.lexemeIdx]
-}
-
-lunr.QueryParser.prototype.consumeLexeme = function () {
- var lexeme = this.peekLexeme()
- this.lexemeIdx += 1
- return lexeme
-}
-
-lunr.QueryParser.prototype.nextClause = function () {
- var completedClause = this.currentClause
- this.query.clause(completedClause)
- this.currentClause = {}
-}
-
-lunr.QueryParser.parseFieldOrTerm = function (parser) {
- var lexeme = parser.peekLexeme()
-
- if (lexeme == undefined) {
- return
- }
-
- switch (lexeme.type) {
- case lunr.QueryLexer.FIELD:
- return lunr.QueryParser.parseField
- case lunr.QueryLexer.TERM:
- return lunr.QueryParser.parseTerm
- default:
- var errorMessage = "expected either a field or a term, found " + lexeme.type
-
- if (lexeme.str.length >= 1) {
- errorMessage += " with value '" + lexeme.str + "'"
- }
-
- throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)
- }
-}
-
-lunr.QueryParser.parseField = function (parser) {
- var lexeme = parser.consumeLexeme()
-
- if (lexeme == undefined) {
- return
- }
-
- if (parser.query.allFields.indexOf(lexeme.str) == -1) {
- var possibleFields = parser.query.allFields.map(function (f) { return "'" + f + "'" }).join(', '),
- errorMessage = "unrecognised field '" + lexeme.str + "', possible fields: " + possibleFields
-
- throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)
- }
-
- parser.currentClause.fields = [lexeme.str]
-
- var nextLexeme = parser.peekLexeme()
-
- if (nextLexeme == undefined) {
- var errorMessage = "expecting term, found nothing"
- throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)
- }
-
- switch (nextLexeme.type) {
- case lunr.QueryLexer.TERM:
- return lunr.QueryParser.parseTerm
- default:
- var errorMessage = "expecting term, found '" + nextLexeme.type + "'"
- throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end)
- }
-}
-
-lunr.QueryParser.parseTerm = function (parser) {
- var lexeme = parser.consumeLexeme()
-
- if (lexeme == undefined) {
- return
- }
-
- parser.currentClause.term = lexeme.str.toLowerCase()
-
- if (lexeme.str.indexOf("*") != -1) {
- parser.currentClause.usePipeline = false
- }
-
- var nextLexeme = parser.peekLexeme()
-
- if (nextLexeme == undefined) {
- parser.nextClause()
- return
- }
-
- switch (nextLexeme.type) {
- case lunr.QueryLexer.TERM:
- parser.nextClause()
- return lunr.QueryParser.parseTerm
- case lunr.QueryLexer.FIELD:
- parser.nextClause()
- return lunr.QueryParser.parseField
- case lunr.QueryLexer.EDIT_DISTANCE:
- return lunr.QueryParser.parseEditDistance
- case lunr.QueryLexer.BOOST:
- return lunr.QueryParser.parseBoost
- default:
- var errorMessage = "Unexpected lexeme type '" + nextLexeme.type + "'"
- throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end)
- }
-}
-
-lunr.QueryParser.parseEditDistance = function (parser) {
- var lexeme = parser.consumeLexeme()
-
- if (lexeme == undefined) {
- return
- }
-
- var editDistance = parseInt(lexeme.str, 10)
-
- if (isNaN(editDistance)) {
- var errorMessage = "edit distance must be numeric"
- throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)
- }
-
- parser.currentClause.editDistance = editDistance
-
- var nextLexeme = parser.peekLexeme()
-
- if (nextLexeme == undefined) {
- parser.nextClause()
- return
- }
-
- switch (nextLexeme.type) {
- case lunr.QueryLexer.TERM:
- parser.nextClause()
- return lunr.QueryParser.parseTerm
- case lunr.QueryLexer.FIELD:
- parser.nextClause()
- return lunr.QueryParser.parseField
- case lunr.QueryLexer.EDIT_DISTANCE:
- return lunr.QueryParser.parseEditDistance
- case lunr.QueryLexer.BOOST:
- return lunr.QueryParser.parseBoost
- default:
- var errorMessage = "Unexpected lexeme type '" + nextLexeme.type + "'"
- throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end)
- }
-}
-
-lunr.QueryParser.parseBoost = function (parser) {
- var lexeme = parser.consumeLexeme()
-
- if (lexeme == undefined) {
- return
- }
-
- var boost = parseInt(lexeme.str, 10)
-
- if (isNaN(boost)) {
- var errorMessage = "boost must be numeric"
- throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)
- }
-
- parser.currentClause.boost = boost
-
- var nextLexeme = parser.peekLexeme()
-
- if (nextLexeme == undefined) {
- parser.nextClause()
- return
- }
-
- switch (nextLexeme.type) {
- case lunr.QueryLexer.TERM:
- parser.nextClause()
- return lunr.QueryParser.parseTerm
- case lunr.QueryLexer.FIELD:
- parser.nextClause()
- return lunr.QueryParser.parseField
- case lunr.QueryLexer.EDIT_DISTANCE:
- return lunr.QueryParser.parseEditDistance
- case lunr.QueryLexer.BOOST:
- return lunr.QueryParser.parseBoost
- default:
- var errorMessage = "Unexpected lexeme type '" + nextLexeme.type + "'"
- throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end)
- }
-}
-
- /**
- * export the module via AMD, CommonJS or as a browser global
- * Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
- */
- ;(function (root, factory) {
- if (typeof define === 'function' && define.amd) {
- // AMD. Register as an anonymous module.
- define(factory)
- } else if (typeof exports === 'object') {
- /**
- * Node. Does not work with strict CommonJS, but
- * only CommonJS-like enviroments that support module.exports,
- * like Node.
- */
- module.exports = factory()
- } else {
- // Browser globals (root is window)
- root.lunr = factory()
- }
- }(this, function () {
- /**
- * Just return a value to define the module export.
- * This example returns an object, but the module
- * can return a function as the exported value.
- */
- return lunr
- }))
-})();
diff --git a/site/search/main.js b/site/search/main.js
deleted file mode 100644
index 0a82ab5..0000000
--- a/site/search/main.js
+++ /dev/null
@@ -1,96 +0,0 @@
-function getSearchTermFromLocation() {
- var sPageURL = window.location.search.substring(1);
- var sURLVariables = sPageURL.split('&');
- for (var i = 0; i < sURLVariables.length; i++) {
- var sParameterName = sURLVariables[i].split('=');
- if (sParameterName[0] == 'q') {
- return decodeURIComponent(sParameterName[1].replace(/\+/g, '%20'));
- }
- }
-}
-
-function joinUrl (base, path) {
- if (path.substring(0, 1) === "/") {
- // path starts with `/`. Thus it is absolute.
- return path;
- }
- if (base.substring(base.length-1) === "/") {
- // base ends with `/`
- return base + path;
- }
- return base + "/" + path;
-}
-
-function formatResult (location, title, summary) {
- return '' + summary +'
';
-}
-
-function displayResults (results) {
- var search_results = document.getElementById("mkdocs-search-results");
- while (search_results.firstChild) {
- search_results.removeChild(search_results.firstChild);
- }
- if (results.length > 0){
- for (var i=0; i < results.length; i++){
- var result = results[i];
- var html = formatResult(result.location, result.title, result.summary);
- search_results.insertAdjacentHTML('beforeend', html);
- }
- } else {
- search_results.insertAdjacentHTML('beforeend', "No results found
");
- }
-}
-
-function doSearch () {
- var query = document.getElementById('mkdocs-search-query').value;
- if (query.length > 2) {
- if (!window.Worker) {
- displayResults(search(query));
- } else {
- searchWorker.postMessage({query: query});
- }
- } else {
- // Clear results for short queries
- displayResults([]);
- }
-}
-
-function initSearch () {
- var search_input = document.getElementById('mkdocs-search-query');
- if (search_input) {
- search_input.addEventListener("keyup", doSearch);
- }
- var term = getSearchTermFromLocation();
- if (term) {
- search_input.value = term;
- doSearch();
- }
-}
-
-function onWorkerMessage (e) {
- if (e.data.allowSearch) {
- initSearch();
- } else if (e.data.results) {
- var results = e.data.results;
- displayResults(results);
- }
-}
-
-if (!window.Worker) {
- console.log('Web Worker API not supported');
- // load index in main thread
- $.getScript(joinUrl(base_url, "search/worker.js")).done(function () {
- console.log('Loaded worker');
- init();
- window.postMessage = function (msg) {
- onWorkerMessage({data: msg});
- };
- }).fail(function (jqxhr, settings, exception) {
- console.error('Could not load worker.js');
- });
-} else {
- // Wrap search in a web worker
- var searchWorker = new Worker(joinUrl(base_url, "search/worker.js"));
- searchWorker.postMessage({init: true});
- searchWorker.onmessage = onWorkerMessage;
-}
diff --git a/site/search/search_index.json b/site/search/search_index.json
deleted file mode 100644
index 3aa13e0..0000000
--- a/site/search/search_index.json
+++ /dev/null
@@ -1 +0,0 @@
-{"config":{"lang":["en"],"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"Working with molecular structures in pandas DataFrames Links Documentation: http://rasbt.github.io/biopandas/ Source code repository: https://github.com/rasbt/biopandas PyPI: https://pypi.python.org/pypi/biopandas About If you are a computational biologist, chances are that you cursed one too many times about protein structure files. Yes, I am talking about ye Goode Olde Protein Data Bank format, aka \"PDB files.\" Nothing against PDB, it's a neatly structured format (if deployed correctly); yet, it is a bit cumbersome to work with PDB files in \"modern\" programming languages -- I am pretty sure we all agree on this. As machine learning and \"data science\" person, I fell in love with pandas DataFrames for handling just about everything that can be loaded into memory. So, why don't we take pandas to the structural biology world? Working with molecular structures of biological macromolecules (from PDB and MOL2 files) in pandas DataFrames is what BioPandas is all about! Examples # Initialize a new PandasPdb object # and fetch the PDB file from rcsb.org >>> from biopandas.pdb import PandasPdb >>> ppdb = PandasPdb().fetch_pdb('3eiy') >>> ppdb.df['ATOM'].head() # Load structures from your drive and compute the # Root Mean Square Deviation >>> from biopandas.pdb import PandasPdb >>> pl1 = PandasPdb().read_pdb('./docking_pose_1.pdb') >>> pl2 = PandasPdb().read_pdb('./docking_pose_2.pdb') >>> r = PandasPdb.rmsd(pl1.df['HETATM'], pl2.df['HETATM']) >>> print('RMSD: %.4f Angstrom' % r) RMSD: 2.6444 Angstrom # Producing quick summary plots >>> import matplotlib.pyplot as plt >>> ppdb.df['ATOM']['b_factor'].plot(kind='hist') >>> plt.title('Distribution of B-Factors') >>> plt.xlabel('B-factor') >>> plt.ylabel('count') >>> plt.show() >>> ppdb.df['ATOM']['b_factor'].plot(kind='line') >>> plt.title('B-Factors Along the Amino Acid Chain') >>> plt.xlabel('Residue Number') >>> plt.ylabel('B-factor in $A^2$') >>> plt.show() Cite as If you use BioPandas as part of your workflow in a scientific publication, please consider citing the BioPandas repository with the following DOI: Sebastian Raschka. Biopandas: Working with molecular structures in pandas dataframes. The Journal of Open Source Software , 2(14), jun 2017. doi: 10.21105/joss.00279. URL http://dx.doi.org/10.21105/joss.00279. @article{raschkas2017biopandas, doi = {10.21105/joss.00279}, url = {http://dx.doi.org/10.21105/joss.00279}, year = {2017}, month = {jun}, publisher = {The Open Journal}, volume = {2}, number = {14}, author = {Sebastian Raschka}, title = {BioPandas: Working with molecular structures in pandas DataFrames}, journal = {The Journal of Open Source Software} }","title":"Home"},{"location":"#links","text":"Documentation: http://rasbt.github.io/biopandas/ Source code repository: https://github.com/rasbt/biopandas PyPI: https://pypi.python.org/pypi/biopandas","title":"Links"},{"location":"#about","text":"If you are a computational biologist, chances are that you cursed one too many times about protein structure files. Yes, I am talking about ye Goode Olde Protein Data Bank format, aka \"PDB files.\" Nothing against PDB, it's a neatly structured format (if deployed correctly); yet, it is a bit cumbersome to work with PDB files in \"modern\" programming languages -- I am pretty sure we all agree on this. As machine learning and \"data science\" person, I fell in love with pandas DataFrames for handling just about everything that can be loaded into memory. So, why don't we take pandas to the structural biology world? Working with molecular structures of biological macromolecules (from PDB and MOL2 files) in pandas DataFrames is what BioPandas is all about!","title":"About"},{"location":"#examples","text":"# Initialize a new PandasPdb object # and fetch the PDB file from rcsb.org >>> from biopandas.pdb import PandasPdb >>> ppdb = PandasPdb().fetch_pdb('3eiy') >>> ppdb.df['ATOM'].head() # Load structures from your drive and compute the # Root Mean Square Deviation >>> from biopandas.pdb import PandasPdb >>> pl1 = PandasPdb().read_pdb('./docking_pose_1.pdb') >>> pl2 = PandasPdb().read_pdb('./docking_pose_2.pdb') >>> r = PandasPdb.rmsd(pl1.df['HETATM'], pl2.df['HETATM']) >>> print('RMSD: %.4f Angstrom' % r) RMSD: 2.6444 Angstrom # Producing quick summary plots >>> import matplotlib.pyplot as plt >>> ppdb.df['ATOM']['b_factor'].plot(kind='hist') >>> plt.title('Distribution of B-Factors') >>> plt.xlabel('B-factor') >>> plt.ylabel('count') >>> plt.show() >>> ppdb.df['ATOM']['b_factor'].plot(kind='line') >>> plt.title('B-Factors Along the Amino Acid Chain') >>> plt.xlabel('Residue Number') >>> plt.ylabel('B-factor in $A^2$') >>> plt.show()","title":"Examples"},{"location":"#cite-as","text":"If you use BioPandas as part of your workflow in a scientific publication, please consider citing the BioPandas repository with the following DOI: Sebastian Raschka. Biopandas: Working with molecular structures in pandas dataframes. The Journal of Open Source Software , 2(14), jun 2017. doi: 10.21105/joss.00279. URL http://dx.doi.org/10.21105/joss.00279. @article{raschkas2017biopandas, doi = {10.21105/joss.00279}, url = {http://dx.doi.org/10.21105/joss.00279}, year = {2017}, month = {jun}, publisher = {The Open Journal}, volume = {2}, number = {14}, author = {Sebastian Raschka}, title = {BioPandas: Working with molecular structures in pandas DataFrames}, journal = {The Journal of Open Source Software} }","title":"Cite as"},{"location":"CHANGELOG/","text":"Release Notes The CHANGELOG for the current development version is available at https://github.com/rasbt/biopandas/blob/master/docs/sources/CHANGELOG.md . 0.2.5 (07-09-2019) Downloads Source code (zip) Source code (tar.gz) New Features - Changes - Bug Fixes The PandasPdb.amino3to1 method now also considers insertion codes when converting the amino acid codes; before, inserted amino acides were skipped. 0.2.4 (02-05-2019) Downloads Source code (zip) Source code (tar.gz) New Features - Changes Minor adjustments to support to address deprecation warnings in pandas >= 23.0 Bug Fixes - 0.2.3 (03-29-2018) Downloads Source code (zip) Source code (tar.gz) New Features - Changes PandasMol2.distance_df was added as a static method that allows distance computations based for external data frames with its behavior otherwise similar to PandasMol2.distance . PandasPdb.distance_df was added as a static method that allows distance computations based for external data frames with its behavior otherwise similar to PandasPdb.distance . PandasPdb.distance now supports multiple record sections to be considered (e.g., records=('ATOM', 'HETATM') to include both protein and ligand in a query. Now also defaults to records=('ATOM', 'HETATM') for concistency with the impute method. PandasPdb.get(...) now supports external data frames and lets the user specify the record section to be considered (e.g., records=('ATOM', 'HETATM') to include both protein and ligand in a query. Now also defaults to records=('ATOM', 'HETATM') for concistency with the impute method. The section parameter of PandasPdb.impute_element(...) was renamed to records for API consistency. Bug Fixes - 0.2.2 (06-07-2017) Downloads Source code (zip) Source code (tar.gz) New Features - Changes Raises a meaningful error message if attempting to overwrite the df attributes of PandasMol2 and PandasPdb directly. Added PandasPdb.pdb_path and PandasMol2.mol2_path attributes that store the location of the data file last read. Bug Fixes The rmsd methods of PandasMol2 and PandasPdb don't return a NaN anymore if the array indices of to structures are different. 0.2.1 (2017-05-11) Downloads Source code (zip) Source code (tar.gz) New Features - Changes The amino3to1 method of biopandas.pdb.PandasPDB objects now returns a pandas DataFrame instead of a pandas Series object. The returned data frame has two columns, 'chain_id' and 'residue_name' , where the former contains the chain ID of the amino acid and the latter contains the 1-letter amino acid code, respectively. Significant speed improvements of the distance method of both PandasPdb and PandasMol2 (now about 300 percent faster than previously). Bug Fixes The amino3to1 method of biopandas.pdb.PandasPDB objects now handles multi-chain proteins correctly. The amino3to1 method of biopandas.pdb.PandasPDB objects now also works as expected if the 'ATOM' entry DataFrame contains disordered DataFrame indices or duplicate DataFrame index values. 0.2.0 (2017-04-02) Downloads Source code (zip) Source code (tar.gz) New Features Added an amino3to1 method to PandasPdb data frames to convert 3-amino acid letter codes to 1-letter codes. Added a distance method to PandasPdb data frames to compute the Euclidean distance between atoms and a reference point. Added the PandasMol2 class for working with Tripos MOL2 files in pandas DataFrames. Changes PandasPDB was renamed to PandasPdb . Raises a warning if PandasPdb is written to PDB and ATOM and HETAM section contains unexpected columns; these columns will now be skipped. Bug Fixes - 0.1.5 (2016-11-19) Downloads Source code (zip) Source code (tar.gz) New Features Added an impute_element method to PandasPDB objects to infer the Element Symbol from the Atom Name column. Added two new selection types for PandasPDB ATOM and HETATM coordinate sections: 'heavy' and 'carbon' . Changes Include test data in the PyPI package; add install_requires for pandas. The 'hydrogen' atom selection in PandasPDB methods is now based on the element type instead of the atom name. By default, the RMSD is now computed on all atoms unless a specific selection is defined. Bug Fixes - 0.1.4 (2015-11-24) Downloads Source code (zip) Source code (tar.gz) New Features - Changes Needed to bump the version number due to a bug in the PyPI setup.py script. Support for the old pandas sorting syntax ( DataFrame.sort vs DataFrame.sort_values ) incl. DeprecationWarning. Bug Fixes - 0.1.3 (2015-11-23) New Features - Changes - Bug Fixes Exception handling in tests if PDB goes down (which just happened). Added a separate ANISOU engine to handle those records correctly. 0.1.2 (2015-11-23) First Release.","title":"Changelog"},{"location":"CHANGELOG/#release-notes","text":"The CHANGELOG for the current development version is available at https://github.com/rasbt/biopandas/blob/master/docs/sources/CHANGELOG.md .","title":"Release Notes"},{"location":"CHANGELOG/#025-07-09-2019","text":"","title":"0.2.5 (07-09-2019)"},{"location":"CHANGELOG/#downloads","text":"Source code (zip) Source code (tar.gz)","title":"Downloads"},{"location":"CHANGELOG/#new-features","text":"-","title":"New Features"},{"location":"CHANGELOG/#changes","text":"-","title":"Changes"},{"location":"CHANGELOG/#bug-fixes","text":"The PandasPdb.amino3to1 method now also considers insertion codes when converting the amino acid codes; before, inserted amino acides were skipped.","title":"Bug Fixes"},{"location":"CHANGELOG/#024-02-05-2019","text":"","title":"0.2.4 (02-05-2019)"},{"location":"CHANGELOG/#downloads_1","text":"Source code (zip) Source code (tar.gz)","title":"Downloads"},{"location":"CHANGELOG/#new-features_1","text":"-","title":"New Features"},{"location":"CHANGELOG/#changes_1","text":"Minor adjustments to support to address deprecation warnings in pandas >= 23.0","title":"Changes"},{"location":"CHANGELOG/#bug-fixes_1","text":"-","title":"Bug Fixes"},{"location":"CHANGELOG/#023-03-29-2018","text":"","title":"0.2.3 (03-29-2018)"},{"location":"CHANGELOG/#downloads_2","text":"Source code (zip) Source code (tar.gz)","title":"Downloads"},{"location":"CHANGELOG/#new-features_2","text":"-","title":"New Features"},{"location":"CHANGELOG/#changes_2","text":"PandasMol2.distance_df was added as a static method that allows distance computations based for external data frames with its behavior otherwise similar to PandasMol2.distance . PandasPdb.distance_df was added as a static method that allows distance computations based for external data frames with its behavior otherwise similar to PandasPdb.distance . PandasPdb.distance now supports multiple record sections to be considered (e.g., records=('ATOM', 'HETATM') to include both protein and ligand in a query. Now also defaults to records=('ATOM', 'HETATM') for concistency with the impute method. PandasPdb.get(...) now supports external data frames and lets the user specify the record section to be considered (e.g., records=('ATOM', 'HETATM') to include both protein and ligand in a query. Now also defaults to records=('ATOM', 'HETATM') for concistency with the impute method. The section parameter of PandasPdb.impute_element(...) was renamed to records for API consistency.","title":"Changes"},{"location":"CHANGELOG/#bug-fixes_2","text":"-","title":"Bug Fixes"},{"location":"CHANGELOG/#022-06-07-2017","text":"","title":"0.2.2 (06-07-2017)"},{"location":"CHANGELOG/#downloads_3","text":"Source code (zip) Source code (tar.gz)","title":"Downloads"},{"location":"CHANGELOG/#new-features_3","text":"-","title":"New Features"},{"location":"CHANGELOG/#changes_3","text":"Raises a meaningful error message if attempting to overwrite the df attributes of PandasMol2 and PandasPdb directly. Added PandasPdb.pdb_path and PandasMol2.mol2_path attributes that store the location of the data file last read.","title":"Changes"},{"location":"CHANGELOG/#bug-fixes_3","text":"The rmsd methods of PandasMol2 and PandasPdb don't return a NaN anymore if the array indices of to structures are different.","title":"Bug Fixes"},{"location":"CHANGELOG/#021-2017-05-11","text":"","title":"0.2.1 (2017-05-11)"},{"location":"CHANGELOG/#downloads_4","text":"Source code (zip) Source code (tar.gz)","title":"Downloads"},{"location":"CHANGELOG/#new-features_4","text":"-","title":"New Features"},{"location":"CHANGELOG/#changes_4","text":"The amino3to1 method of biopandas.pdb.PandasPDB objects now returns a pandas DataFrame instead of a pandas Series object. The returned data frame has two columns, 'chain_id' and 'residue_name' , where the former contains the chain ID of the amino acid and the latter contains the 1-letter amino acid code, respectively. Significant speed improvements of the distance method of both PandasPdb and PandasMol2 (now about 300 percent faster than previously).","title":"Changes"},{"location":"CHANGELOG/#bug-fixes_4","text":"The amino3to1 method of biopandas.pdb.PandasPDB objects now handles multi-chain proteins correctly. The amino3to1 method of biopandas.pdb.PandasPDB objects now also works as expected if the 'ATOM' entry DataFrame contains disordered DataFrame indices or duplicate DataFrame index values.","title":"Bug Fixes"},{"location":"CHANGELOG/#020-2017-04-02","text":"","title":"0.2.0 (2017-04-02)"},{"location":"CHANGELOG/#downloads_5","text":"Source code (zip) Source code (tar.gz)","title":"Downloads"},{"location":"CHANGELOG/#new-features_5","text":"Added an amino3to1 method to PandasPdb data frames to convert 3-amino acid letter codes to 1-letter codes. Added a distance method to PandasPdb data frames to compute the Euclidean distance between atoms and a reference point. Added the PandasMol2 class for working with Tripos MOL2 files in pandas DataFrames.","title":"New Features"},{"location":"CHANGELOG/#changes_5","text":"PandasPDB was renamed to PandasPdb . Raises a warning if PandasPdb is written to PDB and ATOM and HETAM section contains unexpected columns; these columns will now be skipped.","title":"Changes"},{"location":"CHANGELOG/#bug-fixes_5","text":"-","title":"Bug Fixes"},{"location":"CHANGELOG/#015-2016-11-19","text":"","title":"0.1.5 (2016-11-19)"},{"location":"CHANGELOG/#downloads_6","text":"Source code (zip) Source code (tar.gz)","title":"Downloads"},{"location":"CHANGELOG/#new-features_6","text":"Added an impute_element method to PandasPDB objects to infer the Element Symbol from the Atom Name column. Added two new selection types for PandasPDB ATOM and HETATM coordinate sections: 'heavy' and 'carbon' .","title":"New Features"},{"location":"CHANGELOG/#changes_6","text":"Include test data in the PyPI package; add install_requires for pandas. The 'hydrogen' atom selection in PandasPDB methods is now based on the element type instead of the atom name. By default, the RMSD is now computed on all atoms unless a specific selection is defined.","title":"Changes"},{"location":"CHANGELOG/#bug-fixes_6","text":"-","title":"Bug Fixes"},{"location":"CHANGELOG/#014-2015-11-24","text":"","title":"0.1.4 (2015-11-24)"},{"location":"CHANGELOG/#downloads_7","text":"Source code (zip) Source code (tar.gz)","title":"Downloads"},{"location":"CHANGELOG/#new-features_7","text":"-","title":"New Features"},{"location":"CHANGELOG/#changes_7","text":"Needed to bump the version number due to a bug in the PyPI setup.py script. Support for the old pandas sorting syntax ( DataFrame.sort vs DataFrame.sort_values ) incl. DeprecationWarning.","title":"Changes"},{"location":"CHANGELOG/#bug-fixes_7","text":"-","title":"Bug Fixes"},{"location":"CHANGELOG/#013-2015-11-23","text":"","title":"0.1.3 (2015-11-23)"},{"location":"CHANGELOG/#new-features_8","text":"-","title":"New Features"},{"location":"CHANGELOG/#changes_8","text":"-","title":"Changes"},{"location":"CHANGELOG/#bug-fixes_8","text":"Exception handling in tests if PDB goes down (which just happened). Added a separate ANISOU engine to handle those records correctly.","title":"Bug Fixes"},{"location":"CHANGELOG/#012-2015-11-23","text":"First Release.","title":"0.1.2 (2015-11-23)"},{"location":"CONTRIBUTING/","text":"How to Contribute I would be very happy about any kind of contributions that help to improve and extend the functionality of biopandas. Quick Contributor Checklist This is a quick checklist about the different steps of a typical contribution to biopandas and other open source projects. Consider copying this list to a local text file (or the issue tracker) and checking off items as you go. [ ] Open a new \"issue\" on GitHub to discuss the new feature / bug fix [ ] Fork the biopandas repository from GitHub (if not already done earlier) [ ] Create and checkout a new topic branch [ ] Implement new feature or apply the bug-fix [ ] Add appropriate unit test functions [ ] Run nosetests -sv and make sure that all unit tests pass [ ] Check/improve the test coverage by running nosetests --with-coverage [ ] Add a note about the change to the ./docs/sources/CHANGELOG.md file [ ] Modify documentation in the appropriate location under biopandas/docs/sources/ [ ] Push the topic branch to the server and create a pull request [ ] Check the Travis-CI build passed at https://travis-ci.org/rasbt/biopandas [ ] Check/improve the unit test coverage at https://coveralls.io/github/rasbt/biopandas [ ] Check/improve the code health at https://landscape.io/github/rasbt/biopandas [ ] Squash many small commits to a larger commit Getting Started - Creating a New Issue and Forking the Repository If you don't have a GitHub account yet, please create one to contribute to this project. Please submit a ticket for your issue to discuss the fix or new feature before too much time and effort is spent for the implementation. Fork the biopandas repository from the GitHub web interface. Clone the biopandas repository to your local machine git clone https://github.com//biopandas.git Syncing an Existing Fork If you already forked biopandas earlier, you can bring you \"Fork\" up to date with the master branch as follows: 1. Configuring a remote that points to the upstream repository on GitHub List the current configured remote repository for your fork by executing $ git remote -v If you see something like origin https://github.com//biopandas.git (fetch) origin https://github.com//biopandas.git (push) you need to specify a new remote upstream repository via $ git remote add upstream https://github.com/rasbt/biopandas.git Now, verify the new upstream repository you've specified for your fork by executing $ git remote -v You should see following output if everything is configured correctly: origin https://github.com//biopandas.git (fetch) origin https://github.com//biopandas.git (push) upstream https://github.com/rasbt/biopandas.git (fetch) upstream https://github.com/rasbt/biopandas.git (push) 2. Syncing your Fork First, fetch the updates of the original project's master branch by executing: $ git fetch upstream You should see the following output remote: Counting objects: xx, done. remote: Compressing objects: 100% (xx/xx), done. remote: Total xx (delta xx), reused xx (delta x) Unpacking objects: 100% (xx/xx), done. From https://github.com/rasbt/biopandas * [new branch] master -> upstream/master This means that the commits to the rasbt/biopandas master branch are now stored in the local branch upstream/master . If you are not already on your local project's master branch, execute $ git checkout master Finally, merge the changes in upstream/master to your local master branch by executing $ git merge upstream/master which will give you an output that looks similar to Updating xxx...xxx Fast-forward SOME FILE1 | 12 +++++++ SOME FILE2 | 10 +++++++ 2 files changed, 22 insertions(+), Making Changes in a New Topic Branch 1. Creating a new feature branch Please avoid working directly on the master branch but create a new feature branch: $ git branch Switch to the new feature branch by executing $ git checkout 2. Developing the new feature / bug fix 3. Testing your code Adding/modifying the unit tests and check if they pass: $ nosetests -sv $ nosetests --with-coverage 4. Documenting the changes Please add an entry to the biopandas/docs/sources/CHANGELOG.md file. If it is a new feature, it would also be nice if you could update the documentation in appropriate location in biopandas/sources . 5. Committing the changes When you are ready to commit the changes, please provide a meaningful commit message: $ git add # or `git add .` $ git commit -m '' 6. Optional: squashing commits If you made multiple smaller commits, it would be nice if you could group them into a larger, summarizing commit. First, list your recent commit via $ git log which will list the commits from newest to oldest in the following format by default: commit 046e3af8a9127df8eac879454f029937c8a31c41 Author: rasbt Date: Tue Nov 24 03:46:37 2015 -0500 fixed setup.py commit c3c00f6ba0e8f48bbe1c9081b8ae3817e57ecc5c Author: rasbt Date: Tue Nov 24 03:04:39 2015 -0500 documented feature x commit d87934fe8726c46f0b166d6290a3bf38915d6e75 Author: rasbt Date: Tue Nov 24 02:44:45 2015 -0500 added support for feature x Assuming that it would make sense to group these 3 commits into one, we can execute $ git rebase -i HEAD~3 which will bring our default git editor with the following contents: pick d87934f added support for feature x pick c3c00f6 documented feature x pick 046e3af fixed setup.py Since c3c00f6 and 046e3af are related to the original commit of feature x , let's keep the d87934f and squash the 2 following commits into this initial one by changes the lines to pick d87934f added support for feature x squash c3c00f6 documented feature x squash 046e3af fixed setup.py Now, save the changes in your editor. Now, quitting the editor will apply the rebase changes, and the editor will open a second time, prompting you to enter a new commit message. In this case, we could enter support for feature x to summarize the contributions. 7. Uploading the changes Push your changes to a topic branch to the git server by executing: $ git push origin 8. Submitting a pull request Go to your GitHub repository online, select the new feature branch, and submit a new pull request: Notes for the Developers Building the documentation The documentation is built via MkDocs ; to ensure that the documentation is rendered correctly, you can view the documentation locally by executing mkdocs serve from the biopandas/docs directory. For example, ~/github/biopandas/docs$ mkdocs serve 1. Editing the Tutorials Please note that documents containing code examples are generated from IPython Notebook files and converted to markdown via ~/github/biopandas/docs/sources/tutorials$ nbconvert --to markdown The markdown file should be placed into the documentation directory at biopandas/docs/sources to build the documentation via MkDocs. If you are adding a new document, please also include it in the pages section in the biopandas/docs/mkdocs.yml file. 2. Building the API documentation To build the API documentation, navigate to biopandas/docs and execute the make_api.py file from this directory via ~/github/biopandas/docs$ python make_api.py This should place the API documentation into the correct directories in biopandas/docs/sources/api . 3. Building static HTML files of the documentation Build the static HTML files of the biopandas documentation via ~/github/biopandas/docs$ mkdocs build --clean To deploy the documentation, execute ~/github/biopandas/docs$ mkdocs gh-deploy --clean Uploading a new version to PyPI 1. Creating a new testing environment Assuming we are using conda , create a new python environment via $ conda create -n 'biopandas-testing' python=3 pandas Next, activate the environment by executing $ source activate biopandas-testing 2. Installing the package from local files Test the installation by executing $ python setup.py install --record files.txt the --record files.txt flag will create a files.txt file listing the locations where these files will be installed. Try to import the package to see if it works, for example, by executing $ python -c 'import biopandas; print(biopandas.__file__)' If everything seems to be fine, remove the installation via $ cat files.txt | xargs rm -rf ; rm files.txt Next, test if pip is able to install the packages. First, navigate to a different directory, and from there, install the package: $ pip install code/biopandas/ and uninstall it again $ pip uninstall biopandas 3. Deploying the package Consider deploying the package to the PyPI test server first. The setup instructions can be found here . $ python setup.py sdist bdist_wheel upload -r https://testpypi.python.org/pypi Test if it can be installed from there by executing $ pip install -i https://testpypi.python.org/pypi biopandas and uninstall it $ pip uninstall biopandas After this dry-run succeeded, repeat this process using the \"real\" PyPI: $ python setup.py sdist bdist_wheel upload 4. Removing the virtual environment Finally, to cleanup our local drive, remove the virtual testing environment via $ conda remove --name 'biopandas-testing' --all","title":"Contributing"},{"location":"CONTRIBUTING/#how-to-contribute","text":"I would be very happy about any kind of contributions that help to improve and extend the functionality of biopandas.","title":"How to Contribute"},{"location":"CONTRIBUTING/#quick-contributor-checklist","text":"This is a quick checklist about the different steps of a typical contribution to biopandas and other open source projects. Consider copying this list to a local text file (or the issue tracker) and checking off items as you go. [ ] Open a new \"issue\" on GitHub to discuss the new feature / bug fix [ ] Fork the biopandas repository from GitHub (if not already done earlier) [ ] Create and checkout a new topic branch [ ] Implement new feature or apply the bug-fix [ ] Add appropriate unit test functions [ ] Run nosetests -sv and make sure that all unit tests pass [ ] Check/improve the test coverage by running nosetests --with-coverage [ ] Add a note about the change to the ./docs/sources/CHANGELOG.md file [ ] Modify documentation in the appropriate location under biopandas/docs/sources/ [ ] Push the topic branch to the server and create a pull request [ ] Check the Travis-CI build passed at https://travis-ci.org/rasbt/biopandas [ ] Check/improve the unit test coverage at https://coveralls.io/github/rasbt/biopandas [ ] Check/improve the code health at https://landscape.io/github/rasbt/biopandas [ ] Squash many small commits to a larger commit","title":"Quick Contributor Checklist"},{"location":"CONTRIBUTING/#getting-started-creating-a-new-issue-and-forking-the-repository","text":"If you don't have a GitHub account yet, please create one to contribute to this project. Please submit a ticket for your issue to discuss the fix or new feature before too much time and effort is spent for the implementation. Fork the biopandas repository from the GitHub web interface. Clone the biopandas repository to your local machine git clone https://github.com//biopandas.git","title":"Getting Started - Creating a New Issue and Forking the Repository"},{"location":"CONTRIBUTING/#syncing-an-existing-fork","text":"If you already forked biopandas earlier, you can bring you \"Fork\" up to date with the master branch as follows:","title":"Syncing an Existing Fork"},{"location":"CONTRIBUTING/#1-configuring-a-remote-that-points-to-the-upstream-repository-on-github","text":"List the current configured remote repository for your fork by executing $ git remote -v If you see something like origin https://github.com//biopandas.git (fetch) origin https://github.com//biopandas.git (push) you need to specify a new remote upstream repository via $ git remote add upstream https://github.com/rasbt/biopandas.git Now, verify the new upstream repository you've specified for your fork by executing $ git remote -v You should see following output if everything is configured correctly: origin https://github.com//biopandas.git (fetch) origin https://github.com//biopandas.git (push) upstream https://github.com/rasbt/biopandas.git (fetch) upstream https://github.com/rasbt/biopandas.git (push)","title":"1. Configuring a remote that points to the upstream repository on GitHub"},{"location":"CONTRIBUTING/#2-syncing-your-fork","text":"First, fetch the updates of the original project's master branch by executing: $ git fetch upstream You should see the following output remote: Counting objects: xx, done. remote: Compressing objects: 100% (xx/xx), done. remote: Total xx (delta xx), reused xx (delta x) Unpacking objects: 100% (xx/xx), done. From https://github.com/rasbt/biopandas * [new branch] master -> upstream/master This means that the commits to the rasbt/biopandas master branch are now stored in the local branch upstream/master . If you are not already on your local project's master branch, execute $ git checkout master Finally, merge the changes in upstream/master to your local master branch by executing $ git merge upstream/master which will give you an output that looks similar to Updating xxx...xxx Fast-forward SOME FILE1 | 12 +++++++ SOME FILE2 | 10 +++++++ 2 files changed, 22 insertions(+),","title":"2. Syncing your Fork"},{"location":"CONTRIBUTING/#making-changes-in-a-new-topic-branch","text":"","title":"Making Changes in a New Topic Branch"},{"location":"CONTRIBUTING/#1-creating-a-new-feature-branch","text":"Please avoid working directly on the master branch but create a new feature branch: $ git branch Switch to the new feature branch by executing $ git checkout ","title":"1. Creating a new feature branch"},{"location":"CONTRIBUTING/#2-developing-the-new-feature-bug-fix","text":"","title":"2. Developing the new feature / bug fix"},{"location":"CONTRIBUTING/#3-testing-your-code","text":"Adding/modifying the unit tests and check if they pass: $ nosetests -sv $ nosetests --with-coverage","title":"3. Testing your code"},{"location":"CONTRIBUTING/#4-documenting-the-changes","text":"Please add an entry to the biopandas/docs/sources/CHANGELOG.md file. If it is a new feature, it would also be nice if you could update the documentation in appropriate location in biopandas/sources .","title":"4. Documenting the changes"},{"location":"CONTRIBUTING/#5-committing-the-changes","text":"When you are ready to commit the changes, please provide a meaningful commit message: $ git add # or `git add .` $ git commit -m ''","title":"5. Committing the changes"},{"location":"CONTRIBUTING/#6-optional-squashing-commits","text":"If you made multiple smaller commits, it would be nice if you could group them into a larger, summarizing commit. First, list your recent commit via $ git log which will list the commits from newest to oldest in the following format by default: commit 046e3af8a9127df8eac879454f029937c8a31c41 Author: rasbt Date: Tue Nov 24 03:46:37 2015 -0500 fixed setup.py commit c3c00f6ba0e8f48bbe1c9081b8ae3817e57ecc5c Author: rasbt Date: Tue Nov 24 03:04:39 2015 -0500 documented feature x commit d87934fe8726c46f0b166d6290a3bf38915d6e75 Author: rasbt Date: Tue Nov 24 02:44:45 2015 -0500 added support for feature x Assuming that it would make sense to group these 3 commits into one, we can execute $ git rebase -i HEAD~3 which will bring our default git editor with the following contents: pick d87934f added support for feature x pick c3c00f6 documented feature x pick 046e3af fixed setup.py Since c3c00f6 and 046e3af are related to the original commit of feature x , let's keep the d87934f and squash the 2 following commits into this initial one by changes the lines to pick d87934f added support for feature x squash c3c00f6 documented feature x squash 046e3af fixed setup.py Now, save the changes in your editor. Now, quitting the editor will apply the rebase changes, and the editor will open a second time, prompting you to enter a new commit message. In this case, we could enter support for feature x to summarize the contributions.","title":"6. Optional: squashing commits"},{"location":"CONTRIBUTING/#7-uploading-the-changes","text":"Push your changes to a topic branch to the git server by executing: $ git push origin ","title":"7. Uploading the changes"},{"location":"CONTRIBUTING/#8-submitting-a-pull-request","text":"Go to your GitHub repository online, select the new feature branch, and submit a new pull request:","title":"8. Submitting a pull request"},{"location":"CONTRIBUTING/#notes-for-the-developers","text":"","title":"Notes for the Developers"},{"location":"CONTRIBUTING/#building-the-documentation","text":"The documentation is built via MkDocs ; to ensure that the documentation is rendered correctly, you can view the documentation locally by executing mkdocs serve from the biopandas/docs directory. For example, ~/github/biopandas/docs$ mkdocs serve","title":"Building the documentation"},{"location":"CONTRIBUTING/#1-editing-the-tutorials","text":"Please note that documents containing code examples are generated from IPython Notebook files and converted to markdown via ~/github/biopandas/docs/sources/tutorials$ nbconvert --to markdown The markdown file should be placed into the documentation directory at biopandas/docs/sources to build the documentation via MkDocs. If you are adding a new document, please also include it in the pages section in the biopandas/docs/mkdocs.yml file.","title":"1. Editing the Tutorials"},{"location":"CONTRIBUTING/#2-building-the-api-documentation","text":"To build the API documentation, navigate to biopandas/docs and execute the make_api.py file from this directory via ~/github/biopandas/docs$ python make_api.py This should place the API documentation into the correct directories in biopandas/docs/sources/api .","title":"2. Building the API documentation"},{"location":"CONTRIBUTING/#3-building-static-html-files-of-the-documentation","text":"Build the static HTML files of the biopandas documentation via ~/github/biopandas/docs$ mkdocs build --clean To deploy the documentation, execute ~/github/biopandas/docs$ mkdocs gh-deploy --clean","title":"3. Building static HTML files of the documentation"},{"location":"CONTRIBUTING/#uploading-a-new-version-to-pypi","text":"","title":"Uploading a new version to PyPI"},{"location":"CONTRIBUTING/#1-creating-a-new-testing-environment","text":"Assuming we are using conda , create a new python environment via $ conda create -n 'biopandas-testing' python=3 pandas Next, activate the environment by executing $ source activate biopandas-testing","title":"1. Creating a new testing environment"},{"location":"CONTRIBUTING/#2-installing-the-package-from-local-files","text":"Test the installation by executing $ python setup.py install --record files.txt the --record files.txt flag will create a files.txt file listing the locations where these files will be installed. Try to import the package to see if it works, for example, by executing $ python -c 'import biopandas; print(biopandas.__file__)' If everything seems to be fine, remove the installation via $ cat files.txt | xargs rm -rf ; rm files.txt Next, test if pip is able to install the packages. First, navigate to a different directory, and from there, install the package: $ pip install code/biopandas/ and uninstall it again $ pip uninstall biopandas","title":"2. Installing the package from local files"},{"location":"CONTRIBUTING/#3-deploying-the-package","text":"Consider deploying the package to the PyPI test server first. The setup instructions can be found here . $ python setup.py sdist bdist_wheel upload -r https://testpypi.python.org/pypi Test if it can be installed from there by executing $ pip install -i https://testpypi.python.org/pypi biopandas and uninstall it $ pip uninstall biopandas After this dry-run succeeded, repeat this process using the \"real\" PyPI: $ python setup.py sdist bdist_wheel upload","title":"3. Deploying the package"},{"location":"CONTRIBUTING/#4-removing-the-virtual-environment","text":"Finally, to cleanup our local drive, remove the virtual testing environment via $ conda remove --name 'biopandas-testing' --all","title":"4. Removing the virtual environment"},{"location":"citing/","text":"Citing If you use BioPandas as part of your workflow in a scientific publication, please consider citing the BioPandas repository with the following DOI: Sebastian Raschka. Biopandas: Working with molecular structures in pandas dataframes. The Journal of Open Source Software , 2(14), jun 2017. doi: 10.21105/joss.00279. URL http://dx.doi.org/10.21105/joss.00279. @article{raschkas2017biopandas, doi = {10.21105/joss.00279}, url = {http://dx.doi.org/10.21105/joss.00279}, year = {2017}, month = {jun}, publisher = {The Open Journal}, volume = {2}, number = {14}, author = {Sebastian Raschka}, title = {BioPandas: Working with molecular structures in pandas DataFrames}, journal = {The Journal of Open Source Software} }","title":"Citing"},{"location":"citing/#citing","text":"If you use BioPandas as part of your workflow in a scientific publication, please consider citing the BioPandas repository with the following DOI: Sebastian Raschka. Biopandas: Working with molecular structures in pandas dataframes. The Journal of Open Source Software , 2(14), jun 2017. doi: 10.21105/joss.00279. URL http://dx.doi.org/10.21105/joss.00279. @article{raschkas2017biopandas, doi = {10.21105/joss.00279}, url = {http://dx.doi.org/10.21105/joss.00279}, year = {2017}, month = {jun}, publisher = {The Open Journal}, volume = {2}, number = {14}, author = {Sebastian Raschka}, title = {BioPandas: Working with molecular structures in pandas DataFrames}, journal = {The Journal of Open Source Software} }","title":"Citing"},{"location":"installation/","text":"Installing BioPandas Requirements BioPandas requires the following software and packages: Python 2.7, 3.5, or 3.6 NumPy >= 1.11.2 SciPy >= 0.18.1 Pandas >= 0.19.1 PyPI You can install the latest stable release of biopandas directly from Python's package index via pip by executing the following code from your command line: pip install biopandas Conda-forge Versions of biopandas are now also available via conda-forge ; you can install it via conda install biopandas -c conda-forge or simply conda install biopandas if you have conda-forge already added to your channels . Latest GitHub Source Code You want to try out the latest features before they go live on PyPI? Install the biopandas dev-version latest development version from the GitHub repository by executing pip install git+git://github.com/rasbt/biopandas.git Alternatively, you download the package manually from PYPI or GitHub , unzip it, navigate into the package, and execute the command: python setup.py install","title":"Installation"},{"location":"installation/#installing-biopandas","text":"","title":"Installing BioPandas"},{"location":"installation/#requirements","text":"BioPandas requires the following software and packages: Python 2.7, 3.5, or 3.6 NumPy >= 1.11.2 SciPy >= 0.18.1 Pandas >= 0.19.1","title":"Requirements"},{"location":"installation/#pypi","text":"You can install the latest stable release of biopandas directly from Python's package index via pip by executing the following code from your command line: pip install biopandas","title":"PyPI"},{"location":"installation/#conda-forge","text":"Versions of biopandas are now also available via conda-forge ; you can install it via conda install biopandas -c conda-forge or simply conda install biopandas if you have conda-forge already added to your channels .","title":"Conda-forge"},{"location":"installation/#latest-github-source-code","text":"You want to try out the latest features before they go live on PyPI? Install the biopandas dev-version latest development version from the GitHub repository by executing pip install git+git://github.com/rasbt/biopandas.git Alternatively, you download the package manually from PYPI or GitHub , unzip it, navigate into the package, and execute the command: python setup.py install","title":"Latest GitHub Source Code"},{"location":"api_modules/biopandas.mol2/PandasMol2/","text":"PandasMol2 PandasMol2() Object for working with Tripos Mol2 structure files. Attributes df : pandas.DataFrame DataFrame of a Mol2's ATOM section mol2_text : str Mol2 file contents in string format code : str ID, code, or name of the molecule stored pdb_path : str Location of the MOL2 file that was read in via read_mol2 Methods distance(xyz=(0.0, 0.0, 0.0)) Computes Euclidean distance between atoms in self.df and a 3D point. Parameters xyz : tuple (0.00, 0.00, 0.00) X, Y, and Z coordinate of the reference center for the distance computation Returns pandas.Series : Pandas Series object containing the Euclidean distance between the atoms in the atom section and xyz . distance_df(df, xyz=(0.0, 0.0, 0.0)) Computes Euclidean distance between atoms and a 3D point. Parameters df : DataFrame DataFrame containing entries similar to the PandasMol2.df format for the the distance computation to the xyz reference coordinates. xyz : tuple (0.00, 0.00, 0.00) X, Y, and Z coordinate of the reference center for the distance computation Returns pandas.Series : Pandas Series object containing the Euclidean distance between the atoms in the atom section and xyz . read_mol2(path, columns=None) Reads Mol2 files (unzipped or gzipped) from local drive Note that if your mol2 file contains more than one molecule, only the first molecule is loaded into the DataFrame Attributes path : str Path to the Mol2 file in .mol2 format or gzipped format (.mol2.gz) columns : dict or None (default: None) If None, this methods expects a 9-column ATOM section that contains the following columns: {0:('atom_id', int), 1:('atom_name', str), 2:('x', float), 3:('y', float), 4:('z', float), 5:('atom_type', str), 6:('subst_id', int), 7:('subst_name', str), 8:('charge', float)} If your Mol2 files are formatted differently, you can provide your own column_mapping dictionary in a format similar to the one above. However, note that not all assert_raise_message methods may be supported then. Returns self read_mol2_from_list(mol2_lines, mol2_code, columns=None) Reads Mol2 file from a list into DataFrames Attributes mol2_lines : list A list of lines containing the mol2 file contents. For example, ['@ MOLECULE\\n', 'ZINC38611810\\n', ' 65 68 0 0 0\\n', 'SMALL\\n', 'NO_CHARGES\\n', '\\n', '@ ATOM\\n', ' 1 C1 -1.1786 2.7011 -4.0323 C.3 1 <0> -0.1537\\n', ' 2 C2 -1.2950 1.2442 -3.5798 C.3 1 <0> -0.1156\\n', ...] mol2_code : str or None Name or ID of the molecule. columns : dict or None (default: None) If None, this methods expects a 9-column ATOM section that contains the following columns: {0:('atom_id', int), 1:('atom_name', str), 2:('x', float), 3:('y', float), 4:('z', float), 5:('atom_type', str), 6:('subst_id', int), 7:('subst_name', str), 8:('charge', float)} If your Mol2 files are formatted differently, you can provide your own column_mapping dictionary in a format similar to the one above. However, note that not all assert_raise_message methods may be supported then. Returns self rmsd(df1, df2, heavy_only=True) Compute the Root Mean Square Deviation between molecules Parameters df1 : pandas.DataFrame DataFrame with HETATM, ATOM, and/or ANISOU entries df2 : pandas.DataFrame Second DataFrame for RMSD computation against df1. Must have the same number of entries as df1 heavy_only : bool (default: True) Which atoms to compare to compute the RMSD. If True (default), computes the RMSD between non-hydrogen atoms only. Returns rmsd : float Root Mean Square Deviation between df1 and df2 Properties df Acccesses the pandas DataFrame","title":"PandasMol2"},{"location":"api_modules/biopandas.mol2/PandasMol2/#pandasmol2","text":"PandasMol2() Object for working with Tripos Mol2 structure files. Attributes df : pandas.DataFrame DataFrame of a Mol2's ATOM section mol2_text : str Mol2 file contents in string format code : str ID, code, or name of the molecule stored pdb_path : str Location of the MOL2 file that was read in via read_mol2","title":"PandasMol2"},{"location":"api_modules/biopandas.mol2/PandasMol2/#methods","text":"distance(xyz=(0.0, 0.0, 0.0)) Computes Euclidean distance between atoms in self.df and a 3D point. Parameters xyz : tuple (0.00, 0.00, 0.00) X, Y, and Z coordinate of the reference center for the distance computation Returns pandas.Series : Pandas Series object containing the Euclidean distance between the atoms in the atom section and xyz . distance_df(df, xyz=(0.0, 0.0, 0.0)) Computes Euclidean distance between atoms and a 3D point. Parameters df : DataFrame DataFrame containing entries similar to the PandasMol2.df format for the the distance computation to the xyz reference coordinates. xyz : tuple (0.00, 0.00, 0.00) X, Y, and Z coordinate of the reference center for the distance computation Returns pandas.Series : Pandas Series object containing the Euclidean distance between the atoms in the atom section and xyz . read_mol2(path, columns=None) Reads Mol2 files (unzipped or gzipped) from local drive Note that if your mol2 file contains more than one molecule, only the first molecule is loaded into the DataFrame Attributes path : str Path to the Mol2 file in .mol2 format or gzipped format (.mol2.gz) columns : dict or None (default: None) If None, this methods expects a 9-column ATOM section that contains the following columns: {0:('atom_id', int), 1:('atom_name', str), 2:('x', float), 3:('y', float), 4:('z', float), 5:('atom_type', str), 6:('subst_id', int), 7:('subst_name', str), 8:('charge', float)} If your Mol2 files are formatted differently, you can provide your own column_mapping dictionary in a format similar to the one above. However, note that not all assert_raise_message methods may be supported then. Returns self read_mol2_from_list(mol2_lines, mol2_code, columns=None) Reads Mol2 file from a list into DataFrames Attributes mol2_lines : list A list of lines containing the mol2 file contents. For example, ['@ MOLECULE\\n', 'ZINC38611810\\n', ' 65 68 0 0 0\\n', 'SMALL\\n', 'NO_CHARGES\\n', '\\n', '@ ATOM\\n', ' 1 C1 -1.1786 2.7011 -4.0323 C.3 1 <0> -0.1537\\n', ' 2 C2 -1.2950 1.2442 -3.5798 C.3 1 <0> -0.1156\\n', ...] mol2_code : str or None Name or ID of the molecule. columns : dict or None (default: None) If None, this methods expects a 9-column ATOM section that contains the following columns: {0:('atom_id', int), 1:('atom_name', str), 2:('x', float), 3:('y', float), 4:('z', float), 5:('atom_type', str), 6:('subst_id', int), 7:('subst_name', str), 8:('charge', float)} If your Mol2 files are formatted differently, you can provide your own column_mapping dictionary in a format similar to the one above. However, note that not all assert_raise_message methods may be supported then. Returns self rmsd(df1, df2, heavy_only=True) Compute the Root Mean Square Deviation between molecules Parameters df1 : pandas.DataFrame DataFrame with HETATM, ATOM, and/or ANISOU entries df2 : pandas.DataFrame Second DataFrame for RMSD computation against df1. Must have the same number of entries as df1 heavy_only : bool (default: True) Which atoms to compare to compute the RMSD. If True (default), computes the RMSD between non-hydrogen atoms only. Returns rmsd : float Root Mean Square Deviation between df1 and df2","title":"Methods"},{"location":"api_modules/biopandas.mol2/PandasMol2/#properties","text":"df Acccesses the pandas DataFrame","title":"Properties"},{"location":"api_modules/biopandas.mol2/split_multimol2/","text":"split_multimol2 split_multimol2(mol2_path) Splits a multi-mol2 file into individual Mol2 file contents. Parameters mol2_path : str Path to the multi-mol2 file. Parses gzip files if the filepath ends on .gz. Returns A generator object for lists for every extracted mol2-file. Lists contain the molecule ID and the mol2 file contents. e.g., ['ID1234', ['@ MOLECULE\\n', '...']]. Note that bytestrings are returned (for reasons of efficieny) if the Mol2 content is read from a gzip (.gz) file.","title":"Split multimol2"},{"location":"api_modules/biopandas.mol2/split_multimol2/#split_multimol2","text":"split_multimol2(mol2_path) Splits a multi-mol2 file into individual Mol2 file contents. Parameters mol2_path : str Path to the multi-mol2 file. Parses gzip files if the filepath ends on .gz. Returns A generator object for lists for every extracted mol2-file. Lists contain the molecule ID and the mol2 file contents. e.g., ['ID1234', ['@ MOLECULE\\n', '...']]. Note that bytestrings are returned (for reasons of efficieny) if the Mol2 content is read from a gzip (.gz) file.","title":"split_multimol2"},{"location":"api_modules/biopandas.pdb/PandasPdb/","text":"PandasPdb PandasPdb() Object for working with Protein Databank structure files. Attributes df : dict Dictionary storing pandas DataFrames for PDB record sections. The dictionary keys are {'ATOM', 'HETATM', 'ANISOU', 'OTHERS'} where 'OTHERS' contains all entries that are not parsed as 'ATOM', 'HETATM', or 'ANISOU'. pdb_text : str PDB file contents in raw text format. pdb_path : str Location of the PDB file that was read in via read_pdb or URL of the page where the PDB content was fetched from if fetch_pdb was called. header : str PDB file description. code : str PDB code Methods amino3to1(record='ATOM', residue_col='residue_name', fillna='?') Creates 1-letter amino acid codes from DataFrame Non-canonical amino-acids are converted as follows: ASH (protonated ASP) => D CYX (disulfide-bonded CYS) => C GLH (protonated GLU) => E HID/HIE/HIP (different protonation states of HIS) = H HYP (hydroxyproline) => P MSE (selenomethionine) => M Parameters record : str, default: 'ATOM' Specfies the record DataFrame. residue_col : str, default: 'residue_name' Column in record DataFrame to look for 3-letter amino acid codes for the conversion. fillna : str, default: '?' Placeholder string to use for unknown amino acids. Returns pandas.DataFrame : Pandas DataFrame object consisting of two columns, 'chain_id' and 'residue_name' , where the former contains the chain ID of the amino acid and the latter contains the 1-letter amino acid code, respectively. distance(xyz=(0.0, 0.0, 0.0), records=('ATOM', 'HETATM')) Computes Euclidean distance between atoms and a 3D point. Parameters xyz : tuple, default: (0.00, 0.00, 0.00) X, Y, and Z coordinate of the reference center for the distance computation. records : iterable, default: ('ATOM', 'HETATM') Specify which record sections to consider. For example, to consider both protein and ligand atoms, set records=('ATOM', 'HETATM') . This setting is ignored if df is not set to None. For downward compatibility, a string argument is still supported but deprecated and will be removed in future versions. Returns pandas.Series : Pandas Series object containing the Euclidean distance between the atoms in the record section and xyz . distance_df(df, xyz=(0.0, 0.0, 0.0)) Computes Euclidean distance between atoms and a 3D point. Parameters df : DataFrame DataFrame containing entries in the PandasPdb.df['ATOM'] or PandasPdb.df['HETATM'] format for the the distance computation to the xyz reference coordinates. xyz : tuple, default: (0.00, 0.00, 0.00) X, Y, and Z coordinate of the reference center for the distance computation. Returns pandas.Series : Pandas Series object containing the Euclidean distance between the atoms in the record section and xyz . fetch_pdb(pdb_code) Fetches PDB file contents from the Protein Databank at rcsb.org. Parameters pdb_code : str A 4-letter PDB code, e.g., \"3eiy\". Returns self get(s, df=None, invert=False, records=('ATOM', 'HETATM')) Filter PDB DataFrames by properties Parameters s : str in {'main chain', 'hydrogen', 'c-alpha', 'heavy'} String to specify which entries to return. df : pandas.DataFrame, default: None Optional DataFrame to perform the filter operation on. If df=None, filters on self.df['ATOM']. invert : bool, default: True Inverts the search query. For example if s='hydrogen' and invert=True, all but hydrogen entries are returned. records : iterable, default: ('ATOM', 'HETATM') Specify which record sections to consider. For example, to consider both protein and ligand atoms, set records=('ATOM', 'HETATM') . This setting is ignored if df is not set to None. For downward compatibility, a string argument is still supported but deprecated and will be removed in future versions. Returns df : pandas.DataFrame Returns a DataFrame view on the filtered entries. impute_element(records=('ATOM', 'HETATM'), inplace=False) Impute element_symbol from atom_name section. Parameters records : iterable, default: ('ATOM', 'HETATM') Coordinate sections for which the element symbols should be imputed. inplace : bool, (default: False Performs the operation in-place if True and returns a copy of the PDB DataFrame otherwise. Returns DataFrame parse_sse() Parse secondary structure elements read_pdb(path) Read PDB files (unzipped or gzipped) from local drive Attributes path : str Path to the PDB file in .pdb format or gzipped format (.pdb.gz). Returns self rmsd(df1, df2, s=None, invert=False) Compute the Root Mean Square Deviation between molecules. Parameters df1 : pandas.DataFrame DataFrame with HETATM, ATOM, and/or ANISOU entries. df2 : pandas.DataFrame Second DataFrame for RMSD computation against df1. Must have the same number of entries as df1. s : {'main chain', 'hydrogen', 'c-alpha', 'heavy', 'carbon'} or None, default: None String to specify which entries to consider. If None, considers all atoms for comparison. invert : bool, default: False Inverts the string query if true. For example, the setting s='hydrogen', invert=True computes the RMSD based on all but hydrogen atoms. Returns rmsd : float Root Mean Square Deviation between df1 and df2 to_pdb(path, records=None, gz=False, append_newline=True) Write record DataFrames to a PDB file or gzipped PDB file. Parameters path : str A valid output path for the pdb file records : iterable, default: None A list of PDB record sections in {'ATOM', 'HETATM', 'ANISOU', 'OTHERS'} that are to be written. Writes all lines to PDB if records=None . gz : bool, default: False Writes a gzipped PDB file if True. append_newline : bool, default: True Appends a new line at the end of the PDB file if True Properties df Acccess dictionary of pandas DataFrames for PDB record sections.","title":"PandasPdb"},{"location":"api_modules/biopandas.pdb/PandasPdb/#pandaspdb","text":"PandasPdb() Object for working with Protein Databank structure files. Attributes df : dict Dictionary storing pandas DataFrames for PDB record sections. The dictionary keys are {'ATOM', 'HETATM', 'ANISOU', 'OTHERS'} where 'OTHERS' contains all entries that are not parsed as 'ATOM', 'HETATM', or 'ANISOU'. pdb_text : str PDB file contents in raw text format. pdb_path : str Location of the PDB file that was read in via read_pdb or URL of the page where the PDB content was fetched from if fetch_pdb was called. header : str PDB file description. code : str PDB code","title":"PandasPdb"},{"location":"api_modules/biopandas.pdb/PandasPdb/#methods","text":"amino3to1(record='ATOM', residue_col='residue_name', fillna='?') Creates 1-letter amino acid codes from DataFrame Non-canonical amino-acids are converted as follows: ASH (protonated ASP) => D CYX (disulfide-bonded CYS) => C GLH (protonated GLU) => E HID/HIE/HIP (different protonation states of HIS) = H HYP (hydroxyproline) => P MSE (selenomethionine) => M Parameters record : str, default: 'ATOM' Specfies the record DataFrame. residue_col : str, default: 'residue_name' Column in record DataFrame to look for 3-letter amino acid codes for the conversion. fillna : str, default: '?' Placeholder string to use for unknown amino acids. Returns pandas.DataFrame : Pandas DataFrame object consisting of two columns, 'chain_id' and 'residue_name' , where the former contains the chain ID of the amino acid and the latter contains the 1-letter amino acid code, respectively. distance(xyz=(0.0, 0.0, 0.0), records=('ATOM', 'HETATM')) Computes Euclidean distance between atoms and a 3D point. Parameters xyz : tuple, default: (0.00, 0.00, 0.00) X, Y, and Z coordinate of the reference center for the distance computation. records : iterable, default: ('ATOM', 'HETATM') Specify which record sections to consider. For example, to consider both protein and ligand atoms, set records=('ATOM', 'HETATM') . This setting is ignored if df is not set to None. For downward compatibility, a string argument is still supported but deprecated and will be removed in future versions. Returns pandas.Series : Pandas Series object containing the Euclidean distance between the atoms in the record section and xyz . distance_df(df, xyz=(0.0, 0.0, 0.0)) Computes Euclidean distance between atoms and a 3D point. Parameters df : DataFrame DataFrame containing entries in the PandasPdb.df['ATOM'] or PandasPdb.df['HETATM'] format for the the distance computation to the xyz reference coordinates. xyz : tuple, default: (0.00, 0.00, 0.00) X, Y, and Z coordinate of the reference center for the distance computation. Returns pandas.Series : Pandas Series object containing the Euclidean distance between the atoms in the record section and xyz . fetch_pdb(pdb_code) Fetches PDB file contents from the Protein Databank at rcsb.org. Parameters pdb_code : str A 4-letter PDB code, e.g., \"3eiy\". Returns self get(s, df=None, invert=False, records=('ATOM', 'HETATM')) Filter PDB DataFrames by properties Parameters s : str in {'main chain', 'hydrogen', 'c-alpha', 'heavy'} String to specify which entries to return. df : pandas.DataFrame, default: None Optional DataFrame to perform the filter operation on. If df=None, filters on self.df['ATOM']. invert : bool, default: True Inverts the search query. For example if s='hydrogen' and invert=True, all but hydrogen entries are returned. records : iterable, default: ('ATOM', 'HETATM') Specify which record sections to consider. For example, to consider both protein and ligand atoms, set records=('ATOM', 'HETATM') . This setting is ignored if df is not set to None. For downward compatibility, a string argument is still supported but deprecated and will be removed in future versions. Returns df : pandas.DataFrame Returns a DataFrame view on the filtered entries. impute_element(records=('ATOM', 'HETATM'), inplace=False) Impute element_symbol from atom_name section. Parameters records : iterable, default: ('ATOM', 'HETATM') Coordinate sections for which the element symbols should be imputed. inplace : bool, (default: False Performs the operation in-place if True and returns a copy of the PDB DataFrame otherwise. Returns DataFrame parse_sse() Parse secondary structure elements read_pdb(path) Read PDB files (unzipped or gzipped) from local drive Attributes path : str Path to the PDB file in .pdb format or gzipped format (.pdb.gz). Returns self rmsd(df1, df2, s=None, invert=False) Compute the Root Mean Square Deviation between molecules. Parameters df1 : pandas.DataFrame DataFrame with HETATM, ATOM, and/or ANISOU entries. df2 : pandas.DataFrame Second DataFrame for RMSD computation against df1. Must have the same number of entries as df1. s : {'main chain', 'hydrogen', 'c-alpha', 'heavy', 'carbon'} or None, default: None String to specify which entries to consider. If None, considers all atoms for comparison. invert : bool, default: False Inverts the string query if true. For example, the setting s='hydrogen', invert=True computes the RMSD based on all but hydrogen atoms. Returns rmsd : float Root Mean Square Deviation between df1 and df2 to_pdb(path, records=None, gz=False, append_newline=True) Write record DataFrames to a PDB file or gzipped PDB file. Parameters path : str A valid output path for the pdb file records : iterable, default: None A list of PDB record sections in {'ATOM', 'HETATM', 'ANISOU', 'OTHERS'} that are to be written. Writes all lines to PDB if records=None . gz : bool, default: False Writes a gzipped PDB file if True. append_newline : bool, default: True Appends a new line at the end of the PDB file if True","title":"Methods"},{"location":"api_modules/biopandas.pdb/PandasPdb/#properties","text":"df Acccess dictionary of pandas DataFrames for PDB record sections.","title":"Properties"},{"location":"api_modules/biopandas.testutils/assert_raises/","text":"assert_raises assert_raises(exception_type, message, func, args, * kwargs) Check that an exception is raised with a specific message Parameters exception_type : exception The exception that should be raised message : str (default: None) The error message that should be raised. Ignored if False or None func : callable The function that raises the exception *args : positional arguments to func **kwargs : keyword arguments to func","title":"Assert raises"},{"location":"api_modules/biopandas.testutils/assert_raises/#assert_raises","text":"assert_raises(exception_type, message, func, args, * kwargs) Check that an exception is raised with a specific message Parameters exception_type : exception The exception that should be raised message : str (default: None) The error message that should be raised. Ignored if False or None func : callable The function that raises the exception *args : positional arguments to func **kwargs : keyword arguments to func","title":"assert_raises"},{"location":"api_subpackages/biopandas.mol2/","text":"biopandas version: 0.2.5 PandasMol2 PandasMol2() Object for working with Tripos Mol2 structure files. Attributes df : pandas.DataFrame DataFrame of a Mol2's ATOM section mol2_text : str Mol2 file contents in string format code : str ID, code, or name of the molecule stored pdb_path : str Location of the MOL2 file that was read in via read_mol2 Methods distance(xyz=(0.0, 0.0, 0.0)) Computes Euclidean distance between atoms in self.df and a 3D point. Parameters xyz : tuple (0.00, 0.00, 0.00) X, Y, and Z coordinate of the reference center for the distance computation Returns pandas.Series : Pandas Series object containing the Euclidean distance between the atoms in the atom section and xyz . distance_df(df, xyz=(0.0, 0.0, 0.0)) Computes Euclidean distance between atoms and a 3D point. Parameters df : DataFrame DataFrame containing entries similar to the PandasMol2.df format for the the distance computation to the xyz reference coordinates. xyz : tuple (0.00, 0.00, 0.00) X, Y, and Z coordinate of the reference center for the distance computation Returns pandas.Series : Pandas Series object containing the Euclidean distance between the atoms in the atom section and xyz . read_mol2(path, columns=None) Reads Mol2 files (unzipped or gzipped) from local drive Note that if your mol2 file contains more than one molecule, only the first molecule is loaded into the DataFrame Attributes path : str Path to the Mol2 file in .mol2 format or gzipped format (.mol2.gz) columns : dict or None (default: None) If None, this methods expects a 9-column ATOM section that contains the following columns: {0:('atom_id', int), 1:('atom_name', str), 2:('x', float), 3:('y', float), 4:('z', float), 5:('atom_type', str), 6:('subst_id', int), 7:('subst_name', str), 8:('charge', float)} If your Mol2 files are formatted differently, you can provide your own column_mapping dictionary in a format similar to the one above. However, note that not all assert_raise_message methods may be supported then. Returns self read_mol2_from_list(mol2_lines, mol2_code, columns=None) Reads Mol2 file from a list into DataFrames Attributes mol2_lines : list A list of lines containing the mol2 file contents. For example, ['@ MOLECULE\\n', 'ZINC38611810\\n', ' 65 68 0 0 0\\n', 'SMALL\\n', 'NO_CHARGES\\n', '\\n', '@ ATOM\\n', ' 1 C1 -1.1786 2.7011 -4.0323 C.3 1 <0> -0.1537\\n', ' 2 C2 -1.2950 1.2442 -3.5798 C.3 1 <0> -0.1156\\n', ...] mol2_code : str or None Name or ID of the molecule. columns : dict or None (default: None) If None, this methods expects a 9-column ATOM section that contains the following columns: {0:('atom_id', int), 1:('atom_name', str), 2:('x', float), 3:('y', float), 4:('z', float), 5:('atom_type', str), 6:('subst_id', int), 7:('subst_name', str), 8:('charge', float)} If your Mol2 files are formatted differently, you can provide your own column_mapping dictionary in a format similar to the one above. However, note that not all assert_raise_message methods may be supported then. Returns self rmsd(df1, df2, heavy_only=True) Compute the Root Mean Square Deviation between molecules Parameters df1 : pandas.DataFrame DataFrame with HETATM, ATOM, and/or ANISOU entries df2 : pandas.DataFrame Second DataFrame for RMSD computation against df1. Must have the same number of entries as df1 heavy_only : bool (default: True) Which atoms to compare to compute the RMSD. If True (default), computes the RMSD between non-hydrogen atoms only. Returns rmsd : float Root Mean Square Deviation between df1 and df2 Properties df Acccesses the pandas DataFrame split_multimol2 split_multimol2(mol2_path) Splits a multi-mol2 file into individual Mol2 file contents. Parameters mol2_path : str Path to the multi-mol2 file. Parses gzip files if the filepath ends on .gz. Returns A generator object for lists for every extracted mol2-file. Lists contain the molecule ID and the mol2 file contents. e.g., ['ID1234', ['@ MOLECULE\\n', '...']]. Note that bytestrings are returned (for reasons of efficieny) if the Mol2 content is read from a gzip (.gz) file.","title":"biopandas.mol2"},{"location":"api_subpackages/biopandas.mol2/#pandasmol2","text":"PandasMol2() Object for working with Tripos Mol2 structure files. Attributes df : pandas.DataFrame DataFrame of a Mol2's ATOM section mol2_text : str Mol2 file contents in string format code : str ID, code, or name of the molecule stored pdb_path : str Location of the MOL2 file that was read in via read_mol2","title":"PandasMol2"},{"location":"api_subpackages/biopandas.mol2/#methods","text":"distance(xyz=(0.0, 0.0, 0.0)) Computes Euclidean distance between atoms in self.df and a 3D point. Parameters xyz : tuple (0.00, 0.00, 0.00) X, Y, and Z coordinate of the reference center for the distance computation Returns pandas.Series : Pandas Series object containing the Euclidean distance between the atoms in the atom section and xyz . distance_df(df, xyz=(0.0, 0.0, 0.0)) Computes Euclidean distance between atoms and a 3D point. Parameters df : DataFrame DataFrame containing entries similar to the PandasMol2.df format for the the distance computation to the xyz reference coordinates. xyz : tuple (0.00, 0.00, 0.00) X, Y, and Z coordinate of the reference center for the distance computation Returns pandas.Series : Pandas Series object containing the Euclidean distance between the atoms in the atom section and xyz . read_mol2(path, columns=None) Reads Mol2 files (unzipped or gzipped) from local drive Note that if your mol2 file contains more than one molecule, only the first molecule is loaded into the DataFrame Attributes path : str Path to the Mol2 file in .mol2 format or gzipped format (.mol2.gz) columns : dict or None (default: None) If None, this methods expects a 9-column ATOM section that contains the following columns: {0:('atom_id', int), 1:('atom_name', str), 2:('x', float), 3:('y', float), 4:('z', float), 5:('atom_type', str), 6:('subst_id', int), 7:('subst_name', str), 8:('charge', float)} If your Mol2 files are formatted differently, you can provide your own column_mapping dictionary in a format similar to the one above. However, note that not all assert_raise_message methods may be supported then. Returns self read_mol2_from_list(mol2_lines, mol2_code, columns=None) Reads Mol2 file from a list into DataFrames Attributes mol2_lines : list A list of lines containing the mol2 file contents. For example, ['@ MOLECULE\\n', 'ZINC38611810\\n', ' 65 68 0 0 0\\n', 'SMALL\\n', 'NO_CHARGES\\n', '\\n', '@ ATOM\\n', ' 1 C1 -1.1786 2.7011 -4.0323 C.3 1 <0> -0.1537\\n', ' 2 C2 -1.2950 1.2442 -3.5798 C.3 1 <0> -0.1156\\n', ...] mol2_code : str or None Name or ID of the molecule. columns : dict or None (default: None) If None, this methods expects a 9-column ATOM section that contains the following columns: {0:('atom_id', int), 1:('atom_name', str), 2:('x', float), 3:('y', float), 4:('z', float), 5:('atom_type', str), 6:('subst_id', int), 7:('subst_name', str), 8:('charge', float)} If your Mol2 files are formatted differently, you can provide your own column_mapping dictionary in a format similar to the one above. However, note that not all assert_raise_message methods may be supported then. Returns self rmsd(df1, df2, heavy_only=True) Compute the Root Mean Square Deviation between molecules Parameters df1 : pandas.DataFrame DataFrame with HETATM, ATOM, and/or ANISOU entries df2 : pandas.DataFrame Second DataFrame for RMSD computation against df1. Must have the same number of entries as df1 heavy_only : bool (default: True) Which atoms to compare to compute the RMSD. If True (default), computes the RMSD between non-hydrogen atoms only. Returns rmsd : float Root Mean Square Deviation between df1 and df2","title":"Methods"},{"location":"api_subpackages/biopandas.mol2/#properties","text":"df Acccesses the pandas DataFrame","title":"Properties"},{"location":"api_subpackages/biopandas.mol2/#split_multimol2","text":"split_multimol2(mol2_path) Splits a multi-mol2 file into individual Mol2 file contents. Parameters mol2_path : str Path to the multi-mol2 file. Parses gzip files if the filepath ends on .gz. Returns A generator object for lists for every extracted mol2-file. Lists contain the molecule ID and the mol2 file contents. e.g., ['ID1234', ['@ MOLECULE\\n', '...']]. Note that bytestrings are returned (for reasons of efficieny) if the Mol2 content is read from a gzip (.gz) file.","title":"split_multimol2"},{"location":"api_subpackages/biopandas.pdb/","text":"biopandas version: 0.2.5 PandasPdb PandasPdb() Object for working with Protein Databank structure files. Attributes df : dict Dictionary storing pandas DataFrames for PDB record sections. The dictionary keys are {'ATOM', 'HETATM', 'ANISOU', 'OTHERS'} where 'OTHERS' contains all entries that are not parsed as 'ATOM', 'HETATM', or 'ANISOU'. pdb_text : str PDB file contents in raw text format. pdb_path : str Location of the PDB file that was read in via read_pdb or URL of the page where the PDB content was fetched from if fetch_pdb was called. header : str PDB file description. code : str PDB code Methods amino3to1(record='ATOM', residue_col='residue_name', fillna='?') Creates 1-letter amino acid codes from DataFrame Non-canonical amino-acids are converted as follows: ASH (protonated ASP) => D CYX (disulfide-bonded CYS) => C GLH (protonated GLU) => E HID/HIE/HIP (different protonation states of HIS) = H HYP (hydroxyproline) => P MSE (selenomethionine) => M Parameters record : str, default: 'ATOM' Specfies the record DataFrame. residue_col : str, default: 'residue_name' Column in record DataFrame to look for 3-letter amino acid codes for the conversion. fillna : str, default: '?' Placeholder string to use for unknown amino acids. Returns pandas.DataFrame : Pandas DataFrame object consisting of two columns, 'chain_id' and 'residue_name' , where the former contains the chain ID of the amino acid and the latter contains the 1-letter amino acid code, respectively. distance(xyz=(0.0, 0.0, 0.0), records=('ATOM', 'HETATM')) Computes Euclidean distance between atoms and a 3D point. Parameters xyz : tuple, default: (0.00, 0.00, 0.00) X, Y, and Z coordinate of the reference center for the distance computation. records : iterable, default: ('ATOM', 'HETATM') Specify which record sections to consider. For example, to consider both protein and ligand atoms, set records=('ATOM', 'HETATM') . This setting is ignored if df is not set to None. For downward compatibility, a string argument is still supported but deprecated and will be removed in future versions. Returns pandas.Series : Pandas Series object containing the Euclidean distance between the atoms in the record section and xyz . distance_df(df, xyz=(0.0, 0.0, 0.0)) Computes Euclidean distance between atoms and a 3D point. Parameters df : DataFrame DataFrame containing entries in the PandasPdb.df['ATOM'] or PandasPdb.df['HETATM'] format for the the distance computation to the xyz reference coordinates. xyz : tuple, default: (0.00, 0.00, 0.00) X, Y, and Z coordinate of the reference center for the distance computation. Returns pandas.Series : Pandas Series object containing the Euclidean distance between the atoms in the record section and xyz . fetch_pdb(pdb_code) Fetches PDB file contents from the Protein Databank at rcsb.org. Parameters pdb_code : str A 4-letter PDB code, e.g., \"3eiy\". Returns self get(s, df=None, invert=False, records=('ATOM', 'HETATM')) Filter PDB DataFrames by properties Parameters s : str in {'main chain', 'hydrogen', 'c-alpha', 'heavy'} String to specify which entries to return. df : pandas.DataFrame, default: None Optional DataFrame to perform the filter operation on. If df=None, filters on self.df['ATOM']. invert : bool, default: True Inverts the search query. For example if s='hydrogen' and invert=True, all but hydrogen entries are returned. records : iterable, default: ('ATOM', 'HETATM') Specify which record sections to consider. For example, to consider both protein and ligand atoms, set records=('ATOM', 'HETATM') . This setting is ignored if df is not set to None. For downward compatibility, a string argument is still supported but deprecated and will be removed in future versions. Returns df : pandas.DataFrame Returns a DataFrame view on the filtered entries. impute_element(records=('ATOM', 'HETATM'), inplace=False) Impute element_symbol from atom_name section. Parameters records : iterable, default: ('ATOM', 'HETATM') Coordinate sections for which the element symbols should be imputed. inplace : bool, (default: False Performs the operation in-place if True and returns a copy of the PDB DataFrame otherwise. Returns DataFrame parse_sse() Parse secondary structure elements read_pdb(path) Read PDB files (unzipped or gzipped) from local drive Attributes path : str Path to the PDB file in .pdb format or gzipped format (.pdb.gz). Returns self rmsd(df1, df2, s=None, invert=False) Compute the Root Mean Square Deviation between molecules. Parameters df1 : pandas.DataFrame DataFrame with HETATM, ATOM, and/or ANISOU entries. df2 : pandas.DataFrame Second DataFrame for RMSD computation against df1. Must have the same number of entries as df1. s : {'main chain', 'hydrogen', 'c-alpha', 'heavy', 'carbon'} or None, default: None String to specify which entries to consider. If None, considers all atoms for comparison. invert : bool, default: False Inverts the string query if true. For example, the setting s='hydrogen', invert=True computes the RMSD based on all but hydrogen atoms. Returns rmsd : float Root Mean Square Deviation between df1 and df2 to_pdb(path, records=None, gz=False, append_newline=True) Write record DataFrames to a PDB file or gzipped PDB file. Parameters path : str A valid output path for the pdb file records : iterable, default: None A list of PDB record sections in {'ATOM', 'HETATM', 'ANISOU', 'OTHERS'} that are to be written. Writes all lines to PDB if records=None . gz : bool, default: False Writes a gzipped PDB file if True. append_newline : bool, default: True Appends a new line at the end of the PDB file if True Properties df Acccess dictionary of pandas DataFrames for PDB record sections.","title":"biopandas.pdb"},{"location":"api_subpackages/biopandas.pdb/#pandaspdb","text":"PandasPdb() Object for working with Protein Databank structure files. Attributes df : dict Dictionary storing pandas DataFrames for PDB record sections. The dictionary keys are {'ATOM', 'HETATM', 'ANISOU', 'OTHERS'} where 'OTHERS' contains all entries that are not parsed as 'ATOM', 'HETATM', or 'ANISOU'. pdb_text : str PDB file contents in raw text format. pdb_path : str Location of the PDB file that was read in via read_pdb or URL of the page where the PDB content was fetched from if fetch_pdb was called. header : str PDB file description. code : str PDB code","title":"PandasPdb"},{"location":"api_subpackages/biopandas.pdb/#methods","text":"amino3to1(record='ATOM', residue_col='residue_name', fillna='?') Creates 1-letter amino acid codes from DataFrame Non-canonical amino-acids are converted as follows: ASH (protonated ASP) => D CYX (disulfide-bonded CYS) => C GLH (protonated GLU) => E HID/HIE/HIP (different protonation states of HIS) = H HYP (hydroxyproline) => P MSE (selenomethionine) => M Parameters record : str, default: 'ATOM' Specfies the record DataFrame. residue_col : str, default: 'residue_name' Column in record DataFrame to look for 3-letter amino acid codes for the conversion. fillna : str, default: '?' Placeholder string to use for unknown amino acids. Returns pandas.DataFrame : Pandas DataFrame object consisting of two columns, 'chain_id' and 'residue_name' , where the former contains the chain ID of the amino acid and the latter contains the 1-letter amino acid code, respectively. distance(xyz=(0.0, 0.0, 0.0), records=('ATOM', 'HETATM')) Computes Euclidean distance between atoms and a 3D point. Parameters xyz : tuple, default: (0.00, 0.00, 0.00) X, Y, and Z coordinate of the reference center for the distance computation. records : iterable, default: ('ATOM', 'HETATM') Specify which record sections to consider. For example, to consider both protein and ligand atoms, set records=('ATOM', 'HETATM') . This setting is ignored if df is not set to None. For downward compatibility, a string argument is still supported but deprecated and will be removed in future versions. Returns pandas.Series : Pandas Series object containing the Euclidean distance between the atoms in the record section and xyz . distance_df(df, xyz=(0.0, 0.0, 0.0)) Computes Euclidean distance between atoms and a 3D point. Parameters df : DataFrame DataFrame containing entries in the PandasPdb.df['ATOM'] or PandasPdb.df['HETATM'] format for the the distance computation to the xyz reference coordinates. xyz : tuple, default: (0.00, 0.00, 0.00) X, Y, and Z coordinate of the reference center for the distance computation. Returns pandas.Series : Pandas Series object containing the Euclidean distance between the atoms in the record section and xyz . fetch_pdb(pdb_code) Fetches PDB file contents from the Protein Databank at rcsb.org. Parameters pdb_code : str A 4-letter PDB code, e.g., \"3eiy\". Returns self get(s, df=None, invert=False, records=('ATOM', 'HETATM')) Filter PDB DataFrames by properties Parameters s : str in {'main chain', 'hydrogen', 'c-alpha', 'heavy'} String to specify which entries to return. df : pandas.DataFrame, default: None Optional DataFrame to perform the filter operation on. If df=None, filters on self.df['ATOM']. invert : bool, default: True Inverts the search query. For example if s='hydrogen' and invert=True, all but hydrogen entries are returned. records : iterable, default: ('ATOM', 'HETATM') Specify which record sections to consider. For example, to consider both protein and ligand atoms, set records=('ATOM', 'HETATM') . This setting is ignored if df is not set to None. For downward compatibility, a string argument is still supported but deprecated and will be removed in future versions. Returns df : pandas.DataFrame Returns a DataFrame view on the filtered entries. impute_element(records=('ATOM', 'HETATM'), inplace=False) Impute element_symbol from atom_name section. Parameters records : iterable, default: ('ATOM', 'HETATM') Coordinate sections for which the element symbols should be imputed. inplace : bool, (default: False Performs the operation in-place if True and returns a copy of the PDB DataFrame otherwise. Returns DataFrame parse_sse() Parse secondary structure elements read_pdb(path) Read PDB files (unzipped or gzipped) from local drive Attributes path : str Path to the PDB file in .pdb format or gzipped format (.pdb.gz). Returns self rmsd(df1, df2, s=None, invert=False) Compute the Root Mean Square Deviation between molecules. Parameters df1 : pandas.DataFrame DataFrame with HETATM, ATOM, and/or ANISOU entries. df2 : pandas.DataFrame Second DataFrame for RMSD computation against df1. Must have the same number of entries as df1. s : {'main chain', 'hydrogen', 'c-alpha', 'heavy', 'carbon'} or None, default: None String to specify which entries to consider. If None, considers all atoms for comparison. invert : bool, default: False Inverts the string query if true. For example, the setting s='hydrogen', invert=True computes the RMSD based on all but hydrogen atoms. Returns rmsd : float Root Mean Square Deviation between df1 and df2 to_pdb(path, records=None, gz=False, append_newline=True) Write record DataFrames to a PDB file or gzipped PDB file. Parameters path : str A valid output path for the pdb file records : iterable, default: None A list of PDB record sections in {'ATOM', 'HETATM', 'ANISOU', 'OTHERS'} that are to be written. Writes all lines to PDB if records=None . gz : bool, default: False Writes a gzipped PDB file if True. append_newline : bool, default: True Appends a new line at the end of the PDB file if True","title":"Methods"},{"location":"api_subpackages/biopandas.pdb/#properties","text":"df Acccess dictionary of pandas DataFrames for PDB record sections.","title":"Properties"},{"location":"api_subpackages/biopandas.testutils/","text":"biopandas version: 0.2.5 assert_raises assert_raises(exception_type, message, func, args, * kwargs) Check that an exception is raised with a specific message Parameters exception_type : exception The exception that should be raised message : str (default: None) The error message that should be raised. Ignored if False or None func : callable The function that raises the exception *args : positional arguments to func **kwargs : keyword arguments to func","title":"Biopandas.testutils"},{"location":"api_subpackages/biopandas.testutils/#assert_raises","text":"assert_raises(exception_type, message, func, args, * kwargs) Check that an exception is raised with a specific message Parameters exception_type : exception The exception that should be raised message : str (default: None) The error message that should be raised. Ignored if False or None func : callable The function that raises the exception *args : positional arguments to func **kwargs : keyword arguments to func","title":"assert_raises"},{"location":"tutorials/Working_with_MOL2_Structures_in_DataFrames/","text":"Working with MOL2 Structures in DataFrames The Tripos MOL2 format is a common format for working with small molecules. In this tutorial, we will go over some examples that illustrate how we can use Biopandas' MOL2 DataFrames to analyze molecules conveniently. Loading MOL2 Files Using the read_mol2 method, we can read MOL2 files from standard .mol2 text files: from biopandas.mol2 import PandasMol2 pmol = PandasMol2().read_mol2('./data/1b5e_1.mol2') [File link: 1b5e_1.mol2 ] The read_mol2 method can also load structures from .mol2.gz files, but if you have a multi-mol2 file, keep in mind that it will only fetch the first molecule in this file. In the section \" Parsing Multi-MOL2 files ,\" we will see how we can parse files that contain multiple structures. pmol = PandasMol2().read_mol2('./data/40_mol2_files.mol2.gz') [File link: 40_mol2_files.mol2.gz ] After the file was succesfully loaded, we have access to the following basic PandasMol2 attributes: print('Molecule ID: %s' % pmol.code) print('\\nRaw MOL2 file contents:\\n\\n%s\\n...' % pmol.mol2_text[:500]) Molecule ID: ZINC38611810 Raw MOL2 file contents: @MOLECULE ZINC38611810 65 68 0 0 0 SMALL NO_CHARGES @ATOM 1 C1 -1.1786 2.7011 -4.0323 C.3 1 <0> -0.1537 2 C2 -1.2950 1.2442 -3.5798 C.3 1 <0> -0.1156 3 C3 -0.1742 0.4209 -4.2178 C.3 1 <0> -0.1141 4 C4 -0.2887 -1.0141 -3.7721 C.2 1 <0> 0.4504 5 O1 -1.1758 -1.3445 -3.0212 O.2 1 <0> -0.4896 6 O2 ... The most interesting and useful attribute, however, is the PandasMol2.df DataFrame, which contains the ATOM section of the MOL2 structure. Let's print the first 3 lines from the ATOM coordinate section to see how it looks like: pmol.df.head(3) .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } atom_id atom_name x y ... atom_type subst_id subst_name charge 0 1 C1 -1.1786 2.7011 ... C.3 1 <0> -0.1537 1 2 C2 -1.2950 1.2442 ... C.3 1 <0> -0.1156 2 3 C3 -0.1742 0.4209 ... C.3 1 <0> -0.1141 3 rows \u00d7 9 columns The MOL2 Data Format PandasMol2 expects the MOL2 file to be in the standard Tripos MOL2 format, and most importantly, that the \"@ ATOM\" section is consistent with the following format convention: Format: atom_id atom_name x y z atom_type [subst_id [subst_name [charge [status_bit]]]] atom_id (integer) = the ID number of the atom at the time the file was created. This is provided for reference only and is not used when the .mol2 file is read into SYBYL. atom_name (string) = the name of the atom. x (real) = the x coordinate of the atom. y (real) = the y coordinate of the atom. z (real) = the z coordinate of the atom. atom_type (string) = the SYBYL atom type for the atom. subst_id (integer) = the ID number of the substructure containing the atom. subst_name (string) = the name of the substructure containing the atom. charge (real) = the charge associated with the atom. status_bit (string) = the internal SYBYL status bits associated with the atom. These should never be set by the user. Valid status bits are DSPMOD, TYPECOL, CAP, BACKBONE, DICT, ESSENTIAL, WATER and DIRECT. For example, the contents of a typical Tripos MOL2 file may look like this: @MOLECULE DCM Pose 1 32 33 0 0 0 SMALL USER_CHARGES @ATOM 1 C1 18.8934 5.5819 24.1747 C.2 1 <0> -0.1356 2 C2 18.1301 4.7642 24.8969 C.2 1 <0> -0.0410 3 C3 18.2645 6.8544 23.7342 C.2 1 <0> 0.4856 ... 31 H11 18.5977 8.5756 22.6932 H 1 <0> 0.4000 32 H12 14.2530 1.0535 27.4278 H 1 <0> 0.4000 @BOND 1 1 2 2 2 1 3 1 3 2 11 1 4 3 10 2 5 3 12 1 ... 28 8 27 1 29 9 28 1 30 9 29 1 31 12 30 1 32 12 31 1 33 18 32 1 Working with MOL2 DataFrames In the previous sections, we've seen how to load MOL2 structures into DataFrames and how to access them. Once, we have the ATOM section of a MOL2 file in a DataFrame format, we can readily slice and dice the molecular structure and analyze it. To demonstrate some typical use cases, let us load the structure of deoxycytidylate hydroxymethylase (DCM), which is shown in the figure below: from biopandas.mol2 import PandasMol2 pmol = PandasMol2() pmol.read_mol2('./data/1b5e_1.mol2') pmol.df.tail(10) .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } atom_id atom_name x y ... atom_type subst_id subst_name charge 22 23 H3 15.8520 2.8983 ... H 1 <0> 0.0 23 24 H4 14.3405 3.3601 ... H 1 <0> 0.0 24 25 H5 15.3663 0.9351 ... H 1 <0> 0.0 25 26 H6 16.6681 1.6130 ... H 1 <0> 0.0 26 27 H7 15.3483 4.6961 ... H 1 <0> 0.0 27 28 H8 18.8490 1.8078 ... H 1 <0> 0.0 28 29 H9 17.8303 1.5497 ... H 1 <0> 0.0 29 30 H10 19.9527 7.4708 ... H 1 <0> 0.4 30 31 H11 18.5977 8.5756 ... H 1 <0> 0.4 31 32 H12 14.2530 1.0535 ... H 1 <0> 0.4 10 rows \u00d7 9 columns [File link: 1b5e_1.mol2 ] For example, we can select all hydrogen atoms by filtering on the atom type column: pmol.df[pmol.df['atom_type'] != 'H'].tail(10) .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } atom_id atom_name x y ... atom_type subst_id subst_name charge 10 11 N2 16.8196 5.0644 ... N.am 1 <0> -0.4691 11 12 N3 19.0194 7.7275 ... N.pl3 1 <0> -0.8500 12 13 O1 18.7676 -2.3524 ... O.3 1 <0> -1.0333 13 14 O2 20.3972 -0.3812 ... O.3 1 <0> -1.0333 14 15 O3 15.0888 6.5824 ... O.2 1 <0> -0.5700 15 16 O4 18.9314 -0.7527 ... O.2 1 <0> -1.0333 16 17 O5 16.9690 3.4315 ... O.3 1 <0> -0.5600 17 18 O6 14.3223 1.8946 ... O.3 1 <0> -0.6800 18 19 O7 17.9091 -0.0135 ... O.3 1 <0> -0.5512 19 20 P1 19.0969 -0.9440 ... P.3 1 <0> 1.3712 10 rows \u00d7 9 columns Or, if we like to count the number of keto-groups in this molecule, we can do the following: keto = pmol.df[pmol.df['atom_type'] == 'O.2'] print('number of keto groups: %d' % keto.shape[0]) keto number of keto groups: 2 .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } atom_id atom_name x y ... atom_type subst_id subst_name charge 14 15 O3 15.0888 6.5824 ... O.2 1 <0> -0.5700 15 16 O4 18.9314 -0.7527 ... O.2 1 <0> -1.0333 2 rows \u00d7 9 columns A list of all the allowed atom types that can be found in Tripos MOL2 files is provided below: Code Definition C.3 carbon sp3 C.2 carbon sp2 C.1 carbon sp C.ar carbon aromatic C.cat cabocation (C+) used only in a guadinium group N.3 nitrogen sp3 N.2 nitrogen sp2 N.1 nitrogen sp N.ar nitrogen aromatic N.am nitrogen amide N.pl3 nitrogen trigonal planar N.4 nitrogen sp3 positively charged O.3 oxygen sp3 O.2 oxygen sp2 O.co2 oxygen in carboxylate and phosphate groups O.spc oxygen in Single Point Charge (SPC) water model O.t3p oxygen in Transferable Intermolecular Potential (TIP3P) water model S.3 sulfur sp3 S.2 sulfur sp2 S.O sulfoxide sulfur S.O2/S.o2 sulfone sulfur P.3 phosphorous sp3 F fluorine H hydrogen H.spc hydrogen in Single Point Charge (SPC) water model H.t3p hydrogen in Transferable Intermolecular Potential (TIP3P) water model LP lone pair Du dummy atom Du.C dummy carbon Any any atom Hal halogen Het heteroatom = N, O, S, P Hev heavy atom (non hydrogen) Li lithium Na sodium Mg magnesium Al aluminum Si silicon K potassium Ca calcium Cr.thm chromium (tetrahedral) Cr.oh chromium (octahedral) Mn manganese Fe iron Co.oh cobalt (octahedral) Cu copper Plotting Since we are using pandas under the hood, which in turns uses matplotlib under the hood, we can produce quick summary plots of our MOL2 structures conveniently. Below are a few examples of how to visualize molecular properties. from biopandas.mol2 import PandasMol2 pmol = PandasMol2().read_mol2('./data/1b5e_1.mol2') [File link: 1b5e_1.mol2 ] %matplotlib inline import matplotlib.pyplot as plt from matplotlib import style style.use('ggplot') For instance, let's say we are interested in the counts of the different atom types that can be found in the MOL2 file; we could do the following: pmol.df['atom_type'].value_counts().plot(kind='bar') plt.xlabel('atom type') plt.ylabel('count') plt.show() If this is too fine-grained for our needs, we could summarize the different atom types by atomic elements: pmol.df['element_type'] = pmol.df['atom_type'].apply(lambda x: x.split('.')[0]) pmol.df['element_type'].value_counts().plot(kind='bar') plt.xlabel('element type') plt.ylabel('count') plt.show() One of the coolest features in pandas is the groupby method. Below is an example plotting the average charge of the different atom types with the standard deviation as error bars: groupby_charge = pmol.df.groupby(['atom_type'])['charge'] groupby_charge.mean().plot(kind='bar', yerr=groupby_charge.std()) plt.ylabel('charge') plt.show() Computing the Root Mean Square Deviation The Root-mean-square deviation (RMSD) is simply a measure of the average distance between atoms of 2 structures. This calculation of the Cartesian error follows the equation: RMSD(a, b) = \\sqrt{\\frac{1}{n} \\sum^{n}_{i=1} \\big((a_{ix})^2 + (a_{iy})^2 + (a_{iz})^2 \\big)} \\\\ = \\sqrt{\\frac{1}{n} \\sum^{n}_{i=1} || a_i + b_i||_2^2} So, assuming that the we have the following 2 conformations of a ligand molecule we can compute the RMSD as follows: from biopandas.mol2 import PandasMol2 l_1 = PandasMol2().read_mol2('./data/1b5e_1.mol2') l_2 = PandasMol2().read_mol2('./data/1b5e_2.mol2') r_heavy = PandasMol2.rmsd(l_1.df, l_2.df) r_all = PandasMol2.rmsd(l_1.df, l_2.df, heavy_only=False) print('Heavy-atom RMSD: %.4f Angstrom' % r_heavy) print('All-atom RMSD: %.4f Angstrom' % r_all) Heavy-atom RMSD: 1.1609 Angstrom All-atom RMSD: 1.5523 Angstrom [File links: 1b5e_1.mol2 , 1b5e_2.mol2 ] Filtering Atoms by Distance We can use the distance method to compute the distance between each atom (or a subset of atoms) in our data frame and a three-dimensional reference point. For example, let's assume were are interested in computing the distance between a keto group in the DMC molecule, which we've seen earlier, and other atoms in the same molecule. First, let's get the coordinates of all keto-groups in this molecule: from biopandas.mol2 import PandasMol2 pmol = PandasMol2().read_mol2('./data/1b5e_1.mol2') keto_coord = pmol.df[pmol.df['atom_type'] == 'O.2'][['x', 'y', 'z']] keto_coord .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } x y z 14 15.0888 6.5824 25.0727 15 18.9314 -0.7527 24.1606 In the following example, we use PandasMol2 's distance method. The distance method returns a pandas Series object containing the Euclidean distance between an atom and all other atoms in the structure. In the following example, keto_coord.values[0] refers to the x, y, z coordinates of the first row (i.e., first keto group) in the array above: print('x, y, z coords:', keto_coord.values[0]) distances = pmol.distance(keto_coord.values[0]) x, y, z coords: [15.0888 6.5824 25.0727] For our convenience, we can add these distances to our MOL2 DataFrame: pmol.df['distances'] = distances pmol.df.head() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } atom_id atom_name x y ... subst_id subst_name charge distances 0 1 C1 18.8934 5.5819 ... 1 <0> -0.1356 4.035144 1 2 C2 18.1301 4.7642 ... 1 <0> -0.0410 3.547712 2 3 C3 18.2645 6.8544 ... 1 <0> 0.4856 3.456969 3 4 C4 16.2520 6.2866 ... 1 <0> 0.8410 1.232313 4 5 C5 15.3820 3.0682 ... 1 <0> 0.0000 3.527546 5 rows \u00d7 10 columns Now, say we are interested in the Euclidean distance between the two keto groups in the molecule: pmol.df[pmol.df['atom_type'] == 'O.2'] .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } atom_id atom_name x y ... subst_id subst_name charge distances 14 15 O3 15.0888 6.5824 ... 1 <0> -0.5700 0.000000 15 16 O4 18.9314 -0.7527 ... 1 <0> -1.0333 8.330738 2 rows \u00d7 10 columns In the example above, the distance between the two keto groups is 8 angstrom. Another common task that we can perform using these atomic distances is to select only the neighboring atoms of the keto group (here: atoms within 3 angstrom). The code is as follows: all_within_3A = pmol.df[pmol.df['distances'] <= 3.0] all_within_3A.tail() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } atom_id atom_name x y ... subst_id subst_name charge distances 7 8 C8 16.0764 4.1199 ... 1 <0> 0.5801 2.814490 9 10 N1 17.0289 7.1510 ... 1 <0> -0.6610 2.269690 10 11 N2 16.8196 5.0644 ... 1 <0> -0.4691 2.307553 14 15 O3 15.0888 6.5824 ... 1 <0> -0.5700 0.000000 26 27 H7 15.3483 4.6961 ... 1 <0> 0.0000 2.446817 5 rows \u00d7 10 columns Parsing Multi-MOL2 files Basic Multi-MOL2 File Parsing As mentioned earlier, PandasMol2.read_mol2 method only reads in the first molecule if it is given a multi-MOL2 file. However, if we want to create DataFrames from multiple structures in a MOL2 file, we can use the handy split_multimol2 generator. The split_multimol2 generator yields tuples containing the molecule IDs and the MOL2 content as strings in a list -- each line in the MOL2 file is stored as a string in the list. from biopandas.mol2 import split_multimol2 mol2_id, mol2_cont = next(split_multimol2('./data/40_mol2_files.mol2')) print('Molecule ID:\\n', mol2_id) print('First 10 lines:\\n', mol2_cont[:10]) Molecule ID: ZINC38611810 First 10 lines: ['@MOLECULE\\n', 'ZINC38611810\\n', ' 65 68 0 0 0\\n', 'SMALL\\n', 'NO_CHARGES\\n', '\\n', '@ATOM\\n', ' 1 C1 -1.1786 2.7011 -4.0323 C.3 1 <0> -0.1537\\n', ' 2 C2 -1.2950 1.2442 -3.5798 C.3 1 <0> -0.1156\\n', ' 3 C3 -0.1742 0.4209 -4.2178 C.3 1 <0> -0.1141\\n'] [File link: 40_mol2_files.mol2 ] We can now use this generator to loop over all files in a multi-MOL2 file and create PandasMol2 DataFrames. A typical use case would be the filtering of mol2 files by certain properties: pdmol = PandasMol2() with open('./data/filtered.mol2', 'w') as f: for mol2 in split_multimol2('./data/40_mol2_files.mol2'): pdmol.read_mol2_from_list(mol2_lines=mol2[1], mol2_code=mol2[0]) # do some analysis keep_molecule = False # save molecule if it passes our filter criterion if keep_molecule: # note that the mol2_text contains the original mol2 content f.write(pdmol.mol2_text) Using Multiprocessing for Multi-MOL2 File Analysis To improve the computational efficiency and throughput for multi-mol2 analyses, it is recommended to use the mputil package, which evaluates Python generators lazily. The lazy_imap function from mputil is based on Python's standardlib multiprocessing imap function, but it doesn't consume the generator upfront. This lazy evaluation is important, for example, if we are parsing large (possibly Gigabyte- or Terabyte-large) multi-mol2 files for multiprocessing. The following example provides a template for atom-type based molecule queries, but the data_processor function can be extended to do any kind of functional group queries (for example, involving the 'charge' column and/or PandasMol2.distance method). import pandas as pd from mputil import lazy_imap from biopandas.mol2 import PandasMol2 from biopandas.mol2 import split_multimol2 --------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) in () 1 import pandas as pd ----> 2 from mputil import lazy_imap 3 from biopandas.mol2 import PandasMol2 4 from biopandas.mol2 import split_multimol2 ModuleNotFoundError: No module named 'mputil' # Selection strings to capture # all molecules that contain at least one sp2 hybridized # oxygen atom and at least one Fluorine atom SELECTIONS = [\"(pdmol.df.atom_type == 'O.2')\", \"(pdmol.df.atom_type == 'F')\"] # Path to the multi-mol2 input file MOL2_FILE = \"./data/40_mol2_files.mol2\" # Data processing function to be run in parallel def data_processor(mol2): \"\"\"Return molecule ID if there's a match and '' otherwise\"\"\" pdmol = PandasMol2().read_mol2_from_list(mol2_lines=mol2[1], mol2_code=mol2[0]) match = mol2[0] for sub_sele in SELECTIONS: if not pd.eval(sub_sele).any(): match = '' break return match # Process molecules and save IDs of hits to disk with open('./data/selected_ids.txt', 'w') as f: searched, found = 0, 0 for chunk in lazy_imap(data_processor=data_processor, data_generator=split_multimol2(MOL2_FILE), n_cpus=0): # means all available cpus for mol2_id in chunk: if mol2_id: # write IDs of matching molecules to disk f.write('%s\\n' % mol2_id) found += 1 searched += len(chunk) print('Searched %d molecules. Got %d hits.' % (searched, found)) [Input File link: 40_mol2_files.mol2 ] [Output File link: selected_ids.txt ]","title":"Working with MOL2 Structures in DataFrames"},{"location":"tutorials/Working_with_MOL2_Structures_in_DataFrames/#working-with-mol2-structures-in-dataframes","text":"The Tripos MOL2 format is a common format for working with small molecules. In this tutorial, we will go over some examples that illustrate how we can use Biopandas' MOL2 DataFrames to analyze molecules conveniently.","title":"Working with MOL2 Structures in DataFrames"},{"location":"tutorials/Working_with_MOL2_Structures_in_DataFrames/#loading-mol2-files","text":"Using the read_mol2 method, we can read MOL2 files from standard .mol2 text files: from biopandas.mol2 import PandasMol2 pmol = PandasMol2().read_mol2('./data/1b5e_1.mol2') [File link: 1b5e_1.mol2 ] The read_mol2 method can also load structures from .mol2.gz files, but if you have a multi-mol2 file, keep in mind that it will only fetch the first molecule in this file. In the section \" Parsing Multi-MOL2 files ,\" we will see how we can parse files that contain multiple structures. pmol = PandasMol2().read_mol2('./data/40_mol2_files.mol2.gz') [File link: 40_mol2_files.mol2.gz ] After the file was succesfully loaded, we have access to the following basic PandasMol2 attributes: print('Molecule ID: %s' % pmol.code) print('\\nRaw MOL2 file contents:\\n\\n%s\\n...' % pmol.mol2_text[:500]) Molecule ID: ZINC38611810 Raw MOL2 file contents: @MOLECULE ZINC38611810 65 68 0 0 0 SMALL NO_CHARGES @ATOM 1 C1 -1.1786 2.7011 -4.0323 C.3 1 <0> -0.1537 2 C2 -1.2950 1.2442 -3.5798 C.3 1 <0> -0.1156 3 C3 -0.1742 0.4209 -4.2178 C.3 1 <0> -0.1141 4 C4 -0.2887 -1.0141 -3.7721 C.2 1 <0> 0.4504 5 O1 -1.1758 -1.3445 -3.0212 O.2 1 <0> -0.4896 6 O2 ... The most interesting and useful attribute, however, is the PandasMol2.df DataFrame, which contains the ATOM section of the MOL2 structure. Let's print the first 3 lines from the ATOM coordinate section to see how it looks like: pmol.df.head(3) .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } atom_id atom_name x y ... atom_type subst_id subst_name charge 0 1 C1 -1.1786 2.7011 ... C.3 1 <0> -0.1537 1 2 C2 -1.2950 1.2442 ... C.3 1 <0> -0.1156 2 3 C3 -0.1742 0.4209 ... C.3 1 <0> -0.1141 3 rows \u00d7 9 columns","title":"Loading MOL2 Files"},{"location":"tutorials/Working_with_MOL2_Structures_in_DataFrames/#the-mol2-data-format","text":"PandasMol2 expects the MOL2 file to be in the standard Tripos MOL2 format, and most importantly, that the \"@ ATOM\" section is consistent with the following format convention: Format: atom_id atom_name x y z atom_type [subst_id [subst_name [charge [status_bit]]]] atom_id (integer) = the ID number of the atom at the time the file was created. This is provided for reference only and is not used when the .mol2 file is read into SYBYL. atom_name (string) = the name of the atom. x (real) = the x coordinate of the atom. y (real) = the y coordinate of the atom. z (real) = the z coordinate of the atom. atom_type (string) = the SYBYL atom type for the atom. subst_id (integer) = the ID number of the substructure containing the atom. subst_name (string) = the name of the substructure containing the atom. charge (real) = the charge associated with the atom. status_bit (string) = the internal SYBYL status bits associated with the atom. These should never be set by the user. Valid status bits are DSPMOD, TYPECOL, CAP, BACKBONE, DICT, ESSENTIAL, WATER and DIRECT. For example, the contents of a typical Tripos MOL2 file may look like this: @MOLECULE DCM Pose 1 32 33 0 0 0 SMALL USER_CHARGES @ATOM 1 C1 18.8934 5.5819 24.1747 C.2 1 <0> -0.1356 2 C2 18.1301 4.7642 24.8969 C.2 1 <0> -0.0410 3 C3 18.2645 6.8544 23.7342 C.2 1 <0> 0.4856 ... 31 H11 18.5977 8.5756 22.6932 H 1 <0> 0.4000 32 H12 14.2530 1.0535 27.4278 H 1 <0> 0.4000 @BOND 1 1 2 2 2 1 3 1 3 2 11 1 4 3 10 2 5 3 12 1 ... 28 8 27 1 29 9 28 1 30 9 29 1 31 12 30 1 32 12 31 1 33 18 32 1","title":"The MOL2 Data Format"},{"location":"tutorials/Working_with_MOL2_Structures_in_DataFrames/#working-with-mol2-dataframes","text":"In the previous sections, we've seen how to load MOL2 structures into DataFrames and how to access them. Once, we have the ATOM section of a MOL2 file in a DataFrame format, we can readily slice and dice the molecular structure and analyze it. To demonstrate some typical use cases, let us load the structure of deoxycytidylate hydroxymethylase (DCM), which is shown in the figure below: from biopandas.mol2 import PandasMol2 pmol = PandasMol2() pmol.read_mol2('./data/1b5e_1.mol2') pmol.df.tail(10) .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } atom_id atom_name x y ... atom_type subst_id subst_name charge 22 23 H3 15.8520 2.8983 ... H 1 <0> 0.0 23 24 H4 14.3405 3.3601 ... H 1 <0> 0.0 24 25 H5 15.3663 0.9351 ... H 1 <0> 0.0 25 26 H6 16.6681 1.6130 ... H 1 <0> 0.0 26 27 H7 15.3483 4.6961 ... H 1 <0> 0.0 27 28 H8 18.8490 1.8078 ... H 1 <0> 0.0 28 29 H9 17.8303 1.5497 ... H 1 <0> 0.0 29 30 H10 19.9527 7.4708 ... H 1 <0> 0.4 30 31 H11 18.5977 8.5756 ... H 1 <0> 0.4 31 32 H12 14.2530 1.0535 ... H 1 <0> 0.4 10 rows \u00d7 9 columns [File link: 1b5e_1.mol2 ] For example, we can select all hydrogen atoms by filtering on the atom type column: pmol.df[pmol.df['atom_type'] != 'H'].tail(10) .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } atom_id atom_name x y ... atom_type subst_id subst_name charge 10 11 N2 16.8196 5.0644 ... N.am 1 <0> -0.4691 11 12 N3 19.0194 7.7275 ... N.pl3 1 <0> -0.8500 12 13 O1 18.7676 -2.3524 ... O.3 1 <0> -1.0333 13 14 O2 20.3972 -0.3812 ... O.3 1 <0> -1.0333 14 15 O3 15.0888 6.5824 ... O.2 1 <0> -0.5700 15 16 O4 18.9314 -0.7527 ... O.2 1 <0> -1.0333 16 17 O5 16.9690 3.4315 ... O.3 1 <0> -0.5600 17 18 O6 14.3223 1.8946 ... O.3 1 <0> -0.6800 18 19 O7 17.9091 -0.0135 ... O.3 1 <0> -0.5512 19 20 P1 19.0969 -0.9440 ... P.3 1 <0> 1.3712 10 rows \u00d7 9 columns Or, if we like to count the number of keto-groups in this molecule, we can do the following: keto = pmol.df[pmol.df['atom_type'] == 'O.2'] print('number of keto groups: %d' % keto.shape[0]) keto number of keto groups: 2 .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } atom_id atom_name x y ... atom_type subst_id subst_name charge 14 15 O3 15.0888 6.5824 ... O.2 1 <0> -0.5700 15 16 O4 18.9314 -0.7527 ... O.2 1 <0> -1.0333 2 rows \u00d7 9 columns A list of all the allowed atom types that can be found in Tripos MOL2 files is provided below: Code Definition C.3 carbon sp3 C.2 carbon sp2 C.1 carbon sp C.ar carbon aromatic C.cat cabocation (C+) used only in a guadinium group N.3 nitrogen sp3 N.2 nitrogen sp2 N.1 nitrogen sp N.ar nitrogen aromatic N.am nitrogen amide N.pl3 nitrogen trigonal planar N.4 nitrogen sp3 positively charged O.3 oxygen sp3 O.2 oxygen sp2 O.co2 oxygen in carboxylate and phosphate groups O.spc oxygen in Single Point Charge (SPC) water model O.t3p oxygen in Transferable Intermolecular Potential (TIP3P) water model S.3 sulfur sp3 S.2 sulfur sp2 S.O sulfoxide sulfur S.O2/S.o2 sulfone sulfur P.3 phosphorous sp3 F fluorine H hydrogen H.spc hydrogen in Single Point Charge (SPC) water model H.t3p hydrogen in Transferable Intermolecular Potential (TIP3P) water model LP lone pair Du dummy atom Du.C dummy carbon Any any atom Hal halogen Het heteroatom = N, O, S, P Hev heavy atom (non hydrogen) Li lithium Na sodium Mg magnesium Al aluminum Si silicon K potassium Ca calcium Cr.thm chromium (tetrahedral) Cr.oh chromium (octahedral) Mn manganese Fe iron Co.oh cobalt (octahedral) Cu copper","title":"Working with MOL2 DataFrames"},{"location":"tutorials/Working_with_MOL2_Structures_in_DataFrames/#plotting","text":"Since we are using pandas under the hood, which in turns uses matplotlib under the hood, we can produce quick summary plots of our MOL2 structures conveniently. Below are a few examples of how to visualize molecular properties. from biopandas.mol2 import PandasMol2 pmol = PandasMol2().read_mol2('./data/1b5e_1.mol2') [File link: 1b5e_1.mol2 ] %matplotlib inline import matplotlib.pyplot as plt from matplotlib import style style.use('ggplot') For instance, let's say we are interested in the counts of the different atom types that can be found in the MOL2 file; we could do the following: pmol.df['atom_type'].value_counts().plot(kind='bar') plt.xlabel('atom type') plt.ylabel('count') plt.show() If this is too fine-grained for our needs, we could summarize the different atom types by atomic elements: pmol.df['element_type'] = pmol.df['atom_type'].apply(lambda x: x.split('.')[0]) pmol.df['element_type'].value_counts().plot(kind='bar') plt.xlabel('element type') plt.ylabel('count') plt.show() One of the coolest features in pandas is the groupby method. Below is an example plotting the average charge of the different atom types with the standard deviation as error bars: groupby_charge = pmol.df.groupby(['atom_type'])['charge'] groupby_charge.mean().plot(kind='bar', yerr=groupby_charge.std()) plt.ylabel('charge') plt.show()","title":"Plotting"},{"location":"tutorials/Working_with_MOL2_Structures_in_DataFrames/#computing-the-root-mean-square-deviation","text":"The Root-mean-square deviation (RMSD) is simply a measure of the average distance between atoms of 2 structures. This calculation of the Cartesian error follows the equation: RMSD(a, b) = \\sqrt{\\frac{1}{n} \\sum^{n}_{i=1} \\big((a_{ix})^2 + (a_{iy})^2 + (a_{iz})^2 \\big)} \\\\ = \\sqrt{\\frac{1}{n} \\sum^{n}_{i=1} || a_i + b_i||_2^2} So, assuming that the we have the following 2 conformations of a ligand molecule we can compute the RMSD as follows: from biopandas.mol2 import PandasMol2 l_1 = PandasMol2().read_mol2('./data/1b5e_1.mol2') l_2 = PandasMol2().read_mol2('./data/1b5e_2.mol2') r_heavy = PandasMol2.rmsd(l_1.df, l_2.df) r_all = PandasMol2.rmsd(l_1.df, l_2.df, heavy_only=False) print('Heavy-atom RMSD: %.4f Angstrom' % r_heavy) print('All-atom RMSD: %.4f Angstrom' % r_all) Heavy-atom RMSD: 1.1609 Angstrom All-atom RMSD: 1.5523 Angstrom [File links: 1b5e_1.mol2 , 1b5e_2.mol2 ]","title":"Computing the Root Mean Square Deviation"},{"location":"tutorials/Working_with_MOL2_Structures_in_DataFrames/#filtering-atoms-by-distance","text":"We can use the distance method to compute the distance between each atom (or a subset of atoms) in our data frame and a three-dimensional reference point. For example, let's assume were are interested in computing the distance between a keto group in the DMC molecule, which we've seen earlier, and other atoms in the same molecule. First, let's get the coordinates of all keto-groups in this molecule: from biopandas.mol2 import PandasMol2 pmol = PandasMol2().read_mol2('./data/1b5e_1.mol2') keto_coord = pmol.df[pmol.df['atom_type'] == 'O.2'][['x', 'y', 'z']] keto_coord .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } x y z 14 15.0888 6.5824 25.0727 15 18.9314 -0.7527 24.1606 In the following example, we use PandasMol2 's distance method. The distance method returns a pandas Series object containing the Euclidean distance between an atom and all other atoms in the structure. In the following example, keto_coord.values[0] refers to the x, y, z coordinates of the first row (i.e., first keto group) in the array above: print('x, y, z coords:', keto_coord.values[0]) distances = pmol.distance(keto_coord.values[0]) x, y, z coords: [15.0888 6.5824 25.0727] For our convenience, we can add these distances to our MOL2 DataFrame: pmol.df['distances'] = distances pmol.df.head() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } atom_id atom_name x y ... subst_id subst_name charge distances 0 1 C1 18.8934 5.5819 ... 1 <0> -0.1356 4.035144 1 2 C2 18.1301 4.7642 ... 1 <0> -0.0410 3.547712 2 3 C3 18.2645 6.8544 ... 1 <0> 0.4856 3.456969 3 4 C4 16.2520 6.2866 ... 1 <0> 0.8410 1.232313 4 5 C5 15.3820 3.0682 ... 1 <0> 0.0000 3.527546 5 rows \u00d7 10 columns Now, say we are interested in the Euclidean distance between the two keto groups in the molecule: pmol.df[pmol.df['atom_type'] == 'O.2'] .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } atom_id atom_name x y ... subst_id subst_name charge distances 14 15 O3 15.0888 6.5824 ... 1 <0> -0.5700 0.000000 15 16 O4 18.9314 -0.7527 ... 1 <0> -1.0333 8.330738 2 rows \u00d7 10 columns In the example above, the distance between the two keto groups is 8 angstrom. Another common task that we can perform using these atomic distances is to select only the neighboring atoms of the keto group (here: atoms within 3 angstrom). The code is as follows: all_within_3A = pmol.df[pmol.df['distances'] <= 3.0] all_within_3A.tail() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } atom_id atom_name x y ... subst_id subst_name charge distances 7 8 C8 16.0764 4.1199 ... 1 <0> 0.5801 2.814490 9 10 N1 17.0289 7.1510 ... 1 <0> -0.6610 2.269690 10 11 N2 16.8196 5.0644 ... 1 <0> -0.4691 2.307553 14 15 O3 15.0888 6.5824 ... 1 <0> -0.5700 0.000000 26 27 H7 15.3483 4.6961 ... 1 <0> 0.0000 2.446817 5 rows \u00d7 10 columns","title":"Filtering Atoms by Distance"},{"location":"tutorials/Working_with_MOL2_Structures_in_DataFrames/#parsing-multi-mol2-files","text":"","title":"Parsing Multi-MOL2 files"},{"location":"tutorials/Working_with_MOL2_Structures_in_DataFrames/#basic-multi-mol2-file-parsing","text":"As mentioned earlier, PandasMol2.read_mol2 method only reads in the first molecule if it is given a multi-MOL2 file. However, if we want to create DataFrames from multiple structures in a MOL2 file, we can use the handy split_multimol2 generator. The split_multimol2 generator yields tuples containing the molecule IDs and the MOL2 content as strings in a list -- each line in the MOL2 file is stored as a string in the list. from biopandas.mol2 import split_multimol2 mol2_id, mol2_cont = next(split_multimol2('./data/40_mol2_files.mol2')) print('Molecule ID:\\n', mol2_id) print('First 10 lines:\\n', mol2_cont[:10]) Molecule ID: ZINC38611810 First 10 lines: ['@MOLECULE\\n', 'ZINC38611810\\n', ' 65 68 0 0 0\\n', 'SMALL\\n', 'NO_CHARGES\\n', '\\n', '@ATOM\\n', ' 1 C1 -1.1786 2.7011 -4.0323 C.3 1 <0> -0.1537\\n', ' 2 C2 -1.2950 1.2442 -3.5798 C.3 1 <0> -0.1156\\n', ' 3 C3 -0.1742 0.4209 -4.2178 C.3 1 <0> -0.1141\\n'] [File link: 40_mol2_files.mol2 ] We can now use this generator to loop over all files in a multi-MOL2 file and create PandasMol2 DataFrames. A typical use case would be the filtering of mol2 files by certain properties: pdmol = PandasMol2() with open('./data/filtered.mol2', 'w') as f: for mol2 in split_multimol2('./data/40_mol2_files.mol2'): pdmol.read_mol2_from_list(mol2_lines=mol2[1], mol2_code=mol2[0]) # do some analysis keep_molecule = False # save molecule if it passes our filter criterion if keep_molecule: # note that the mol2_text contains the original mol2 content f.write(pdmol.mol2_text)","title":"Basic Multi-MOL2 File Parsing"},{"location":"tutorials/Working_with_MOL2_Structures_in_DataFrames/#using-multiprocessing-for-multi-mol2-file-analysis","text":"To improve the computational efficiency and throughput for multi-mol2 analyses, it is recommended to use the mputil package, which evaluates Python generators lazily. The lazy_imap function from mputil is based on Python's standardlib multiprocessing imap function, but it doesn't consume the generator upfront. This lazy evaluation is important, for example, if we are parsing large (possibly Gigabyte- or Terabyte-large) multi-mol2 files for multiprocessing. The following example provides a template for atom-type based molecule queries, but the data_processor function can be extended to do any kind of functional group queries (for example, involving the 'charge' column and/or PandasMol2.distance method). import pandas as pd from mputil import lazy_imap from biopandas.mol2 import PandasMol2 from biopandas.mol2 import split_multimol2 --------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) in () 1 import pandas as pd ----> 2 from mputil import lazy_imap 3 from biopandas.mol2 import PandasMol2 4 from biopandas.mol2 import split_multimol2 ModuleNotFoundError: No module named 'mputil' # Selection strings to capture # all molecules that contain at least one sp2 hybridized # oxygen atom and at least one Fluorine atom SELECTIONS = [\"(pdmol.df.atom_type == 'O.2')\", \"(pdmol.df.atom_type == 'F')\"] # Path to the multi-mol2 input file MOL2_FILE = \"./data/40_mol2_files.mol2\" # Data processing function to be run in parallel def data_processor(mol2): \"\"\"Return molecule ID if there's a match and '' otherwise\"\"\" pdmol = PandasMol2().read_mol2_from_list(mol2_lines=mol2[1], mol2_code=mol2[0]) match = mol2[0] for sub_sele in SELECTIONS: if not pd.eval(sub_sele).any(): match = '' break return match # Process molecules and save IDs of hits to disk with open('./data/selected_ids.txt', 'w') as f: searched, found = 0, 0 for chunk in lazy_imap(data_processor=data_processor, data_generator=split_multimol2(MOL2_FILE), n_cpus=0): # means all available cpus for mol2_id in chunk: if mol2_id: # write IDs of matching molecules to disk f.write('%s\\n' % mol2_id) found += 1 searched += len(chunk) print('Searched %d molecules. Got %d hits.' % (searched, found)) [Input File link: 40_mol2_files.mol2 ] [Output File link: selected_ids.txt ]","title":"Using Multiprocessing for Multi-MOL2 File Analysis"},{"location":"tutorials/Working_with_PDB_Structures_in_DataFrames/","text":"Working with PDB Structures in DataFrames Loading PDB Files There are 2 1/2 ways to load a PDB structure into a PandasPdb object. 1 PDB files can be directly fetched from The Protein Data Bank at http://www.rcsb.org via its unique 4-letter after initializing a new PandasPdb object and calling the fetch_pdb method: from biopandas.pdb import PandasPdb # Initialize a new PandasPdb object # and fetch the PDB file from rcsb.org ppdb = PandasPdb().fetch_pdb('3eiy') 2 a) Alternatively, we can load PDB files from local directories as regular PDB files using read_pdb : ppdb.read_pdb('./data/3eiy.pdb') [File link: 3eiy.pdb ] 2 b) Or, we can load them from gzip archives like so (note that the file must end with a '.gz' suffix in order to be recognized as a gzip file): ppdb.read_pdb('./data/3eiy.pdb.gz') [File link: 3eiy.pdb.gz ] After the file was succesfully loaded, we have access to the following attributes: print('PDB Code: %s' % ppdb.code) print('PDB Header Line: %s' % ppdb.header) print('\\nRaw PDB file contents:\\n\\n%s\\n...' % ppdb.pdb_text[:1000]) PDB Code: 3eiy PDB Header Line: HYDROLASE 17-SEP-08 3EIY Raw PDB file contents: HEADER HYDROLASE 17-SEP-08 3EIY TITLE CRYSTAL STRUCTURE OF INORGANIC PYROPHOSPHATASE FROM BURKHOLDERIA TITLE 2 PSEUDOMALLEI WITH BOUND PYROPHOSPHATE COMPND MOL_ID: 1; COMPND 2 MOLECULE: INORGANIC PYROPHOSPHATASE; COMPND 3 CHAIN: A; COMPND 4 EC: 3.6.1.1; COMPND 5 ENGINEERED: YES SOURCE MOL_ID: 1; SOURCE 2 ORGANISM_SCIENTIFIC: BURKHOLDERIA PSEUDOMALLEI 1710B; SOURCE 3 ORGANISM_TAXID: 320372; SOURCE 4 GENE: PPA, BURPS1710B_1237; SOURCE 5 EXPRESSION_SYSTEM ... The most interesting / useful attribute is the PandasPdb.df DataFrame dictionary though, which gives us access to the PDB files as pandas DataFrames. Let's print the first 3 lines from the ATOM coordinate section to see how it looks like: ppdb.df['ATOM'].head(3) .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 0 ATOM 1 N ... N NaN 609 1 ATOM 2 CA ... C NaN 610 2 ATOM 3 C ... C NaN 611 3 rows \u00d7 21 columns But more on that in the next section. Looking at PDBs in DataFrames PDB files are parsed according to the PDB file format description . More specifically, BioPandas reads the columns of the ATOM and HETATM sections as shown in the following excerpt from http://deposit.rcsb.org/adit/docs/pdb_atom_format.html#ATOM . COLUMNS DATA TYPE CONTENTS biopandas column name 1 - 6 Record name \"ATOM\" record_name 7 - 11 Integer Atom serial number. atom_number 12 blank_1 13 - 16 Atom Atom name. atom_name 17 Character Alternate location indicator. alt_loc 18 - 20 Residue name Residue name. residue_name 21 blank_2 22 Character Chain identifier. chain_id 23 - 26 Integer Residue sequence number. residue_number 27 AChar Code for insertion of residues. insertion 28 - 30 blank_3 31 - 38 Real(8.3) Orthogonal coordinates for X in Angstroms. x_coord 39 - 46 Real(8.3) Orthogonal coordinates for Y in Angstroms. y_coord 47 - 54 Real(8.3) Orthogonal coordinates for Z in Angstroms. z_coord 55 - 60 Real(6.2) Occupancy. occupancy 61 - 66 Real(6.2) Temperature factor (Default = 0.0). bfactor 67-72 blank_4 73 - 76 LString(4) Segment identifier, left-justified. segment_id 77 - 78 LString(2) Element symbol, right-justified. element_symbol 79 - 80 LString(2) Charge on the atom. charge Below is an example of how this would look like in an actual PDB file: Example: 1 2 3 4 5 6 7 8 12345678901234567890123456789012345678901234567890123456789012345678901234567890 ATOM 145 N VAL A 25 32.433 16.336 57.540 1.00 11.92 A1 N ATOM 146 CA VAL A 25 31.132 16.439 58.160 1.00 11.85 A1 C ATOM 147 C VAL A 25 30.447 15.105 58.363 1.00 12.34 A1 C ATOM 148 O VAL A 25 29.520 15.059 59.174 1.00 15.65 A1 O ATOM 149 CB AVAL A 25 30.385 17.437 57.230 0.28 13.88 A1 C ATOM 150 CB BVAL A 25 30.166 17.399 57.373 0.72 15.41 A1 C ATOM 151 CG1AVAL A 25 28.870 17.401 57.336 0.28 12.64 A1 C ATOM 152 CG1BVAL A 25 30.805 18.788 57.449 0.72 15.11 A1 C ATOM 153 CG2AVAL A 25 30.835 18.826 57.661 0.28 13.58 A1 C ATOM 154 CG2BVAL A 25 29.909 16.996 55.922 0.72 13.25 A1 C After loading a PDB file from rcsb.org or our local drive, the PandasPdb.df attribute should contain the following 4 DataFrame objects: from biopandas.pdb import PandasPdb ppdb = PandasPdb() ppdb.read_pdb('./data/3eiy.pdb') ppdb.df.keys() dict_keys(['ATOM', 'HETATM', 'ANISOU', 'OTHERS']) [File link: 3eiy.pdb ] 'ATOM': contains the entries from the ATOM coordinate section 'ATOM': ... entries from the \"HETATM\" coordinate section 'ANISOU': ... entries from the \"ANISOU\" coordinate section 'OTHERS': Everything else that is not a 'ATOM', 'HETATM', or 'ANISOU' entry The columns of the 'HETATM' DataFrame are indentical to the 'ATOM' DataFrame that we've seen earlier: ppdb.df['HETATM'].head(2) .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 0 HETATM 1332 K ... K NaN 1940 1 HETATM 1333 NA ... NA NaN 1941 2 rows \u00d7 21 columns Note that \"ANISOU\" entries are handled a bit differently as specified at http://deposit.rcsb.org/adit/docs/pdb_atom_format.html#ATOM . ppdb.df['ANISOU'].head(2) .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... blank_4 element_symbol charge line_idx 0 rows \u00d7 21 columns Not every PDB file contains ANISOU entries (similarly, some PDB files may only contain HETATM or ATOM entries). If records are basent, the DataFrame will be empty as show above. ppdb.df['ANISOU'].empty True Since the DataFrames are fairly wide, let's us take a look at the columns by accessing the DataFrame's column attribute: ppdb.df['ANISOU'].columns Index(['record_name', 'atom_number', 'blank_1', 'atom_name', 'alt_loc', 'residue_name', 'blank_2', 'chain_id', 'residue_number', 'insertion', 'blank_3', 'U(1,1)', 'U(2,2)', 'U(3,3)', 'U(1,2)', 'U(1,3)', 'U(2,3)', 'blank_4', 'element_symbol', 'charge', 'line_idx'], dtype='object') ANISOU records are very similar to ATOM/HETATM records. In fact, the columns 7 - 27 and 73 - 80 are identical to their corresponding ATOM/HETATM records, which means that the 'ANISOU' DataFrame doesn't have the following entries: set(ppdb.df['ATOM'].columns).difference(set(ppdb.df['ANISOU'].columns)) {'b_factor', 'occupancy', 'segment_id', 'x_coord', 'y_coord', 'z_coord'} Instead, the \"ANISOU\" DataFrame contains the anisotropic temperature factors \"U(-,-)\" -- note that these are scaled by a factor of 10^4 ( \\text{Angstroms}^2 ) by convention. set(ppdb.df['ANISOU'].columns).difference(set(ppdb.df['ATOM'].columns)) {'U(1,1)', 'U(1,2)', 'U(1,3)', 'U(2,2)', 'U(2,3)', 'U(3,3)'} Ah, another interesting thing to mention is that the columns already come with the types you'd expect (where object essentially \"means\" str here): ppdb.df['ATOM'].dtypes record_name object atom_number int64 blank_1 object atom_name object alt_loc object residue_name object blank_2 object chain_id object residue_number int64 insertion object blank_3 object x_coord float64 y_coord float64 z_coord float64 occupancy float64 b_factor float64 blank_4 object segment_id object element_symbol object charge float64 line_idx int64 dtype: object Typically, all good things come in threes, however, there is a 4th DataFrame, an'OTHER' DataFrame, which contains everything that wasn't parsed as 'ATOM', 'HETATM', or 'ANISOU' coordinate section: ppdb.df['OTHERS'].head(5) .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name entry line_idx 0 HEADER HYDROLASE 17... 0 1 TITLE CRYSTAL STRUCTURE OF INORGANIC PYROPHOSPHA... 1 2 TITLE 2 PSEUDOMALLEI WITH BOUND PYROPHOSPHATE 2 3 COMPND MOL_ID: 1; 3 4 COMPND 2 MOLECULE: INORGANIC PYROPHOSPHATASE; 4 Although these 'OTHER' entries are typically less useful for structure-related computations, you may still want to take a look at them to get a short summary of the PDB structure and learn about it's potential quirks and gotchas (typically listed in the REMARKs section). Lastly, the \"OTHERS\" DataFrame comes in handy if we want to reconstruct the structure as PDB file as we will see later (note the line_idx columns in all of the DataFrames). Working with PDB DataFrames In the previous sections, we've seen how to load PDB structures into DataFrames, and how to access them. Now, let's talk about manipulating PDB files in DataFrames. from biopandas.pdb import PandasPdb ppdb = PandasPdb() ppdb.read_pdb('./data/3eiy.pdb.gz') ppdb.df['ATOM'].head() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 0 ATOM 1 N ... N NaN 609 1 ATOM 2 CA ... C NaN 610 2 ATOM 3 C ... C NaN 611 3 ATOM 4 O ... O NaN 612 4 ATOM 5 CB ... C NaN 613 5 rows \u00d7 21 columns [File link: 3eiy.pdb.gz ] Okay, there's actually not that much to say ... Once we have our PDB file in the DataFrame format, we have the whole convenience of pandas right there at our fingertips. For example, let's get all Proline residues: ppdb.df['ATOM'][ppdb.df['ATOM']['residue_name'] == 'PRO'].head() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 38 ATOM 39 N ... N NaN 647 39 ATOM 40 CA ... C NaN 648 40 ATOM 41 C ... C NaN 649 41 ATOM 42 O ... O NaN 650 42 ATOM 43 CB ... C NaN 651 5 rows \u00d7 21 columns Or main chain atoms: ppdb.df['ATOM'][ppdb.df['ATOM']['atom_name'] == 'C'].head() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 2 ATOM 3 C ... C NaN 611 8 ATOM 9 C ... C NaN 617 19 ATOM 20 C ... C NaN 628 25 ATOM 26 C ... C NaN 634 33 ATOM 34 C ... C NaN 642 5 rows \u00d7 21 columns It's also easy to strip our coordinate section from hydrogen atoms if there are any ... ppdb.df['ATOM'][ppdb.df['ATOM']['element_symbol'] != 'H'].head() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 0 ATOM 1 N ... N NaN 609 1 ATOM 2 CA ... C NaN 610 2 ATOM 3 C ... C NaN 611 3 ATOM 4 O ... O NaN 612 4 ATOM 5 CB ... C NaN 613 5 rows \u00d7 21 columns Or, let's compute the average temperature factor of our protein main chain: mainchain = ppdb.df['ATOM'][(ppdb.df['ATOM']['atom_name'] == 'C') | (ppdb.df['ATOM']['atom_name'] == 'O') | (ppdb.df['ATOM']['atom_name'] == 'N') | (ppdb.df['ATOM']['atom_name'] == 'CA')] bfact_mc_avg = mainchain['b_factor'].mean() print('Average B-Factor [Main Chain]: %.2f' % bfact_mc_avg) Average B-Factor [Main Chain]: 28.83 Plotting Since we are using pandas under the hood, which in turns uses matplotlib under the hood, we can produce quick summary plots of our PDB structures relatively conveniently: from biopandas.pdb import PandasPdb ppdb = PandasPdb().read_pdb('./data/3eiy.pdb.gz') [File link: 3eiy.pdb.gz ] %matplotlib inline import matplotlib.pyplot as plt from matplotlib import style style.use('ggplot') ppdb.df['ATOM']['b_factor'].plot(kind='hist') plt.title('Distribution of B-Factors') plt.xlabel('B-factor') plt.ylabel('count') plt.show() ppdb.df['ATOM']['b_factor'].plot(kind='line') plt.title('B-Factors Along the Amino Acid Chain') plt.xlabel('Residue Number') plt.ylabel('B-factor in $A^2$') plt.show() ppdb.df['ATOM']['element_symbol'].value_counts().plot(kind='bar') plt.title('Distribution of Atom Types') plt.xlabel('elements') plt.ylabel('count') plt.show() Computing the Root Mean Square Deviation BioPandas also comes with certain convenience functions, for example, ... The Root-mean-square deviation (RMSD) is simply a measure of the average distance between atoms of 2 protein or ligand structures. This calculation of the Cartesian error follows the equation: RMSD(a, b) = \\sqrt{\\frac{1}{n} \\sum^{n}_{i=1} \\big((a_{ix})^2 + (a_{iy})^2 + (a_{iz})^2 \\big)} \\\\ = \\sqrt{\\frac{1}{n} \\sum^{n}_{i=1} || a_i + b_i||_2^2} So, assuming that the we have the following 2 conformations of a ligand molecule we can compute the RMSD as follows: from biopandas.pdb import PandasPdb l_1 = PandasPdb().read_pdb('./data/lig_conf_1.pdb') l_2 = PandasPdb().read_pdb('./data/lig_conf_2.pdb') r = PandasPdb.rmsd(l_1.df['HETATM'], l_2.df['HETATM'], s=None) # all atoms, including hydrogens print('RMSD: %.4f Angstrom' % r) RMSD: 2.6444 Angstrom [File links: lig_conf_1.pdb , lig_conf_2.pdb ] r = PandasPdb.rmsd(l_1.df['HETATM'], l_2.df['HETATM'], s='carbon') # carbon atoms only print('RMSD: %.4f Angstrom' % r) RMSD: 3.1405 Angstrom r = PandasPdb.rmsd(l_1.df['HETATM'], l_2.df['HETATM'], s='heavy') # heavy atoms only print('RMSD: %.4f Angstrom' % r) RMSD: 1.9959 Angstrom Similarly, we can compute the RMSD between 2 related protein structures: The hydrogen-free RMSD: p_1 = PandasPdb().read_pdb('./data/1t48_995.pdb') p_2 = PandasPdb().read_pdb('./data/1t49_995.pdb') r = PandasPdb.rmsd(p_1.df['ATOM'], p_2.df['ATOM'], s='heavy') print('RMSD: %.4f Angstrom' % r) RMSD: 0.7377 Angstrom Or the RMSD between the main chains only: p_1 = PandasPdb().read_pdb('./data/1t48_995.pdb') p_2 = PandasPdb().read_pdb('./data/1t49_995.pdb') r = PandasPdb.rmsd(p_1.df['ATOM'], p_2.df['ATOM'], s='main chain') print('RMSD: %.4f Angstrom' % r) RMSD: 0.4781 Angstrom Filtering PDBs by Distance We can use the distance method to compute the distance between each atom (or a subset of atoms) in our data frame and a three-dimensional reference point. For example: p_1 = PandasPdb().read_pdb('./data/3eiy.pdb') reference_point = (9.362, 41.410, 10.542) distances = p_1.distance(xyz=reference_point, records=('ATOM',)) [File link: 3eiy.pdb ] The distance method returns a Pandas Series object: distances.head() 0 19.267419 1 18.306060 2 16.976934 3 16.902897 4 18.124171 dtype: float64 And we can use this Series object, for instance, to select certain atoms in our DataFrame that fall within a desired distance threshold. For example, let's select all atoms that are within 7A of our reference point: all_within_7A = p_1.df['ATOM'][distances < 7.0] all_within_7A.tail() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 786 ATOM 787 CB ... C NaN 1395 787 ATOM 788 CG ... C NaN 1396 788 ATOM 789 CD1 ... C NaN 1397 789 ATOM 790 CD2 ... C NaN 1398 790 ATOM 791 N ... N NaN 1399 5 rows \u00d7 21 columns Visualized in PyMOL, this subset (yellow surface) would look as follows: Converting Amino Acid codes from 3- to 1-letter codes Residues in the residue_name field can be converted into 1-letter amino acid codes, which may be useful for further sequence analysis, for example, pair-wise or multiple sequence alignments: from biopandas.pdb import PandasPdb ppdb = PandasPdb().fetch_pdb('5mtn') sequence = ppdb.amino3to1() sequence.tail() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } chain_id residue_name 1378 B I 1386 B N 1394 B Y 1406 B R 1417 B T As shown above, the amino3to1 method returns a DataFrame containing the chain_id and residue_name of the translated 1-letter amino acids. If you like to work with the sequence as a Python list of string characters, you could do the following: sequence_list = list(sequence.loc[sequence['chain_id'] == 'A', 'residue_name']) sequence_list[-5:] # last 5 residues of chain A ['V', 'R', 'H', 'Y', 'T'] And if you prefer to work with the sequence as a string, you can use the join method: ''.join(sequence.loc[sequence['chain_id'] == 'A', 'residue_name']) 'SLEPEPWFFKNLSRKDAERQLLAPGNTHGSFLIRESESTAGSFSLSVRDFDQGEVVKHYKIRNLDNGGFYISPRITFPGLHELVRHYT' To iterate over the sequences of multi-chain proteins, you can use the unique method as shown below: for chain_id in sequence['chain_id'].unique(): print('\\nChain ID: %s' % chain_id) print(''.join(sequence.loc[sequence['chain_id'] == chain_id, 'residue_name'])) Chain ID: A SLEPEPWFFKNLSRKDAERQLLAPGNTHGSFLIRESESTAGSFSLSVRDFDQGEVVKHYKIRNLDNGGFYISPRITFPGLHELVRHYT Chain ID: B SVSSVPTKLEVVAATPTSLLISWDAPAVTVVYYLITYGETGSPWPGGQAFEVPGSKSTATISGLKPGVDYTITVYAHRSSYGYSENPISINYRT Wrapping it up - Saving PDB structures Finally, let's talk about how to get the PDB structures out of the DataFrame format back into the beloved .pdb format. Let's say we loaded a PDB structure, removed it from it's hydrogens: from biopandas.pdb import PandasPdb ppdb = PandasPdb().read_pdb('./data/3eiy.pdb.gz') ppdb.df['ATOM'] = ppdb.df['ATOM'][ppdb.df['ATOM']['element_symbol'] != 'H'] [File link: 3eiy.pdb.gz ] We can save the file using the PandasPdb.to_pdb method: ppdb.to_pdb(path='./data/3eiy_stripped.pdb', records=None, gz=False, append_newline=True) [File link: 3eiy_stripped.pdb ] By default, all records (that is, 'ATOM', 'HETATM', 'OTHERS', 'ANISOU') are written if we set records=None . Alternatively, let's say we want to get rid of the 'ANISOU' entries and produce a compressed gzip archive of our PDB structure: ppdb.to_pdb(path='./data/3eiy_stripped.pdb.gz', records=['ATOM', 'HETATM', 'OTHERS'], gz=True, append_newline=True) [File link: 3eiy_stripped.pdb.gz ]","title":"Working with PDB Structures in DataFrames"},{"location":"tutorials/Working_with_PDB_Structures_in_DataFrames/#working-with-pdb-structures-in-dataframes","text":"","title":"Working with PDB Structures in DataFrames"},{"location":"tutorials/Working_with_PDB_Structures_in_DataFrames/#loading-pdb-files","text":"There are 2 1/2 ways to load a PDB structure into a PandasPdb object.","title":"Loading PDB Files"},{"location":"tutorials/Working_with_PDB_Structures_in_DataFrames/#1","text":"PDB files can be directly fetched from The Protein Data Bank at http://www.rcsb.org via its unique 4-letter after initializing a new PandasPdb object and calling the fetch_pdb method: from biopandas.pdb import PandasPdb # Initialize a new PandasPdb object # and fetch the PDB file from rcsb.org ppdb = PandasPdb().fetch_pdb('3eiy')","title":"1"},{"location":"tutorials/Working_with_PDB_Structures_in_DataFrames/#2-a","text":"Alternatively, we can load PDB files from local directories as regular PDB files using read_pdb : ppdb.read_pdb('./data/3eiy.pdb') [File link: 3eiy.pdb ]","title":"2 a)"},{"location":"tutorials/Working_with_PDB_Structures_in_DataFrames/#2-b","text":"Or, we can load them from gzip archives like so (note that the file must end with a '.gz' suffix in order to be recognized as a gzip file): ppdb.read_pdb('./data/3eiy.pdb.gz') [File link: 3eiy.pdb.gz ] After the file was succesfully loaded, we have access to the following attributes: print('PDB Code: %s' % ppdb.code) print('PDB Header Line: %s' % ppdb.header) print('\\nRaw PDB file contents:\\n\\n%s\\n...' % ppdb.pdb_text[:1000]) PDB Code: 3eiy PDB Header Line: HYDROLASE 17-SEP-08 3EIY Raw PDB file contents: HEADER HYDROLASE 17-SEP-08 3EIY TITLE CRYSTAL STRUCTURE OF INORGANIC PYROPHOSPHATASE FROM BURKHOLDERIA TITLE 2 PSEUDOMALLEI WITH BOUND PYROPHOSPHATE COMPND MOL_ID: 1; COMPND 2 MOLECULE: INORGANIC PYROPHOSPHATASE; COMPND 3 CHAIN: A; COMPND 4 EC: 3.6.1.1; COMPND 5 ENGINEERED: YES SOURCE MOL_ID: 1; SOURCE 2 ORGANISM_SCIENTIFIC: BURKHOLDERIA PSEUDOMALLEI 1710B; SOURCE 3 ORGANISM_TAXID: 320372; SOURCE 4 GENE: PPA, BURPS1710B_1237; SOURCE 5 EXPRESSION_SYSTEM ... The most interesting / useful attribute is the PandasPdb.df DataFrame dictionary though, which gives us access to the PDB files as pandas DataFrames. Let's print the first 3 lines from the ATOM coordinate section to see how it looks like: ppdb.df['ATOM'].head(3) .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 0 ATOM 1 N ... N NaN 609 1 ATOM 2 CA ... C NaN 610 2 ATOM 3 C ... C NaN 611 3 rows \u00d7 21 columns But more on that in the next section.","title":"2 b)"},{"location":"tutorials/Working_with_PDB_Structures_in_DataFrames/#looking-at-pdbs-in-dataframes","text":"PDB files are parsed according to the PDB file format description . More specifically, BioPandas reads the columns of the ATOM and HETATM sections as shown in the following excerpt from http://deposit.rcsb.org/adit/docs/pdb_atom_format.html#ATOM . COLUMNS DATA TYPE CONTENTS biopandas column name 1 - 6 Record name \"ATOM\" record_name 7 - 11 Integer Atom serial number. atom_number 12 blank_1 13 - 16 Atom Atom name. atom_name 17 Character Alternate location indicator. alt_loc 18 - 20 Residue name Residue name. residue_name 21 blank_2 22 Character Chain identifier. chain_id 23 - 26 Integer Residue sequence number. residue_number 27 AChar Code for insertion of residues. insertion 28 - 30 blank_3 31 - 38 Real(8.3) Orthogonal coordinates for X in Angstroms. x_coord 39 - 46 Real(8.3) Orthogonal coordinates for Y in Angstroms. y_coord 47 - 54 Real(8.3) Orthogonal coordinates for Z in Angstroms. z_coord 55 - 60 Real(6.2) Occupancy. occupancy 61 - 66 Real(6.2) Temperature factor (Default = 0.0). bfactor 67-72 blank_4 73 - 76 LString(4) Segment identifier, left-justified. segment_id 77 - 78 LString(2) Element symbol, right-justified. element_symbol 79 - 80 LString(2) Charge on the atom. charge Below is an example of how this would look like in an actual PDB file: Example: 1 2 3 4 5 6 7 8 12345678901234567890123456789012345678901234567890123456789012345678901234567890 ATOM 145 N VAL A 25 32.433 16.336 57.540 1.00 11.92 A1 N ATOM 146 CA VAL A 25 31.132 16.439 58.160 1.00 11.85 A1 C ATOM 147 C VAL A 25 30.447 15.105 58.363 1.00 12.34 A1 C ATOM 148 O VAL A 25 29.520 15.059 59.174 1.00 15.65 A1 O ATOM 149 CB AVAL A 25 30.385 17.437 57.230 0.28 13.88 A1 C ATOM 150 CB BVAL A 25 30.166 17.399 57.373 0.72 15.41 A1 C ATOM 151 CG1AVAL A 25 28.870 17.401 57.336 0.28 12.64 A1 C ATOM 152 CG1BVAL A 25 30.805 18.788 57.449 0.72 15.11 A1 C ATOM 153 CG2AVAL A 25 30.835 18.826 57.661 0.28 13.58 A1 C ATOM 154 CG2BVAL A 25 29.909 16.996 55.922 0.72 13.25 A1 C After loading a PDB file from rcsb.org or our local drive, the PandasPdb.df attribute should contain the following 4 DataFrame objects: from biopandas.pdb import PandasPdb ppdb = PandasPdb() ppdb.read_pdb('./data/3eiy.pdb') ppdb.df.keys() dict_keys(['ATOM', 'HETATM', 'ANISOU', 'OTHERS']) [File link: 3eiy.pdb ] 'ATOM': contains the entries from the ATOM coordinate section 'ATOM': ... entries from the \"HETATM\" coordinate section 'ANISOU': ... entries from the \"ANISOU\" coordinate section 'OTHERS': Everything else that is not a 'ATOM', 'HETATM', or 'ANISOU' entry The columns of the 'HETATM' DataFrame are indentical to the 'ATOM' DataFrame that we've seen earlier: ppdb.df['HETATM'].head(2) .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 0 HETATM 1332 K ... K NaN 1940 1 HETATM 1333 NA ... NA NaN 1941 2 rows \u00d7 21 columns Note that \"ANISOU\" entries are handled a bit differently as specified at http://deposit.rcsb.org/adit/docs/pdb_atom_format.html#ATOM . ppdb.df['ANISOU'].head(2) .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... blank_4 element_symbol charge line_idx 0 rows \u00d7 21 columns Not every PDB file contains ANISOU entries (similarly, some PDB files may only contain HETATM or ATOM entries). If records are basent, the DataFrame will be empty as show above. ppdb.df['ANISOU'].empty True Since the DataFrames are fairly wide, let's us take a look at the columns by accessing the DataFrame's column attribute: ppdb.df['ANISOU'].columns Index(['record_name', 'atom_number', 'blank_1', 'atom_name', 'alt_loc', 'residue_name', 'blank_2', 'chain_id', 'residue_number', 'insertion', 'blank_3', 'U(1,1)', 'U(2,2)', 'U(3,3)', 'U(1,2)', 'U(1,3)', 'U(2,3)', 'blank_4', 'element_symbol', 'charge', 'line_idx'], dtype='object') ANISOU records are very similar to ATOM/HETATM records. In fact, the columns 7 - 27 and 73 - 80 are identical to their corresponding ATOM/HETATM records, which means that the 'ANISOU' DataFrame doesn't have the following entries: set(ppdb.df['ATOM'].columns).difference(set(ppdb.df['ANISOU'].columns)) {'b_factor', 'occupancy', 'segment_id', 'x_coord', 'y_coord', 'z_coord'} Instead, the \"ANISOU\" DataFrame contains the anisotropic temperature factors \"U(-,-)\" -- note that these are scaled by a factor of 10^4 ( \\text{Angstroms}^2 ) by convention. set(ppdb.df['ANISOU'].columns).difference(set(ppdb.df['ATOM'].columns)) {'U(1,1)', 'U(1,2)', 'U(1,3)', 'U(2,2)', 'U(2,3)', 'U(3,3)'} Ah, another interesting thing to mention is that the columns already come with the types you'd expect (where object essentially \"means\" str here): ppdb.df['ATOM'].dtypes record_name object atom_number int64 blank_1 object atom_name object alt_loc object residue_name object blank_2 object chain_id object residue_number int64 insertion object blank_3 object x_coord float64 y_coord float64 z_coord float64 occupancy float64 b_factor float64 blank_4 object segment_id object element_symbol object charge float64 line_idx int64 dtype: object Typically, all good things come in threes, however, there is a 4th DataFrame, an'OTHER' DataFrame, which contains everything that wasn't parsed as 'ATOM', 'HETATM', or 'ANISOU' coordinate section: ppdb.df['OTHERS'].head(5) .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name entry line_idx 0 HEADER HYDROLASE 17... 0 1 TITLE CRYSTAL STRUCTURE OF INORGANIC PYROPHOSPHA... 1 2 TITLE 2 PSEUDOMALLEI WITH BOUND PYROPHOSPHATE 2 3 COMPND MOL_ID: 1; 3 4 COMPND 2 MOLECULE: INORGANIC PYROPHOSPHATASE; 4 Although these 'OTHER' entries are typically less useful for structure-related computations, you may still want to take a look at them to get a short summary of the PDB structure and learn about it's potential quirks and gotchas (typically listed in the REMARKs section). Lastly, the \"OTHERS\" DataFrame comes in handy if we want to reconstruct the structure as PDB file as we will see later (note the line_idx columns in all of the DataFrames).","title":"Looking at PDBs in DataFrames"},{"location":"tutorials/Working_with_PDB_Structures_in_DataFrames/#working-with-pdb-dataframes","text":"In the previous sections, we've seen how to load PDB structures into DataFrames, and how to access them. Now, let's talk about manipulating PDB files in DataFrames. from biopandas.pdb import PandasPdb ppdb = PandasPdb() ppdb.read_pdb('./data/3eiy.pdb.gz') ppdb.df['ATOM'].head() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 0 ATOM 1 N ... N NaN 609 1 ATOM 2 CA ... C NaN 610 2 ATOM 3 C ... C NaN 611 3 ATOM 4 O ... O NaN 612 4 ATOM 5 CB ... C NaN 613 5 rows \u00d7 21 columns [File link: 3eiy.pdb.gz ] Okay, there's actually not that much to say ... Once we have our PDB file in the DataFrame format, we have the whole convenience of pandas right there at our fingertips. For example, let's get all Proline residues: ppdb.df['ATOM'][ppdb.df['ATOM']['residue_name'] == 'PRO'].head() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 38 ATOM 39 N ... N NaN 647 39 ATOM 40 CA ... C NaN 648 40 ATOM 41 C ... C NaN 649 41 ATOM 42 O ... O NaN 650 42 ATOM 43 CB ... C NaN 651 5 rows \u00d7 21 columns Or main chain atoms: ppdb.df['ATOM'][ppdb.df['ATOM']['atom_name'] == 'C'].head() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 2 ATOM 3 C ... C NaN 611 8 ATOM 9 C ... C NaN 617 19 ATOM 20 C ... C NaN 628 25 ATOM 26 C ... C NaN 634 33 ATOM 34 C ... C NaN 642 5 rows \u00d7 21 columns It's also easy to strip our coordinate section from hydrogen atoms if there are any ... ppdb.df['ATOM'][ppdb.df['ATOM']['element_symbol'] != 'H'].head() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 0 ATOM 1 N ... N NaN 609 1 ATOM 2 CA ... C NaN 610 2 ATOM 3 C ... C NaN 611 3 ATOM 4 O ... O NaN 612 4 ATOM 5 CB ... C NaN 613 5 rows \u00d7 21 columns Or, let's compute the average temperature factor of our protein main chain: mainchain = ppdb.df['ATOM'][(ppdb.df['ATOM']['atom_name'] == 'C') | (ppdb.df['ATOM']['atom_name'] == 'O') | (ppdb.df['ATOM']['atom_name'] == 'N') | (ppdb.df['ATOM']['atom_name'] == 'CA')] bfact_mc_avg = mainchain['b_factor'].mean() print('Average B-Factor [Main Chain]: %.2f' % bfact_mc_avg) Average B-Factor [Main Chain]: 28.83","title":"Working with PDB DataFrames"},{"location":"tutorials/Working_with_PDB_Structures_in_DataFrames/#plotting","text":"Since we are using pandas under the hood, which in turns uses matplotlib under the hood, we can produce quick summary plots of our PDB structures relatively conveniently: from biopandas.pdb import PandasPdb ppdb = PandasPdb().read_pdb('./data/3eiy.pdb.gz') [File link: 3eiy.pdb.gz ] %matplotlib inline import matplotlib.pyplot as plt from matplotlib import style style.use('ggplot') ppdb.df['ATOM']['b_factor'].plot(kind='hist') plt.title('Distribution of B-Factors') plt.xlabel('B-factor') plt.ylabel('count') plt.show() ppdb.df['ATOM']['b_factor'].plot(kind='line') plt.title('B-Factors Along the Amino Acid Chain') plt.xlabel('Residue Number') plt.ylabel('B-factor in $A^2$') plt.show() ppdb.df['ATOM']['element_symbol'].value_counts().plot(kind='bar') plt.title('Distribution of Atom Types') plt.xlabel('elements') plt.ylabel('count') plt.show()","title":"Plotting"},{"location":"tutorials/Working_with_PDB_Structures_in_DataFrames/#computing-the-root-mean-square-deviation","text":"BioPandas also comes with certain convenience functions, for example, ... The Root-mean-square deviation (RMSD) is simply a measure of the average distance between atoms of 2 protein or ligand structures. This calculation of the Cartesian error follows the equation: RMSD(a, b) = \\sqrt{\\frac{1}{n} \\sum^{n}_{i=1} \\big((a_{ix})^2 + (a_{iy})^2 + (a_{iz})^2 \\big)} \\\\ = \\sqrt{\\frac{1}{n} \\sum^{n}_{i=1} || a_i + b_i||_2^2} So, assuming that the we have the following 2 conformations of a ligand molecule we can compute the RMSD as follows: from biopandas.pdb import PandasPdb l_1 = PandasPdb().read_pdb('./data/lig_conf_1.pdb') l_2 = PandasPdb().read_pdb('./data/lig_conf_2.pdb') r = PandasPdb.rmsd(l_1.df['HETATM'], l_2.df['HETATM'], s=None) # all atoms, including hydrogens print('RMSD: %.4f Angstrom' % r) RMSD: 2.6444 Angstrom [File links: lig_conf_1.pdb , lig_conf_2.pdb ] r = PandasPdb.rmsd(l_1.df['HETATM'], l_2.df['HETATM'], s='carbon') # carbon atoms only print('RMSD: %.4f Angstrom' % r) RMSD: 3.1405 Angstrom r = PandasPdb.rmsd(l_1.df['HETATM'], l_2.df['HETATM'], s='heavy') # heavy atoms only print('RMSD: %.4f Angstrom' % r) RMSD: 1.9959 Angstrom Similarly, we can compute the RMSD between 2 related protein structures: The hydrogen-free RMSD: p_1 = PandasPdb().read_pdb('./data/1t48_995.pdb') p_2 = PandasPdb().read_pdb('./data/1t49_995.pdb') r = PandasPdb.rmsd(p_1.df['ATOM'], p_2.df['ATOM'], s='heavy') print('RMSD: %.4f Angstrom' % r) RMSD: 0.7377 Angstrom Or the RMSD between the main chains only: p_1 = PandasPdb().read_pdb('./data/1t48_995.pdb') p_2 = PandasPdb().read_pdb('./data/1t49_995.pdb') r = PandasPdb.rmsd(p_1.df['ATOM'], p_2.df['ATOM'], s='main chain') print('RMSD: %.4f Angstrom' % r) RMSD: 0.4781 Angstrom","title":"Computing the Root Mean Square Deviation"},{"location":"tutorials/Working_with_PDB_Structures_in_DataFrames/#filtering-pdbs-by-distance","text":"We can use the distance method to compute the distance between each atom (or a subset of atoms) in our data frame and a three-dimensional reference point. For example: p_1 = PandasPdb().read_pdb('./data/3eiy.pdb') reference_point = (9.362, 41.410, 10.542) distances = p_1.distance(xyz=reference_point, records=('ATOM',)) [File link: 3eiy.pdb ] The distance method returns a Pandas Series object: distances.head() 0 19.267419 1 18.306060 2 16.976934 3 16.902897 4 18.124171 dtype: float64 And we can use this Series object, for instance, to select certain atoms in our DataFrame that fall within a desired distance threshold. For example, let's select all atoms that are within 7A of our reference point: all_within_7A = p_1.df['ATOM'][distances < 7.0] all_within_7A.tail() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 786 ATOM 787 CB ... C NaN 1395 787 ATOM 788 CG ... C NaN 1396 788 ATOM 789 CD1 ... C NaN 1397 789 ATOM 790 CD2 ... C NaN 1398 790 ATOM 791 N ... N NaN 1399 5 rows \u00d7 21 columns Visualized in PyMOL, this subset (yellow surface) would look as follows:","title":"Filtering PDBs by Distance"},{"location":"tutorials/Working_with_PDB_Structures_in_DataFrames/#converting-amino-acid-codes-from-3-to-1-letter-codes","text":"Residues in the residue_name field can be converted into 1-letter amino acid codes, which may be useful for further sequence analysis, for example, pair-wise or multiple sequence alignments: from biopandas.pdb import PandasPdb ppdb = PandasPdb().fetch_pdb('5mtn') sequence = ppdb.amino3to1() sequence.tail() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } chain_id residue_name 1378 B I 1386 B N 1394 B Y 1406 B R 1417 B T As shown above, the amino3to1 method returns a DataFrame containing the chain_id and residue_name of the translated 1-letter amino acids. If you like to work with the sequence as a Python list of string characters, you could do the following: sequence_list = list(sequence.loc[sequence['chain_id'] == 'A', 'residue_name']) sequence_list[-5:] # last 5 residues of chain A ['V', 'R', 'H', 'Y', 'T'] And if you prefer to work with the sequence as a string, you can use the join method: ''.join(sequence.loc[sequence['chain_id'] == 'A', 'residue_name']) 'SLEPEPWFFKNLSRKDAERQLLAPGNTHGSFLIRESESTAGSFSLSVRDFDQGEVVKHYKIRNLDNGGFYISPRITFPGLHELVRHYT' To iterate over the sequences of multi-chain proteins, you can use the unique method as shown below: for chain_id in sequence['chain_id'].unique(): print('\\nChain ID: %s' % chain_id) print(''.join(sequence.loc[sequence['chain_id'] == chain_id, 'residue_name'])) Chain ID: A SLEPEPWFFKNLSRKDAERQLLAPGNTHGSFLIRESESTAGSFSLSVRDFDQGEVVKHYKIRNLDNGGFYISPRITFPGLHELVRHYT Chain ID: B SVSSVPTKLEVVAATPTSLLISWDAPAVTVVYYLITYGETGSPWPGGQAFEVPGSKSTATISGLKPGVDYTITVYAHRSSYGYSENPISINYRT","title":"Converting Amino Acid codes from 3- to 1-letter codes"},{"location":"tutorials/Working_with_PDB_Structures_in_DataFrames/#wrapping-it-up-saving-pdb-structures","text":"Finally, let's talk about how to get the PDB structures out of the DataFrame format back into the beloved .pdb format. Let's say we loaded a PDB structure, removed it from it's hydrogens: from biopandas.pdb import PandasPdb ppdb = PandasPdb().read_pdb('./data/3eiy.pdb.gz') ppdb.df['ATOM'] = ppdb.df['ATOM'][ppdb.df['ATOM']['element_symbol'] != 'H'] [File link: 3eiy.pdb.gz ] We can save the file using the PandasPdb.to_pdb method: ppdb.to_pdb(path='./data/3eiy_stripped.pdb', records=None, gz=False, append_newline=True) [File link: 3eiy_stripped.pdb ] By default, all records (that is, 'ATOM', 'HETATM', 'OTHERS', 'ANISOU') are written if we set records=None . Alternatively, let's say we want to get rid of the 'ANISOU' entries and produce a compressed gzip archive of our PDB structure: ppdb.to_pdb(path='./data/3eiy_stripped.pdb.gz', records=['ATOM', 'HETATM', 'OTHERS'], gz=True, append_newline=True) [File link: 3eiy_stripped.pdb.gz ]","title":"Wrapping it up - Saving PDB structures"},{"location":"tutorials/test/","text":"Working with PDB Structures in DataFrames Loading PDB Files There are 2 1/2 ways to load a PDB structure into a PandasPdb object. 1 PDB files can be directly fetched from The Protein Data Bank at http://www.rcsb.org via its unique 4-letter after initializing a new PandasPdb object and calling the fetch_pdb method: from biopandas.pdb import PandasPdb # Initialize a new PandasPdb object # and fetch the PDB file from rcsb.org ppdb = PandasPdb().fetch_pdb('3eiy') 2 a) Alternatively, we can load PDB files from local directories as regular PDB files using read_pdb : ppdb.read_pdb('./data/3eiy.pdb') [File link: 3eiy.pdb ] 2 b) Or, we can load them from gzip archives like so (note that the file must end with a '.gz' suffix in order to be recognized as a gzip file): ppdb.read_pdb('./data/3eiy.pdb.gz') [File link: 3eiy.pdb.gz ] After the file was succesfully loaded, we have access to the following attributes: print('PDB Code: %s' % ppdb.code) print('PDB Header Line: %s' % ppdb.header) print('\\nRaw PDB file contents:\\n\\n%s\\n...' % ppdb.pdb_text[:1000]) PDB Code: 3eiy PDB Header Line: HYDROLASE 17-SEP-08 3EIY Raw PDB file contents: HEADER HYDROLASE 17-SEP-08 3EIY TITLE CRYSTAL STRUCTURE OF INORGANIC PYROPHOSPHATASE FROM BURKHOLDERIA TITLE 2 PSEUDOMALLEI WITH BOUND PYROPHOSPHATE COMPND MOL_ID: 1; COMPND 2 MOLECULE: INORGANIC PYROPHOSPHATASE; COMPND 3 CHAIN: A; COMPND 4 EC: 3.6.1.1; COMPND 5 ENGINEERED: YES SOURCE MOL_ID: 1; SOURCE 2 ORGANISM_SCIENTIFIC: BURKHOLDERIA PSEUDOMALLEI 1710B; SOURCE 3 ORGANISM_TAXID: 320372; SOURCE 4 GENE: PPA, BURPS1710B_1237; SOURCE 5 EXPRESSION_SYSTEM ... The most interesting / useful attribute is the PandasPdb.df DataFrame dictionary though, which gives us access to the PDB files as pandas DataFrames. Let's print the first 3 lines from the ATOM coordinate section to see how it looks like: ppdb.df['ATOM'].head(3) .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 0 ATOM 1 N ... N NaN 609 1 ATOM 2 CA ... C NaN 610 2 ATOM 3 C ... C NaN 611 3 rows \u00d7 21 columns But more on that in the next section. Looking at PDBs in DataFrames PDB files are parsed according to the PDB file format description . More specifically, BioPandas reads the columns of the ATOM and HETATM sections as shown in the following excerpt from http://deposit.rcsb.org/adit/docs/pdb_atom_format.html#ATOM . COLUMNS DATA TYPE CONTENTS biopandas column name 1 - 6 Record name \"ATOM\" record_name 7 - 11 Integer Atom serial number. atom_number 12 blank_1 13 - 16 Atom Atom name. atom_name 17 Character Alternate location indicator. alt_loc 18 - 20 Residue name Residue name. residue_name 21 blank_2 22 Character Chain identifier. chain_id 23 - 26 Integer Residue sequence number. residue_number 27 AChar Code for insertion of residues. insertion 28 - 30 blank_3 31 - 38 Real(8.3) Orthogonal coordinates for X in Angstroms. x_coord 39 - 46 Real(8.3) Orthogonal coordinates for Y in Angstroms. y_coord 47 - 54 Real(8.3) Orthogonal coordinates for Z in Angstroms. z_coord 55 - 60 Real(6.2) Occupancy. occupancy 61 - 66 Real(6.2) Temperature factor (Default = 0.0). bfactor 67-72 blank_4 73 - 76 LString(4) Segment identifier, left-justified. segment_id 77 - 78 LString(2) Element symbol, right-justified. element_symbol 79 - 80 LString(2) Charge on the atom. charge Below is an example of how this would look like in an actual PDB file: Example: 1 2 3 4 5 6 7 8 12345678901234567890123456789012345678901234567890123456789012345678901234567890 ATOM 145 N VAL A 25 32.433 16.336 57.540 1.00 11.92 A1 N ATOM 146 CA VAL A 25 31.132 16.439 58.160 1.00 11.85 A1 C ATOM 147 C VAL A 25 30.447 15.105 58.363 1.00 12.34 A1 C ATOM 148 O VAL A 25 29.520 15.059 59.174 1.00 15.65 A1 O ATOM 149 CB AVAL A 25 30.385 17.437 57.230 0.28 13.88 A1 C ATOM 150 CB BVAL A 25 30.166 17.399 57.373 0.72 15.41 A1 C ATOM 151 CG1AVAL A 25 28.870 17.401 57.336 0.28 12.64 A1 C ATOM 152 CG1BVAL A 25 30.805 18.788 57.449 0.72 15.11 A1 C ATOM 153 CG2AVAL A 25 30.835 18.826 57.661 0.28 13.58 A1 C ATOM 154 CG2BVAL A 25 29.909 16.996 55.922 0.72 13.25 A1 C After loading a PDB file from rcsb.org or our local drive, the PandasPdb.df attribute should contain the following 4 DataFrame objects: from biopandas.pdb import PandasPdb ppdb = PandasPdb() ppdb.read_pdb('./data/3eiy.pdb') ppdb.df.keys() dict_keys(['ATOM', 'HETATM', 'ANISOU', 'OTHERS']) [File link: 3eiy.pdb ] 'ATOM': contains the entries from the ATOM coordinate section 'ATOM': ... entries from the \"HETATM\" coordinate section 'ANISOU': ... entries from the \"ANISOU\" coordinate section 'OTHERS': Everything else that is not a 'ATOM', 'HETATM', or 'ANISOU' entry The columns of the 'HETATM' DataFrame are indentical to the 'ATOM' DataFrame that we've seen earlier: ppdb.df['HETATM'].head(2) .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 0 HETATM 1332 K ... K NaN 1940 1 HETATM 1333 NA ... NA NaN 1941 2 rows \u00d7 21 columns Note that \"ANISOU\" entries are handled a bit differently as specified at http://deposit.rcsb.org/adit/docs/pdb_atom_format.html#ATOM . ppdb.df['ANISOU'].head(2) .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... blank_4 element_symbol charge line_idx 0 rows \u00d7 21 columns Not every PDB file contains ANISOU entries (similarly, some PDB files may only contain HETATM or ATOM entries). If records are basent, the DataFrame will be empty as show above. ppdb.df['ANISOU'].empty True Since the DataFrames are fairly wide, let's us take a look at the columns by accessing the DataFrame's column attribute: ppdb.df['ANISOU'].columns Index(['record_name', 'atom_number', 'blank_1', 'atom_name', 'alt_loc', 'residue_name', 'blank_2', 'chain_id', 'residue_number', 'insertion', 'blank_3', 'U(1,1)', 'U(2,2)', 'U(3,3)', 'U(1,2)', 'U(1,3)', 'U(2,3)', 'blank_4', 'element_symbol', 'charge', 'line_idx'], dtype='object') ANISOU records are very similar to ATOM/HETATM records. In fact, the columns 7 - 27 and 73 - 80 are identical to their corresponding ATOM/HETATM records, which means that the 'ANISOU' DataFrame doesn't have the following entries: set(ppdb.df['ATOM'].columns).difference(set(ppdb.df['ANISOU'].columns)) {'b_factor', 'occupancy', 'segment_id', 'x_coord', 'y_coord', 'z_coord'} Instead, the \"ANISOU\" DataFrame contains the anisotropic temperature factors \"U(-,-)\" -- note that these are scaled by a factor of 10^4 ( \\text{Angstroms}^2 ) by convention. set(ppdb.df['ANISOU'].columns).difference(set(ppdb.df['ATOM'].columns)) {'U(1,1)', 'U(1,2)', 'U(1,3)', 'U(2,2)', 'U(2,3)', 'U(3,3)'} Ah, another interesting thing to mention is that the columns already come with the types you'd expect (where object essentially \"means\" str here): ppdb.df['ATOM'].dtypes record_name object atom_number int64 blank_1 object atom_name object alt_loc object residue_name object blank_2 object chain_id object residue_number int64 insertion object blank_3 object x_coord float64 y_coord float64 z_coord float64 occupancy float64 b_factor float64 blank_4 object segment_id object element_symbol object charge float64 line_idx int64 dtype: object Typically, all good things come in threes, however, there is a 4th DataFrame, an'OTHER' DataFrame, which contains everything that wasn't parsed as 'ATOM', 'HETATM', or 'ANISOU' coordinate section: ppdb.df['OTHERS'].head(5) .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name entry line_idx 0 HEADER HYDROLASE 17... 0 1 TITLE CRYSTAL STRUCTURE OF INORGANIC PYROPHOSPHA... 1 2 TITLE 2 PSEUDOMALLEI WITH BOUND PYROPHOSPHATE 2 3 COMPND MOL_ID: 1; 3 4 COMPND 2 MOLECULE: INORGANIC PYROPHOSPHATASE; 4 Although these 'OTHER' entries are typically less useful for structure-related computations, you may still want to take a look at them to get a short summary of the PDB structure and learn about it's potential quirks and gotchas (typically listed in the REMARKs section). Lastly, the \"OTHERS\" DataFrame comes in handy if we want to reconstruct the structure as PDB file as we will see later (note the line_idx columns in all of the DataFrames). Working with PDB DataFrames In the previous sections, we've seen how to load PDB structures into DataFrames, and how to access them. Now, let's talk about manipulating PDB files in DataFrames. from biopandas.pdb import PandasPdb ppdb = PandasPdb() ppdb.read_pdb('./data/3eiy.pdb.gz') ppdb.df['ATOM'].head() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 0 ATOM 1 N ... N NaN 609 1 ATOM 2 CA ... C NaN 610 2 ATOM 3 C ... C NaN 611 3 ATOM 4 O ... O NaN 612 4 ATOM 5 CB ... C NaN 613 5 rows \u00d7 21 columns [File link: 3eiy.pdb.gz ] Okay, there's actually not that much to say ... Once we have our PDB file in the DataFrame format, we have the whole convenience of pandas right there at our fingertips. For example, let's get all Proline residues: ppdb.df['ATOM'][ppdb.df['ATOM']['residue_name'] == 'PRO'].head() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 38 ATOM 39 N ... N NaN 647 39 ATOM 40 CA ... C NaN 648 40 ATOM 41 C ... C NaN 649 41 ATOM 42 O ... O NaN 650 42 ATOM 43 CB ... C NaN 651 5 rows \u00d7 21 columns Or main chain atoms: ppdb.df['ATOM'][ppdb.df['ATOM']['atom_name'] == 'C'].head() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 2 ATOM 3 C ... C NaN 611 8 ATOM 9 C ... C NaN 617 19 ATOM 20 C ... C NaN 628 25 ATOM 26 C ... C NaN 634 33 ATOM 34 C ... C NaN 642 5 rows \u00d7 21 columns It's also easy to strip our coordinate section from hydrogen atoms if there are any ... ppdb.df['ATOM'][ppdb.df['ATOM']['element_symbol'] != 'H'].head() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 0 ATOM 1 N ... N NaN 609 1 ATOM 2 CA ... C NaN 610 2 ATOM 3 C ... C NaN 611 3 ATOM 4 O ... O NaN 612 4 ATOM 5 CB ... C NaN 613 5 rows \u00d7 21 columns Or, let's compute the average temperature factor of our protein main chain: mainchain = ppdb.df['ATOM'][(ppdb.df['ATOM']['atom_name'] == 'C') | (ppdb.df['ATOM']['atom_name'] == 'O') | (ppdb.df['ATOM']['atom_name'] == 'N') | (ppdb.df['ATOM']['atom_name'] == 'CA')] bfact_mc_avg = mainchain['b_factor'].mean() print('Average B-Factor [Main Chain]: %.2f' % bfact_mc_avg) Average B-Factor [Main Chain]: 28.83 Plotting Since we are using pandas under the hood, which in turns uses matplotlib under the hood, we can produce quick summary plots of our PDB structures relatively conveniently: from biopandas.pdb import PandasPdb ppdb = PandasPdb().read_pdb('./data/3eiy.pdb.gz') [File link: 3eiy.pdb.gz ] %matplotlib inline import matplotlib.pyplot as plt from matplotlib import style style.use('ggplot') ppdb.df['ATOM']['b_factor'].plot(kind='hist') plt.title('Distribution of B-Factors') plt.xlabel('B-factor') plt.ylabel('count') plt.show() ppdb.df['ATOM']['b_factor'].plot(kind='line') plt.title('B-Factors Along the Amino Acid Chain') plt.xlabel('Residue Number') plt.ylabel('B-factor in $A^2$') plt.show() ppdb.df['ATOM']['element_symbol'].value_counts().plot(kind='bar') plt.title('Distribution of Atom Types') plt.xlabel('elements') plt.ylabel('count') plt.show() Computing the Root Mean Square Deviation BioPandas also comes with certain convenience functions, for example, ... The Root-mean-square deviation (RMSD) is simply a measure of the average distance between atoms of 2 protein or ligand structures. This calculation of the Cartesian error follows the equation: RMSD(a, b) = \\sqrt{\\frac{1}{n} \\sum^{n}_{i=1} \\big((a_{ix})^2 + (a_{iy})^2 + (a_{iz})^2 \\big)} \\\\ = \\sqrt{\\frac{1}{n} \\sum^{n}_{i=1} || a_i + b_i||_2^2} So, assuming that the we have the following 2 conformations of a ligand molecule we can compute the RMSD as follows: from biopandas.pdb import PandasPdb l_1 = PandasPdb().read_pdb('./data/lig_conf_1.pdb') l_2 = PandasPdb().read_pdb('./data/lig_conf_2.pdb') r = PandasPdb.rmsd(l_1.df['HETATM'], l_2.df['HETATM'], s=None) # all atoms, including hydrogens print('RMSD: %.4f Angstrom' % r) RMSD: 2.6444 Angstrom [File links: lig_conf_1.pdb , lig_conf_2.pdb ] r = PandasPdb.rmsd(l_1.df['HETATM'], l_2.df['HETATM'], s='carbon') # carbon atoms only print('RMSD: %.4f Angstrom' % r) RMSD: 3.1405 Angstrom r = PandasPdb.rmsd(l_1.df['HETATM'], l_2.df['HETATM'], s='heavy') # heavy atoms only print('RMSD: %.4f Angstrom' % r) RMSD: 1.9959 Angstrom Similarly, we can compute the RMSD between 2 related protein structures: The hydrogen-free RMSD: p_1 = PandasPdb().read_pdb('./data/1t48_995.pdb') p_2 = PandasPdb().read_pdb('./data/1t49_995.pdb') r = PandasPdb.rmsd(p_1.df['ATOM'], p_2.df['ATOM'], s='heavy') print('RMSD: %.4f Angstrom' % r) RMSD: 0.7377 Angstrom Or the RMSD between the main chains only: p_1 = PandasPdb().read_pdb('./data/1t48_995.pdb') p_2 = PandasPdb().read_pdb('./data/1t49_995.pdb') r = PandasPdb.rmsd(p_1.df['ATOM'], p_2.df['ATOM'], s='main chain') print('RMSD: %.4f Angstrom' % r) RMSD: 0.4781 Angstrom Filtering PDBs by Distance We can use the distance method to compute the distance between each atom (or a subset of atoms) in our data frame and a three-dimensional reference point. For example: p_1 = PandasPdb().read_pdb('./data/3eiy.pdb') reference_point = (9.362, 41.410, 10.542) distances = p_1.distance(xyz=reference_point, records=('ATOM',)) [File link: 3eiy.pdb ] The distance method returns a Pandas Series object: distances.head() 0 19.267419 1 18.306060 2 16.976934 3 16.902897 4 18.124171 dtype: float64 And we can use this Series object, for instance, to select certain atoms in our DataFrame that fall within a desired distance threshold. For example, let's select all atoms that are within 7A of our reference point: all_within_7A = p_1.df['ATOM'][distances < 7.0] all_within_7A.tail() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 786 ATOM 787 CB ... C NaN 1395 787 ATOM 788 CG ... C NaN 1396 788 ATOM 789 CD1 ... C NaN 1397 789 ATOM 790 CD2 ... C NaN 1398 790 ATOM 791 N ... N NaN 1399 5 rows \u00d7 21 columns Visualized in PyMOL, this subset (yellow surface) would look as follows: Converting Amino Acid codes from 3- to 1-letter codes Residues in the residue_name field can be converted into 1-letter amino acid codes, which may be useful for further sequence analysis, for example, pair-wise or multiple sequence alignments: from biopandas.pdb import PandasPdb ppdb = PandasPdb().fetch_pdb('5mtn') sequence = ppdb.amino3to1() sequence.tail() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } chain_id residue_name 1378 B I 1386 B N 1394 B Y 1406 B R 1417 B T As shown above, the amino3to1 method returns a DataFrame containing the chain_id and residue_name of the translated 1-letter amino acids. If you like to work with the sequence as a Python list of string characters, you could do the following: sequence_list = list(sequence.loc[sequence['chain_id'] == 'A', 'residue_name']) sequence_list[-5:] # last 5 residues of chain A ['V', 'R', 'H', 'Y', 'T'] And if you prefer to work with the sequence as a string, you can use the join method: ''.join(sequence.loc[sequence['chain_id'] == 'A', 'residue_name']) 'SLEPEPWFFKNLSRKDAERQLLAPGNTHGSFLIRESESTAGSFSLSVRDFDQGEVVKHYKIRNLDNGGFYISPRITFPGLHELVRHYT' To iterate over the sequences of multi-chain proteins, you can use the unique method as shown below: for chain_id in sequence['chain_id'].unique(): print('\\nChain ID: %s' % chain_id) print(''.join(sequence.loc[sequence['chain_id'] == chain_id, 'residue_name'])) Chain ID: A SLEPEPWFFKNLSRKDAERQLLAPGNTHGSFLIRESESTAGSFSLSVRDFDQGEVVKHYKIRNLDNGGFYISPRITFPGLHELVRHYT Chain ID: B SVSSVPTKLEVVAATPTSLLISWDAPAVTVVYYLITYGETGSPWPGGQAFEVPGSKSTATISGLKPGVDYTITVYAHRSSYGYSENPISINYRT Wrapping it up - Saving PDB structures Finally, let's talk about how to get the PDB structures out of the DataFrame format back into the beloved .pdb format. Let's say we loaded a PDB structure, removed it from it's hydrogens: from biopandas.pdb import PandasPdb ppdb = PandasPdb().read_pdb('./data/3eiy.pdb.gz') ppdb.df['ATOM'] = ppdb.df['ATOM'][ppdb.df['ATOM']['element_symbol'] != 'H'] [File link: 3eiy.pdb.gz ] We can save the file using the PandasPdb.to_pdb method: ppdb.to_pdb(path='./data/3eiy_stripped.pdb', records=None, gz=False, append_newline=True) [File link: 3eiy_stripped.pdb ] By default, all records (that is, 'ATOM', 'HETATM', 'OTHERS', 'ANISOU') are written if we set records=None . Alternatively, let's say we want to get rid of the 'ANISOU' entries and produce a compressed gzip archive of our PDB structure: ppdb.to_pdb(path='./data/3eiy_stripped.pdb.gz', records=['ATOM', 'HETATM', 'OTHERS'], gz=True, append_newline=True) [File link: 3eiy_stripped.pdb.gz ]","title":"Working with PDB Structures in DataFrames"},{"location":"tutorials/test/#working-with-pdb-structures-in-dataframes","text":"","title":"Working with PDB Structures in DataFrames"},{"location":"tutorials/test/#loading-pdb-files","text":"There are 2 1/2 ways to load a PDB structure into a PandasPdb object.","title":"Loading PDB Files"},{"location":"tutorials/test/#1","text":"PDB files can be directly fetched from The Protein Data Bank at http://www.rcsb.org via its unique 4-letter after initializing a new PandasPdb object and calling the fetch_pdb method: from biopandas.pdb import PandasPdb # Initialize a new PandasPdb object # and fetch the PDB file from rcsb.org ppdb = PandasPdb().fetch_pdb('3eiy')","title":"1"},{"location":"tutorials/test/#2-a","text":"Alternatively, we can load PDB files from local directories as regular PDB files using read_pdb : ppdb.read_pdb('./data/3eiy.pdb') [File link: 3eiy.pdb ]","title":"2 a)"},{"location":"tutorials/test/#2-b","text":"Or, we can load them from gzip archives like so (note that the file must end with a '.gz' suffix in order to be recognized as a gzip file): ppdb.read_pdb('./data/3eiy.pdb.gz') [File link: 3eiy.pdb.gz ] After the file was succesfully loaded, we have access to the following attributes: print('PDB Code: %s' % ppdb.code) print('PDB Header Line: %s' % ppdb.header) print('\\nRaw PDB file contents:\\n\\n%s\\n...' % ppdb.pdb_text[:1000]) PDB Code: 3eiy PDB Header Line: HYDROLASE 17-SEP-08 3EIY Raw PDB file contents: HEADER HYDROLASE 17-SEP-08 3EIY TITLE CRYSTAL STRUCTURE OF INORGANIC PYROPHOSPHATASE FROM BURKHOLDERIA TITLE 2 PSEUDOMALLEI WITH BOUND PYROPHOSPHATE COMPND MOL_ID: 1; COMPND 2 MOLECULE: INORGANIC PYROPHOSPHATASE; COMPND 3 CHAIN: A; COMPND 4 EC: 3.6.1.1; COMPND 5 ENGINEERED: YES SOURCE MOL_ID: 1; SOURCE 2 ORGANISM_SCIENTIFIC: BURKHOLDERIA PSEUDOMALLEI 1710B; SOURCE 3 ORGANISM_TAXID: 320372; SOURCE 4 GENE: PPA, BURPS1710B_1237; SOURCE 5 EXPRESSION_SYSTEM ... The most interesting / useful attribute is the PandasPdb.df DataFrame dictionary though, which gives us access to the PDB files as pandas DataFrames. Let's print the first 3 lines from the ATOM coordinate section to see how it looks like: ppdb.df['ATOM'].head(3) .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 0 ATOM 1 N ... N NaN 609 1 ATOM 2 CA ... C NaN 610 2 ATOM 3 C ... C NaN 611 3 rows \u00d7 21 columns But more on that in the next section.","title":"2 b)"},{"location":"tutorials/test/#looking-at-pdbs-in-dataframes","text":"PDB files are parsed according to the PDB file format description . More specifically, BioPandas reads the columns of the ATOM and HETATM sections as shown in the following excerpt from http://deposit.rcsb.org/adit/docs/pdb_atom_format.html#ATOM . COLUMNS DATA TYPE CONTENTS biopandas column name 1 - 6 Record name \"ATOM\" record_name 7 - 11 Integer Atom serial number. atom_number 12 blank_1 13 - 16 Atom Atom name. atom_name 17 Character Alternate location indicator. alt_loc 18 - 20 Residue name Residue name. residue_name 21 blank_2 22 Character Chain identifier. chain_id 23 - 26 Integer Residue sequence number. residue_number 27 AChar Code for insertion of residues. insertion 28 - 30 blank_3 31 - 38 Real(8.3) Orthogonal coordinates for X in Angstroms. x_coord 39 - 46 Real(8.3) Orthogonal coordinates for Y in Angstroms. y_coord 47 - 54 Real(8.3) Orthogonal coordinates for Z in Angstroms. z_coord 55 - 60 Real(6.2) Occupancy. occupancy 61 - 66 Real(6.2) Temperature factor (Default = 0.0). bfactor 67-72 blank_4 73 - 76 LString(4) Segment identifier, left-justified. segment_id 77 - 78 LString(2) Element symbol, right-justified. element_symbol 79 - 80 LString(2) Charge on the atom. charge Below is an example of how this would look like in an actual PDB file: Example: 1 2 3 4 5 6 7 8 12345678901234567890123456789012345678901234567890123456789012345678901234567890 ATOM 145 N VAL A 25 32.433 16.336 57.540 1.00 11.92 A1 N ATOM 146 CA VAL A 25 31.132 16.439 58.160 1.00 11.85 A1 C ATOM 147 C VAL A 25 30.447 15.105 58.363 1.00 12.34 A1 C ATOM 148 O VAL A 25 29.520 15.059 59.174 1.00 15.65 A1 O ATOM 149 CB AVAL A 25 30.385 17.437 57.230 0.28 13.88 A1 C ATOM 150 CB BVAL A 25 30.166 17.399 57.373 0.72 15.41 A1 C ATOM 151 CG1AVAL A 25 28.870 17.401 57.336 0.28 12.64 A1 C ATOM 152 CG1BVAL A 25 30.805 18.788 57.449 0.72 15.11 A1 C ATOM 153 CG2AVAL A 25 30.835 18.826 57.661 0.28 13.58 A1 C ATOM 154 CG2BVAL A 25 29.909 16.996 55.922 0.72 13.25 A1 C After loading a PDB file from rcsb.org or our local drive, the PandasPdb.df attribute should contain the following 4 DataFrame objects: from biopandas.pdb import PandasPdb ppdb = PandasPdb() ppdb.read_pdb('./data/3eiy.pdb') ppdb.df.keys() dict_keys(['ATOM', 'HETATM', 'ANISOU', 'OTHERS']) [File link: 3eiy.pdb ] 'ATOM': contains the entries from the ATOM coordinate section 'ATOM': ... entries from the \"HETATM\" coordinate section 'ANISOU': ... entries from the \"ANISOU\" coordinate section 'OTHERS': Everything else that is not a 'ATOM', 'HETATM', or 'ANISOU' entry The columns of the 'HETATM' DataFrame are indentical to the 'ATOM' DataFrame that we've seen earlier: ppdb.df['HETATM'].head(2) .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 0 HETATM 1332 K ... K NaN 1940 1 HETATM 1333 NA ... NA NaN 1941 2 rows \u00d7 21 columns Note that \"ANISOU\" entries are handled a bit differently as specified at http://deposit.rcsb.org/adit/docs/pdb_atom_format.html#ATOM . ppdb.df['ANISOU'].head(2) .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... blank_4 element_symbol charge line_idx 0 rows \u00d7 21 columns Not every PDB file contains ANISOU entries (similarly, some PDB files may only contain HETATM or ATOM entries). If records are basent, the DataFrame will be empty as show above. ppdb.df['ANISOU'].empty True Since the DataFrames are fairly wide, let's us take a look at the columns by accessing the DataFrame's column attribute: ppdb.df['ANISOU'].columns Index(['record_name', 'atom_number', 'blank_1', 'atom_name', 'alt_loc', 'residue_name', 'blank_2', 'chain_id', 'residue_number', 'insertion', 'blank_3', 'U(1,1)', 'U(2,2)', 'U(3,3)', 'U(1,2)', 'U(1,3)', 'U(2,3)', 'blank_4', 'element_symbol', 'charge', 'line_idx'], dtype='object') ANISOU records are very similar to ATOM/HETATM records. In fact, the columns 7 - 27 and 73 - 80 are identical to their corresponding ATOM/HETATM records, which means that the 'ANISOU' DataFrame doesn't have the following entries: set(ppdb.df['ATOM'].columns).difference(set(ppdb.df['ANISOU'].columns)) {'b_factor', 'occupancy', 'segment_id', 'x_coord', 'y_coord', 'z_coord'} Instead, the \"ANISOU\" DataFrame contains the anisotropic temperature factors \"U(-,-)\" -- note that these are scaled by a factor of 10^4 ( \\text{Angstroms}^2 ) by convention. set(ppdb.df['ANISOU'].columns).difference(set(ppdb.df['ATOM'].columns)) {'U(1,1)', 'U(1,2)', 'U(1,3)', 'U(2,2)', 'U(2,3)', 'U(3,3)'} Ah, another interesting thing to mention is that the columns already come with the types you'd expect (where object essentially \"means\" str here): ppdb.df['ATOM'].dtypes record_name object atom_number int64 blank_1 object atom_name object alt_loc object residue_name object blank_2 object chain_id object residue_number int64 insertion object blank_3 object x_coord float64 y_coord float64 z_coord float64 occupancy float64 b_factor float64 blank_4 object segment_id object element_symbol object charge float64 line_idx int64 dtype: object Typically, all good things come in threes, however, there is a 4th DataFrame, an'OTHER' DataFrame, which contains everything that wasn't parsed as 'ATOM', 'HETATM', or 'ANISOU' coordinate section: ppdb.df['OTHERS'].head(5) .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name entry line_idx 0 HEADER HYDROLASE 17... 0 1 TITLE CRYSTAL STRUCTURE OF INORGANIC PYROPHOSPHA... 1 2 TITLE 2 PSEUDOMALLEI WITH BOUND PYROPHOSPHATE 2 3 COMPND MOL_ID: 1; 3 4 COMPND 2 MOLECULE: INORGANIC PYROPHOSPHATASE; 4 Although these 'OTHER' entries are typically less useful for structure-related computations, you may still want to take a look at them to get a short summary of the PDB structure and learn about it's potential quirks and gotchas (typically listed in the REMARKs section). Lastly, the \"OTHERS\" DataFrame comes in handy if we want to reconstruct the structure as PDB file as we will see later (note the line_idx columns in all of the DataFrames).","title":"Looking at PDBs in DataFrames"},{"location":"tutorials/test/#working-with-pdb-dataframes","text":"In the previous sections, we've seen how to load PDB structures into DataFrames, and how to access them. Now, let's talk about manipulating PDB files in DataFrames. from biopandas.pdb import PandasPdb ppdb = PandasPdb() ppdb.read_pdb('./data/3eiy.pdb.gz') ppdb.df['ATOM'].head() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 0 ATOM 1 N ... N NaN 609 1 ATOM 2 CA ... C NaN 610 2 ATOM 3 C ... C NaN 611 3 ATOM 4 O ... O NaN 612 4 ATOM 5 CB ... C NaN 613 5 rows \u00d7 21 columns [File link: 3eiy.pdb.gz ] Okay, there's actually not that much to say ... Once we have our PDB file in the DataFrame format, we have the whole convenience of pandas right there at our fingertips. For example, let's get all Proline residues: ppdb.df['ATOM'][ppdb.df['ATOM']['residue_name'] == 'PRO'].head() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 38 ATOM 39 N ... N NaN 647 39 ATOM 40 CA ... C NaN 648 40 ATOM 41 C ... C NaN 649 41 ATOM 42 O ... O NaN 650 42 ATOM 43 CB ... C NaN 651 5 rows \u00d7 21 columns Or main chain atoms: ppdb.df['ATOM'][ppdb.df['ATOM']['atom_name'] == 'C'].head() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 2 ATOM 3 C ... C NaN 611 8 ATOM 9 C ... C NaN 617 19 ATOM 20 C ... C NaN 628 25 ATOM 26 C ... C NaN 634 33 ATOM 34 C ... C NaN 642 5 rows \u00d7 21 columns It's also easy to strip our coordinate section from hydrogen atoms if there are any ... ppdb.df['ATOM'][ppdb.df['ATOM']['element_symbol'] != 'H'].head() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 0 ATOM 1 N ... N NaN 609 1 ATOM 2 CA ... C NaN 610 2 ATOM 3 C ... C NaN 611 3 ATOM 4 O ... O NaN 612 4 ATOM 5 CB ... C NaN 613 5 rows \u00d7 21 columns Or, let's compute the average temperature factor of our protein main chain: mainchain = ppdb.df['ATOM'][(ppdb.df['ATOM']['atom_name'] == 'C') | (ppdb.df['ATOM']['atom_name'] == 'O') | (ppdb.df['ATOM']['atom_name'] == 'N') | (ppdb.df['ATOM']['atom_name'] == 'CA')] bfact_mc_avg = mainchain['b_factor'].mean() print('Average B-Factor [Main Chain]: %.2f' % bfact_mc_avg) Average B-Factor [Main Chain]: 28.83","title":"Working with PDB DataFrames"},{"location":"tutorials/test/#plotting","text":"Since we are using pandas under the hood, which in turns uses matplotlib under the hood, we can produce quick summary plots of our PDB structures relatively conveniently: from biopandas.pdb import PandasPdb ppdb = PandasPdb().read_pdb('./data/3eiy.pdb.gz') [File link: 3eiy.pdb.gz ] %matplotlib inline import matplotlib.pyplot as plt from matplotlib import style style.use('ggplot') ppdb.df['ATOM']['b_factor'].plot(kind='hist') plt.title('Distribution of B-Factors') plt.xlabel('B-factor') plt.ylabel('count') plt.show() ppdb.df['ATOM']['b_factor'].plot(kind='line') plt.title('B-Factors Along the Amino Acid Chain') plt.xlabel('Residue Number') plt.ylabel('B-factor in $A^2$') plt.show() ppdb.df['ATOM']['element_symbol'].value_counts().plot(kind='bar') plt.title('Distribution of Atom Types') plt.xlabel('elements') plt.ylabel('count') plt.show()","title":"Plotting"},{"location":"tutorials/test/#computing-the-root-mean-square-deviation","text":"BioPandas also comes with certain convenience functions, for example, ... The Root-mean-square deviation (RMSD) is simply a measure of the average distance between atoms of 2 protein or ligand structures. This calculation of the Cartesian error follows the equation: RMSD(a, b) = \\sqrt{\\frac{1}{n} \\sum^{n}_{i=1} \\big((a_{ix})^2 + (a_{iy})^2 + (a_{iz})^2 \\big)} \\\\ = \\sqrt{\\frac{1}{n} \\sum^{n}_{i=1} || a_i + b_i||_2^2} So, assuming that the we have the following 2 conformations of a ligand molecule we can compute the RMSD as follows: from biopandas.pdb import PandasPdb l_1 = PandasPdb().read_pdb('./data/lig_conf_1.pdb') l_2 = PandasPdb().read_pdb('./data/lig_conf_2.pdb') r = PandasPdb.rmsd(l_1.df['HETATM'], l_2.df['HETATM'], s=None) # all atoms, including hydrogens print('RMSD: %.4f Angstrom' % r) RMSD: 2.6444 Angstrom [File links: lig_conf_1.pdb , lig_conf_2.pdb ] r = PandasPdb.rmsd(l_1.df['HETATM'], l_2.df['HETATM'], s='carbon') # carbon atoms only print('RMSD: %.4f Angstrom' % r) RMSD: 3.1405 Angstrom r = PandasPdb.rmsd(l_1.df['HETATM'], l_2.df['HETATM'], s='heavy') # heavy atoms only print('RMSD: %.4f Angstrom' % r) RMSD: 1.9959 Angstrom Similarly, we can compute the RMSD between 2 related protein structures: The hydrogen-free RMSD: p_1 = PandasPdb().read_pdb('./data/1t48_995.pdb') p_2 = PandasPdb().read_pdb('./data/1t49_995.pdb') r = PandasPdb.rmsd(p_1.df['ATOM'], p_2.df['ATOM'], s='heavy') print('RMSD: %.4f Angstrom' % r) RMSD: 0.7377 Angstrom Or the RMSD between the main chains only: p_1 = PandasPdb().read_pdb('./data/1t48_995.pdb') p_2 = PandasPdb().read_pdb('./data/1t49_995.pdb') r = PandasPdb.rmsd(p_1.df['ATOM'], p_2.df['ATOM'], s='main chain') print('RMSD: %.4f Angstrom' % r) RMSD: 0.4781 Angstrom","title":"Computing the Root Mean Square Deviation"},{"location":"tutorials/test/#filtering-pdbs-by-distance","text":"We can use the distance method to compute the distance between each atom (or a subset of atoms) in our data frame and a three-dimensional reference point. For example: p_1 = PandasPdb().read_pdb('./data/3eiy.pdb') reference_point = (9.362, 41.410, 10.542) distances = p_1.distance(xyz=reference_point, records=('ATOM',)) [File link: 3eiy.pdb ] The distance method returns a Pandas Series object: distances.head() 0 19.267419 1 18.306060 2 16.976934 3 16.902897 4 18.124171 dtype: float64 And we can use this Series object, for instance, to select certain atoms in our DataFrame that fall within a desired distance threshold. For example, let's select all atoms that are within 7A of our reference point: all_within_7A = p_1.df['ATOM'][distances < 7.0] all_within_7A.tail() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } record_name atom_number blank_1 atom_name ... segment_id element_symbol charge line_idx 786 ATOM 787 CB ... C NaN 1395 787 ATOM 788 CG ... C NaN 1396 788 ATOM 789 CD1 ... C NaN 1397 789 ATOM 790 CD2 ... C NaN 1398 790 ATOM 791 N ... N NaN 1399 5 rows \u00d7 21 columns Visualized in PyMOL, this subset (yellow surface) would look as follows:","title":"Filtering PDBs by Distance"},{"location":"tutorials/test/#converting-amino-acid-codes-from-3-to-1-letter-codes","text":"Residues in the residue_name field can be converted into 1-letter amino acid codes, which may be useful for further sequence analysis, for example, pair-wise or multiple sequence alignments: from biopandas.pdb import PandasPdb ppdb = PandasPdb().fetch_pdb('5mtn') sequence = ppdb.amino3to1() sequence.tail() .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } chain_id residue_name 1378 B I 1386 B N 1394 B Y 1406 B R 1417 B T As shown above, the amino3to1 method returns a DataFrame containing the chain_id and residue_name of the translated 1-letter amino acids. If you like to work with the sequence as a Python list of string characters, you could do the following: sequence_list = list(sequence.loc[sequence['chain_id'] == 'A', 'residue_name']) sequence_list[-5:] # last 5 residues of chain A ['V', 'R', 'H', 'Y', 'T'] And if you prefer to work with the sequence as a string, you can use the join method: ''.join(sequence.loc[sequence['chain_id'] == 'A', 'residue_name']) 'SLEPEPWFFKNLSRKDAERQLLAPGNTHGSFLIRESESTAGSFSLSVRDFDQGEVVKHYKIRNLDNGGFYISPRITFPGLHELVRHYT' To iterate over the sequences of multi-chain proteins, you can use the unique method as shown below: for chain_id in sequence['chain_id'].unique(): print('\\nChain ID: %s' % chain_id) print(''.join(sequence.loc[sequence['chain_id'] == chain_id, 'residue_name'])) Chain ID: A SLEPEPWFFKNLSRKDAERQLLAPGNTHGSFLIRESESTAGSFSLSVRDFDQGEVVKHYKIRNLDNGGFYISPRITFPGLHELVRHYT Chain ID: B SVSSVPTKLEVVAATPTSLLISWDAPAVTVVYYLITYGETGSPWPGGQAFEVPGSKSTATISGLKPGVDYTITVYAHRSSYGYSENPISINYRT","title":"Converting Amino Acid codes from 3- to 1-letter codes"},{"location":"tutorials/test/#wrapping-it-up-saving-pdb-structures","text":"Finally, let's talk about how to get the PDB structures out of the DataFrame format back into the beloved .pdb format. Let's say we loaded a PDB structure, removed it from it's hydrogens: from biopandas.pdb import PandasPdb ppdb = PandasPdb().read_pdb('./data/3eiy.pdb.gz') ppdb.df['ATOM'] = ppdb.df['ATOM'][ppdb.df['ATOM']['element_symbol'] != 'H'] [File link: 3eiy.pdb.gz ] We can save the file using the PandasPdb.to_pdb method: ppdb.to_pdb(path='./data/3eiy_stripped.pdb', records=None, gz=False, append_newline=True) [File link: 3eiy_stripped.pdb ] By default, all records (that is, 'ATOM', 'HETATM', 'OTHERS', 'ANISOU') are written if we set records=None . Alternatively, let's say we want to get rid of the 'ANISOU' entries and produce a compressed gzip archive of our PDB structure: ppdb.to_pdb(path='./data/3eiy_stripped.pdb.gz', records=['ATOM', 'HETATM', 'OTHERS'], gz=True, append_newline=True) [File link: 3eiy_stripped.pdb.gz ]","title":"Wrapping it up - Saving PDB structures"}]}
\ No newline at end of file
diff --git a/site/search/worker.js b/site/search/worker.js
deleted file mode 100644
index a3ccc07..0000000
--- a/site/search/worker.js
+++ /dev/null
@@ -1,128 +0,0 @@
-var base_path = 'function' === typeof importScripts ? '.' : '/search/';
-var allowSearch = false;
-var index;
-var documents = {};
-var lang = ['en'];
-var data;
-
-function getScript(script, callback) {
- console.log('Loading script: ' + script);
- $.getScript(base_path + script).done(function () {
- callback();
- }).fail(function (jqxhr, settings, exception) {
- console.log('Error: ' + exception);
- });
-}
-
-function getScriptsInOrder(scripts, callback) {
- if (scripts.length === 0) {
- callback();
- return;
- }
- getScript(scripts[0], function() {
- getScriptsInOrder(scripts.slice(1), callback);
- });
-}
-
-function loadScripts(urls, callback) {
- if( 'function' === typeof importScripts ) {
- importScripts.apply(null, urls);
- callback();
- } else {
- getScriptsInOrder(urls, callback);
- }
-}
-
-function onJSONLoaded () {
- data = JSON.parse(this.responseText);
- var scriptsToLoad = ['lunr.js'];
- if (data.config && data.config.lang && data.config.lang.length) {
- lang = data.config.lang;
- }
- if (lang.length > 1 || lang[0] !== "en") {
- scriptsToLoad.push('lunr.stemmer.support.js');
- if (lang.length > 1) {
- scriptsToLoad.push('lunr.multi.js');
- }
- for (var i=0; i < lang.length; i++) {
- if (lang[i] != 'en') {
- scriptsToLoad.push(['lunr', lang[i], 'js'].join('.'));
- }
- }
- }
- loadScripts(scriptsToLoad, onScriptsLoaded);
-}
-
-function onScriptsLoaded () {
- console.log('All search scripts loaded, building Lunr index...');
- if (data.config && data.config.separator && data.config.separator.length) {
- lunr.tokenizer.separator = new RegExp(data.config.separator);
- }
- if (data.index) {
- index = lunr.Index.load(data.index);
- data.docs.forEach(function (doc) {
- documents[doc.location] = doc;
- });
- console.log('Lunr pre-built index loaded, search ready');
- } else {
- index = lunr(function () {
- if (lang.length === 1 && lang[0] !== "en" && lunr[lang[0]]) {
- this.use(lunr[lang[0]]);
- } else if (lang.length > 1) {
- this.use(lunr.multiLanguage.apply(null, lang)); // spread operator not supported in all browsers: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator#Browser_compatibility
- }
- this.field('title');
- this.field('text');
- this.ref('location');
-
- for (var i=0; i < data.docs.length; i++) {
- var doc = data.docs[i];
- this.add(doc);
- documents[doc.location] = doc;
- }
- });
- console.log('Lunr index built, search ready');
- }
- allowSearch = true;
- postMessage({allowSearch: allowSearch});
-}
-
-function init () {
- var oReq = new XMLHttpRequest();
- oReq.addEventListener("load", onJSONLoaded);
- var index_path = base_path + '/search_index.json';
- if( 'function' === typeof importScripts ){
- index_path = 'search_index.json';
- }
- oReq.open("GET", index_path);
- oReq.send();
-}
-
-function search (query) {
- if (!allowSearch) {
- console.error('Assets for search still loading');
- return;
- }
-
- var resultDocuments = [];
- var results = index.search(query);
- for (var i=0; i < results.length; i++){
- var result = results[i];
- doc = documents[result.ref];
- doc.summary = doc.text.substring(0, 200);
- resultDocuments.push(doc);
- }
- return resultDocuments;
-}
-
-if( 'function' === typeof importScripts ) {
- onmessage = function (e) {
- if (e.data.init) {
- init();
- } else if (e.data.query) {
- postMessage({ results: search(e.data.query) });
- } else {
- console.error("Worker - Unrecognized message: " + e);
- }
- };
-}
diff --git a/site/sitemap.xml b/site/sitemap.xml
deleted file mode 100644
index 7388bf0..0000000
--- a/site/sitemap.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
- http://rasbt.github.io/biopandas/
- 2019-12-10
- daily
-
-
- http://rasbt.github.io/biopandas/tutorials/Working_with_PDB_Structures_in_DataFrames/
- 2019-12-10
- daily
-
-
- http://rasbt.github.io/biopandas/tutorials/Working_with_MOL2_Structures_in_DataFrames/
- 2019-12-10
- daily
-
-
- http://rasbt.github.io/biopandas/api_subpackages/biopandas.pdb/
- 2019-12-10
- daily
-
-
- http://rasbt.github.io/biopandas/api_subpackages/biopandas.mol2/
- 2019-12-10
- daily
-
-
- http://rasbt.github.io/biopandas/CHANGELOG/
- 2019-12-10
- daily
-
-
- http://rasbt.github.io/biopandas/installation/
- 2019-12-10
- daily
-
-
- http://rasbt.github.io/biopandas/CONTRIBUTING/
- 2019-12-10
- daily
-
-
- http://rasbt.github.io/biopandas/citing/
- 2019-12-10
- daily
-
-
\ No newline at end of file
diff --git a/site/sitemap.xml.gz b/site/sitemap.xml.gz
deleted file mode 100644
index a26aa14..0000000
Binary files a/site/sitemap.xml.gz and /dev/null differ
diff --git a/site/theme-bootstrap/__init__.py b/site/theme-bootstrap/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/site/theme-bootstrap/css/base.css b/site/theme-bootstrap/css/base.css
deleted file mode 100644
index e4b24e7..0000000
--- a/site/theme-bootstrap/css/base.css
+++ /dev/null
@@ -1,113 +0,0 @@
-body {
- padding-top: 70px;
-}
-
-h1[id]:before, h2[id]:before, h3[id]:before, h4[id]:before, h5[id]:before, h6[id]:before {
- content: "";
- display: block;
- margin-top: -75px;
- height: 75px;
-}
-
-ul.nav li.main {
- font-weight: bold;
-}
-
-div.col-md-9 {
- padding-bottom: 100px;
-}
-
-div.source-links {
- float: right;
-}
-
-div.col-md-9 img {
- max-width: 100%;
-}
-
-/*
- * Side navigation
- *
- * Scrollspy and affixed enhanced navigation to highlight sections and secondary
- * sections of docs content.
- */
-
-/* By default it's not affixed in mobile views, so undo that */
-.bs-sidebar.affix {
- position: static;
-}
-
-.bs-sidebar.well {
- padding: 0;
-}
-
-/* First level of nav */
-.bs-sidenav {
- margin-top: 30px;
- margin-bottom: 30px;
- padding-top: 10px;
- padding-bottom: 10px;
- border-radius: 5px;
-}
-
-/* All levels of nav */
-.bs-sidebar .nav > li > a {
- display: block;
- padding: 5px 20px;
- z-index: 1;
-}
-.bs-sidebar .nav > li > a:hover,
-.bs-sidebar .nav > li > a:focus {
- text-decoration: none;
- border-right: 1px solid;
-}
-.bs-sidebar .nav > .active > a,
-.bs-sidebar .nav > .active:hover > a,
-.bs-sidebar .nav > .active:focus > a {
- font-weight: bold;
- background-color: transparent;
- border-right: 1px solid;
-}
-
-/* Nav: second level (shown on .active) */
-.bs-sidebar .nav .nav {
- display: none; /* Hide by default, but at >768px, show it */
- margin-bottom: 8px;
-}
-.bs-sidebar .nav .nav > li > a {
- padding-top: 3px;
- padding-bottom: 3px;
- padding-left: 30px;
- font-size: 90%;
-}
-
-/* Show and affix the side nav when space allows it */
-@media (min-width: 992px) {
- .bs-sidebar .nav > .active > ul {
- display: block;
- }
- /* Widen the fixed sidebar */
- .bs-sidebar.affix,
- .bs-sidebar.affix-bottom {
- width: 213px;
- }
- .bs-sidebar.affix {
- position: fixed; /* Undo the static from mobile first approach */
- top: 80px;
- }
- .bs-sidebar.affix-bottom {
- position: absolute; /* Undo the static from mobile first approach */
- }
- .bs-sidebar.affix-bottom .bs-sidenav,
- .bs-sidebar.affix .bs-sidenav {
- margin-top: 0;
- margin-bottom: 0;
- }
-}
-@media (min-width: 1200px) {
- /* Widen the fixed sidebar again */
- .bs-sidebar.affix-bottom,
- .bs-sidebar.affix {
- width: 263px;
- }
-}
diff --git a/site/theme-bootstrap/css/bootstrap-3.3.7.min.css b/site/theme-bootstrap/css/bootstrap-3.3.7.min.css
deleted file mode 100644
index ed3905e..0000000
--- a/site/theme-bootstrap/css/bootstrap-3.3.7.min.css
+++ /dev/null
@@ -1,6 +0,0 @@
-/*!
- * Bootstrap v3.3.7 (http://getbootstrap.com)
- * Copyright 2011-2016 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff2) format('woff2'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-plus:before{content:"\002b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:focus,a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:focus,a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:focus,a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:focus,a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:focus,a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:focus,a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:focus,a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:focus,a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:focus,a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:focus,a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dd,dt{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px\9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=checkbox]:focus,input[type=radio]:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{background-color:transparent;border:0}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=time].form-control,input[type=datetime-local].form-control,input[type=month].form-control{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=time],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=time],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox label,.radio label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-top:4px\9;margin-left:-20px}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.form-control-static{min-height:34px;padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:11px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default.focus,.btn-default:focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.dropdown-toggle.btn-default.focus,.open>.dropdown-toggle.btn-default:focus,.open>.dropdown-toggle.btn-default:hover{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled.focus,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled].focus,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.dropdown-toggle.btn-primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-toggle.btn-primary:hover{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.dropdown-toggle.btn-success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-toggle.btn-success:hover{color:#fff;background-color:#398439;border-color:#255625}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled].focus,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.dropdown-toggle.btn-info.focus,.open>.dropdown-toggle.btn-info:focus,.open>.dropdown-toggle.btn-info:hover{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled.focus,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled].focus,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.dropdown-toggle.btn-warning.focus,.open>.dropdown-toggle.btn-warning:focus,.open>.dropdown-toggle.btn-warning:hover{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled.focus,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled].focus,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.dropdown-toggle.btn-danger.focus,.open>.dropdown-toggle.btn-danger:focus,.open>.dropdown-toggle.btn-danger:hover{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled.focus,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled].focus,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#337ab7;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid\9;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#337ab7;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:2;color:#23527c;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:3;color:#fff;cursor:default;background-color:#337ab7;border-color:#337ab7}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:middle;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{padding-right:15px;padding-left:15px;border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-right:auto;margin-left:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{overflow:hidden;zoom:1}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{color:#555;text-decoration:none;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#c7ddef}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-left-radius:0;border-top-right-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-right:15px;padding-left:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;filter:alpha(opacity=0);opacity:0;line-break:auto}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);line-break:auto}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.active.right,.carousel-inner>.item.next{left:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{left:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);background-color:rgba(0,0,0,0);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block;margin-top:-10px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;font-family:serif;line-height:1}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000\9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.modal-header:after,.modal-header:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{display:table;content:" "}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.modal-header:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-md,.visible-sm,.visible-xs{display:none!important}.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}}
-/*# sourceMappingURL=bootstrap.min.css.map */
\ No newline at end of file
diff --git a/site/theme-bootstrap/js/bootstrap-3.3.7.min.js b/site/theme-bootstrap/js/bootstrap-3.3.7.min.js
deleted file mode 100644
index 9bcd2fc..0000000
--- a/site/theme-bootstrap/js/bootstrap-3.3.7.min.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/*!
- * Bootstrap v3.3.7 (http://getbootstrap.com)
- * Copyright 2011-2016 Twitter, Inc.
- * Licensed under the MIT license
- */
-if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.7",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a("#"===f?[]:f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.7",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c).prop(c,!0)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c).prop(c,!1))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target).closest(".btn");b.call(d,"toggle"),a(c.target).is('input[type="radio"], input[type="checkbox"]')||(c.preventDefault(),d.is("input,button")?d.trigger("focus"):d.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.7",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.7",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth ',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);if(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),!c.isInStateTrue())return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-m