From e55f0b1edc60005b401fa4db44042b40eed1a5e3 Mon Sep 17 00:00:00 2001 From: <> Date: Wed, 18 Sep 2024 09:05:59 +0000 Subject: [PATCH] Deployed 491ae1e with MkDocs version: 1.6.1 --- 404.html | 4 +- ...07f07601.min.js => search.6ce7567c.min.js} | 6 +- ....min.js.map => search.6ce7567c.min.js.map} | 4 +- contact/index.html | 4 +- data-sensitivity/index.html | 4 +- faq/index.html | 4 +- getting-started/index.html | 4 +- images/logo.png | Bin 0 -> 17414 bytes index.html | 119 +++++++++++++++++- pgs/faq/index.html | 4 +- pgs/getting-started/index.html | 4 +- pgs/output-files/index.html | 4 +- pgs/pipeline/index.html | 4 +- pgs/reference-panels/index.html | 4 +- pgs/report/index.html | 4 +- pgs/scores/index.html | 4 +- pgs/tutorial/index.html | 4 +- pipeline/index.html | 4 +- prepare-your-data/index.html | 4 +- reference-panels/index.html | 4 +- resources/index.html | 4 +- search/search_index.json | 2 +- sitemap.xml.gz | Bin 127 -> 127 bytes stylesheets/extra.css | 7 +- tutorials/api/index.html | 4 +- tutorials/imputationbot/index.html | 4 +- workshops/ASHG2020/Session1/index.html | 4 +- workshops/ASHG2020/Session2/index.html | 4 +- workshops/ASHG2020/Session3/index.html | 4 +- workshops/ASHG2020/Session4/index.html | 4 +- workshops/ASHG2020/Session5/index.html | 4 +- workshops/ASHG2020/Session6/index.html | 4 +- workshops/ASHG2020/Session7/index.html | 4 +- workshops/ASHG2020/index.html | 4 +- workshops/ASHG2022/Session1/index.html | 4 +- workshops/ASHG2022/Session2/index.html | 4 +- workshops/ASHG2022/Session3/index.html | 4 +- workshops/ASHG2022/Session4/index.html | 4 +- workshops/ASHG2022/Session5/index.html | 4 +- workshops/ASHG2022/Session6/index.html | 4 +- workshops/ASHG2022/index.html | 4 +- workshops/ASHG2023/Session1/index.html | 4 +- workshops/ASHG2023/Session2/index.html | 4 +- workshops/ASHG2023/Session3/index.html | 4 +- workshops/ASHG2023/Session4/index.html | 4 +- workshops/ASHG2023/Session5/index.html | 4 +- workshops/ASHG2023/Session6/index.html | 4 +- workshops/ASHG2023/index.html | 4 +- 48 files changed, 210 insertions(+), 92 deletions(-) rename assets/javascripts/workers/{search.07f07601.min.js => search.6ce7567c.min.js} (94%) rename assets/javascripts/workers/{search.07f07601.min.js.map => search.6ce7567c.min.js.map} (78%) create mode 100644 images/logo.png diff --git a/404.html b/404.html index 445a5bd..8021302 100644 --- a/404.html +++ b/404.html @@ -12,7 +12,7 @@ - + @@ -839,7 +839,7 @@

404 - Not found

- + diff --git a/assets/javascripts/workers/search.07f07601.min.js b/assets/javascripts/workers/search.6ce7567c.min.js similarity index 94% rename from assets/javascripts/workers/search.07f07601.min.js rename to assets/javascripts/workers/search.6ce7567c.min.js index f3dbf56..8e7e550 100644 --- a/assets/javascripts/workers/search.07f07601.min.js +++ b/assets/javascripts/workers/search.6ce7567c.min.js @@ -1,4 +1,4 @@ -"use strict";(()=>{var xe=Object.create;var U=Object.defineProperty,ve=Object.defineProperties,Se=Object.getOwnPropertyDescriptor,Te=Object.getOwnPropertyDescriptors,Qe=Object.getOwnPropertyNames,Y=Object.getOwnPropertySymbols,Ee=Object.getPrototypeOf,X=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable;var Z=Math.pow,J=(t,e,r)=>e in t?U(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,A=(t,e)=>{for(var r in e||(e={}))X.call(e,r)&&J(t,r,e[r]);if(Y)for(var r of Y(e))be.call(e,r)&&J(t,r,e[r]);return t},G=(t,e)=>ve(t,Te(e));var Le=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var we=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Qe(e))!X.call(t,i)&&i!==r&&U(t,i,{get:()=>e[i],enumerable:!(n=Se(e,i))||n.enumerable});return t};var Pe=(t,e,r)=>(r=t!=null?xe(Ee(t)):{},we(e||!t||!t.__esModule?U(r,"default",{value:t,enumerable:!0}):r,t));var B=(t,e,r)=>new Promise((n,i)=>{var s=u=>{try{a(r.next(u))}catch(c){i(c)}},o=u=>{try{a(r.throw(u))}catch(c){i(c)}},a=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,o);a((r=r.apply(t,e)).next())});var te=Le((K,ee)=>{/** +"use strict";(()=>{var xe=Object.create;var U=Object.defineProperty,ve=Object.defineProperties,Se=Object.getOwnPropertyDescriptor,Te=Object.getOwnPropertyDescriptors,Qe=Object.getOwnPropertyNames,J=Object.getOwnPropertySymbols,Ee=Object.getPrototypeOf,Z=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable;var K=Math.pow,X=(t,e,r)=>e in t?U(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,A=(t,e)=>{for(var r in e||(e={}))Z.call(e,r)&&X(t,r,e[r]);if(J)for(var r of J(e))be.call(e,r)&&X(t,r,e[r]);return t},G=(t,e)=>ve(t,Te(e));var Le=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var we=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Qe(e))!Z.call(t,i)&&i!==r&&U(t,i,{get:()=>e[i],enumerable:!(n=Se(e,i))||n.enumerable});return t};var Pe=(t,e,r)=>(r=t!=null?xe(Ee(t)):{},we(e||!t||!t.__esModule?U(r,"default",{value:t,enumerable:!0}):r,t));var B=(t,e,r)=>new Promise((n,i)=>{var s=u=>{try{a(r.next(u))}catch(c){i(c)}},o=u=>{try{a(r.throw(u))}catch(c){i(c)}},a=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,o);a((r=r.apply(t,e)).next())});var re=Le((ee,te)=>{/** * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9 * Copyright (C) 2020 Oliver Nightingale * @license MIT @@ -37,6 +37,6 @@ */t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(r){var n=new t.QueryParser(e,r);n.parse()})},t.Index.prototype.query=function(e){for(var r=new t.Query(this.fields),n=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),u=0;u1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,r){var n=e[this._ref],i=Object.keys(this._fields);this._documents[n]=r||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,r;do e=this.next(),r=e.charCodeAt(0);while(r>47&&r<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var r=e.next();if(r==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(r.charCodeAt(0)==92){e.escapeCharacter();continue}if(r==":")return t.QueryLexer.lexField;if(r=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(r=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(r=="+"&&e.width()===1||r=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(r.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,r){this.lexer=new t.QueryLexer(e),this.query=r,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var r=e.peekLexeme();if(r!=null)switch(r.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var n="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(n+=" with value '"+r.str+"'"),new t.QueryParseError(n,r.start,r.end)}},t.QueryParser.parsePresence=function(e){var r=e.consumeLexeme();if(r!=null){switch(r.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var n="unrecognised presence operator'"+r.str+"'";throw new t.QueryParseError(n,r.start,r.end)}var i=e.peekLexeme();if(i==null){var n="expecting term or field, found nothing";throw new t.QueryParseError(n,r.start,r.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var n="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(n,i.start,i.end)}}},t.QueryParser.parseField=function(e){var r=e.consumeLexeme();if(r!=null){if(e.query.allFields.indexOf(r.str)==-1){var n=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+r.str+"', possible fields: "+n;throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.fields=[r.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,r.start,r.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var r=e.consumeLexeme();if(r!=null){e.currentClause.term=r.str.toLowerCase(),r.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var n=e.peekLexeme();if(n==null){e.nextClause();return}switch(n.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+n.type+"'";throw new t.QueryParseError(i,n.start,n.end)}}},t.QueryParser.parseEditDistance=function(e){var r=e.consumeLexeme();if(r!=null){var n=parseInt(r.str,10);if(isNaN(n)){var i="edit distance must be numeric";throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.editDistance=n;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var r=e.consumeLexeme();if(r!=null){var n=parseInt(r.str,10);if(isNaN(n)){var i="boost must be numeric";throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.boost=n;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,r){typeof define=="function"&&define.amd?define(r):typeof K=="object"?ee.exports=r():e.lunr=r()}(this,function(){return t})})()});var de=Pe(te());function re(t,e=document){let r=ke(t,e);if(typeof r=="undefined")throw new ReferenceError(`Missing element: expected "${t}" to be present`);return r}function ke(t,e=document){return e.querySelector(t)||void 0}Object.entries||(Object.entries=function(t){let e=[];for(let r of Object.keys(t))e.push([r,t[r]]);return e});Object.values||(Object.values=function(t){let e=[];for(let r of Object.keys(t))e.push(t[r]);return e});typeof Element!="undefined"&&(Element.prototype.scrollTo||(Element.prototype.scrollTo=function(t,e){typeof t=="object"?(this.scrollLeft=t.left,this.scrollTop=t.top):(this.scrollLeft=t,this.scrollTop=e)}),Element.prototype.replaceWith||(Element.prototype.replaceWith=function(...t){let e=this.parentNode;if(e){t.length===0&&e.removeChild(this);for(let r=t.length-1;r>=0;r--){let n=t[r];typeof n=="string"?n=document.createTextNode(n):n.parentNode&&n.parentNode.removeChild(n),r?e.insertBefore(this.previousSibling,n):e.replaceChild(n,this)}}}));function ne(t){let e=new Map;for(let r of t){let[n]=r.location.split("#"),i=e.get(n);typeof i=="undefined"?e.set(n,r):(e.set(r.location,r),r.parent=i)}return e}function W(t,e,r){var s;e=new RegExp(e,"g");let n,i=0;do{n=e.exec(t);let o=(s=n==null?void 0:n.index)!=null?s:t.length;if(in?e(r,1,n,n=i):t.charAt(i)===">"&&(t.charAt(n+1)==="/"?--s===0&&e(r++,2,n,i+1):t.charAt(i-1)!=="/"&&s++===0&&e(r,0,n,i+1),n=i+1);i>n&&e(r,1,n,i)}function se(t,e,r,n=!1){return q([t],e,r,n).pop()}function q(t,e,r,n=!1){let i=[0];for(let s=1;s>>2&1023,c=a[0]>>>12;i.push(+(u>c)+i[i.length-1])}return t.map((s,o)=>{let a=0,u=new Map;for(let f of r.sort((g,l)=>g-l)){let g=f&1048575,l=f>>>20;if(i[l]!==o)continue;let m=u.get(l);typeof m=="undefined"&&u.set(l,m=[]),m.push(g)}if(u.size===0)return s;let c=[];for(let[f,g]of u){let l=e[f],m=l[0]>>>12,x=l[l.length-1]>>>12,v=l[l.length-1]>>>2&1023;n&&m>a&&c.push(s.slice(a,m));let d=s.slice(m,x+v);for(let y of g.sort((b,E)=>E-b)){let b=(l[y]>>>12)-m,E=(l[y]>>>2&1023)+b;d=[d.slice(0,b),"",d.slice(b,E),"",d.slice(E)].join("")}if(a=x+v,c.push(d)===2)break}return n&&a{var f;switch(i[f=o+=s]||(i[f]=[]),a){case 0:case 2:i[o].push(u<<12|c-u<<2|a);break;case 1:let g=r[n].slice(u,c);W(g,lunr.tokenizer.separator,(l,m)=>{if(typeof lunr.segmenter!="undefined"){let x=g.slice(l,m);if(/^[MHIK]$/.test(lunr.segmenter.ctype_(x))){let v=lunr.segmenter.segment(x);for(let d=0,y=0;dr){return t.trim().split(/"([^"]+)"/g).map((r,n)=>n&1?r.replace(/^\b|^(?![^\x00-\x7F]|$)|\s+/g," +"):r).join("").replace(/"|(?:^|\s+)[*+\-:^~]+(?=\s+|$)/g,"").split(/\s+/g).reduce((r,n)=>{let i=e(n);return[...r,...Array.isArray(i)?i:[i]]},[]).map(r=>/([~^]$)/.test(r)?`${r}1`:r).map(r=>/(^[+-]|[~^]\d+$)/.test(r)?r:`${r}*`).join(" ")}function ue(t){return ae(t,e=>{let r=[],n=new lunr.QueryLexer(e);n.run();for(let{type:i,str:s,start:o,end:a}of n.lexemes)switch(i){case"FIELD":["title","text","tags"].includes(s)||(e=[e.slice(0,a)," ",e.slice(a+1)].join(""));break;case"TERM":W(s,lunr.tokenizer.separator,(...u)=>{r.push([e.slice(0,o),s.slice(...u),e.slice(a)].join(""))})}return r})}function ce(t){let e=new lunr.Query(["title","text","tags"]);new lunr.QueryParser(t,e).parse();for(let n of e.clauses)n.usePipeline=!0,n.term.startsWith("*")&&(n.wildcard=lunr.Query.wildcard.LEADING,n.term=n.term.slice(1)),n.term.endsWith("*")&&(n.wildcard=lunr.Query.wildcard.TRAILING,n.term=n.term.slice(0,-1));return e.clauses}function le(t,e){var i;let r=new Set(t),n={};for(let s=0;s0;){let o=i[--s];for(let u=1;un[o]-u&&(r.add(t.slice(o,o+u)),i[s++]=o+u);let a=o+n[o];n[a]&&ar=>{if(typeof r[e]=="undefined")return;let n=[r.location,e].join(":");return t.set(n,lunr.tokenizer.table=[]),r[e]}}function Re(t,e){let[r,n]=[new Set(t),new Set(e)];return[...new Set([...r].filter(i=>!n.has(i)))]}var H=class{constructor({config:e,docs:r,options:n}){let i=Oe(this.table=new Map);this.map=ne(r),this.options=n,this.index=lunr(function(){this.metadataWhitelist=["position"],this.b(0),e.lang.length===1&&e.lang[0]!=="en"?this.use(lunr[e.lang[0]]):e.lang.length>1&&this.use(lunr.multiLanguage(...e.lang)),this.tokenizer=oe,lunr.tokenizer.separator=new RegExp(e.separator),lunr.segmenter="TinySegmenter"in lunr?new lunr.TinySegmenter:void 0;let s=Re(["trimmer","stopWordFilter","stemmer"],e.pipeline);for(let o of e.lang.map(a=>a==="en"?lunr:lunr[a]))for(let a of s)this.pipeline.remove(o[a]),this.searchPipeline.remove(o[a]);this.ref("location"),this.field("title",{boost:1e3,extractor:i("title")}),this.field("text",{boost:1,extractor:i("text")}),this.field("tags",{boost:1e6,extractor:i("tags")});for(let o of r)this.add(o,{boost:o.boost})})}search(e){if(e=e.replace(new RegExp("\\p{sc=Han}+","gu"),s=>[...he(s,this.index.invertedIndex)].join("* ")),e=ue(e),!e)return{items:[]};let r=ce(e).filter(s=>s.presence!==lunr.Query.presence.PROHIBITED),n=this.index.search(e).reduce((s,{ref:o,score:a,matchData:u})=>{let c=this.map.get(o);if(typeof c!="undefined"){c=A({},c),c.tags&&(c.tags=[...c.tags]);let f=le(r,Object.keys(u.metadata));for(let l of this.index.fields){if(typeof c[l]=="undefined")continue;let m=[];for(let d of Object.values(u.metadata))typeof d[l]!="undefined"&&m.push(...d[l].position);if(!m.length)continue;let x=this.table.get([c.location,l].join(":")),v=Array.isArray(c[l])?q:se;c[l]=v(c[l],x,m,l!=="text")}let g=+!c.parent+Object.values(f).filter(l=>l).length/Object.keys(f).length;s.push(G(A({},c),{score:a*(1+Z(g,2)),terms:f}))}return s},[]).sort((s,o)=>o.score-s.score).reduce((s,o)=>{let a=this.map.get(o.location);if(typeof a!="undefined"){let u=a.parent?a.parent.location:a.location;s.set(u,[...s.get(u)||[],o])}return s},new Map);for(let[s,o]of n)if(!o.find(a=>a.location===s)){let a=this.map.get(s);o.push(G(A({},a),{score:0,terms:{}}))}let i;if(this.options.suggest){let s=this.index.query(o=>{for(let a of r)o.term(a.term,{fields:["title"],presence:lunr.Query.presence.REQUIRED,wildcard:lunr.Query.wildcard.TRAILING})});i=s.length?Object.keys(s[0].matchData.metadata):[]}return A({items:[...n.values()]},typeof i!="undefined"&&{suggest:i})}};var fe;function Ie(t){return B(this,null,function*(){let e="../lunr";if(typeof parent!="undefined"&&"IFrameWorker"in parent){let n=re("script[src]"),[i]=n.src.split("/worker");e=e.replace("..",i)}let r=[];for(let n of t.lang){switch(n){case"ja":r.push(`${e}/tinyseg.js`);break;case"hi":case"th":r.push(`${e}/wordcut.js`);break}n!=="en"&&r.push(`${e}/min/lunr.${n}.min.js`)}t.lang.length>1&&r.push(`${e}/min/lunr.multi.min.js`),r.length&&(yield importScripts(`${e}/min/lunr.stemmer.support.min.js`,...r))})}function Fe(t){return B(this,null,function*(){switch(t.type){case 0:return yield Ie(t.data.config),fe=new H(t.data),{type:1};case 2:let e=t.data;try{return{type:3,data:fe.search(e)}}catch(r){return console.warn(`Invalid query: ${e} \u2013 see https://bit.ly/2s3ChXG`),console.warn(r),{type:3,data:{items:[]}}}default:throw new TypeError("Invalid message type")}})}self.lunr=de.default;addEventListener("message",t=>B(void 0,null,function*(){postMessage(yield Fe(t.data))}));})(); -//# sourceMappingURL=search.07f07601.min.js.map + */t.Builder=function(){this._ref="id",this._fields=Object.create(null),this._documents=Object.create(null),this.invertedIndex=Object.create(null),this.fieldTermFrequencies={},this.fieldLengths={},this.tokenizer=t.tokenizer,this.pipeline=new t.Pipeline,this.searchPipeline=new t.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},t.Builder.prototype.ref=function(e){this._ref=e},t.Builder.prototype.field=function(e,r){if(/\//.test(e))throw new RangeError("Field '"+e+"' contains illegal character '/'");this._fields[e]=r||{}},t.Builder.prototype.b=function(e){e<0?this._b=0:e>1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,r){var n=e[this._ref],i=Object.keys(this._fields);this._documents[n]=r||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,r;do e=this.next(),r=e.charCodeAt(0);while(r>47&&r<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var r=e.next();if(r==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(r.charCodeAt(0)==92){e.escapeCharacter();continue}if(r==":")return t.QueryLexer.lexField;if(r=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(r=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(r=="+"&&e.width()===1||r=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(r.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,r){this.lexer=new t.QueryLexer(e),this.query=r,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var r=e.peekLexeme();if(r!=null)switch(r.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var n="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(n+=" with value '"+r.str+"'"),new t.QueryParseError(n,r.start,r.end)}},t.QueryParser.parsePresence=function(e){var r=e.consumeLexeme();if(r!=null){switch(r.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var n="unrecognised presence operator'"+r.str+"'";throw new t.QueryParseError(n,r.start,r.end)}var i=e.peekLexeme();if(i==null){var n="expecting term or field, found nothing";throw new t.QueryParseError(n,r.start,r.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var n="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(n,i.start,i.end)}}},t.QueryParser.parseField=function(e){var r=e.consumeLexeme();if(r!=null){if(e.query.allFields.indexOf(r.str)==-1){var n=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+r.str+"', possible fields: "+n;throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.fields=[r.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,r.start,r.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var r=e.consumeLexeme();if(r!=null){e.currentClause.term=r.str.toLowerCase(),r.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var n=e.peekLexeme();if(n==null){e.nextClause();return}switch(n.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+n.type+"'";throw new t.QueryParseError(i,n.start,n.end)}}},t.QueryParser.parseEditDistance=function(e){var r=e.consumeLexeme();if(r!=null){var n=parseInt(r.str,10);if(isNaN(n)){var i="edit distance must be numeric";throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.editDistance=n;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var r=e.consumeLexeme();if(r!=null){var n=parseInt(r.str,10);if(isNaN(n)){var i="boost must be numeric";throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.boost=n;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,r){typeof define=="function"&&define.amd?define(r):typeof ee=="object"?te.exports=r():e.lunr=r()}(this,function(){return t})})()});var Y=Pe(re());function ne(t,e=document){let r=ke(t,e);if(typeof r=="undefined")throw new ReferenceError(`Missing element: expected "${t}" to be present`);return r}function ke(t,e=document){return e.querySelector(t)||void 0}Object.entries||(Object.entries=function(t){let e=[];for(let r of Object.keys(t))e.push([r,t[r]]);return e});Object.values||(Object.values=function(t){let e=[];for(let r of Object.keys(t))e.push(t[r]);return e});typeof Element!="undefined"&&(Element.prototype.scrollTo||(Element.prototype.scrollTo=function(t,e){typeof t=="object"?(this.scrollLeft=t.left,this.scrollTop=t.top):(this.scrollLeft=t,this.scrollTop=e)}),Element.prototype.replaceWith||(Element.prototype.replaceWith=function(...t){let e=this.parentNode;if(e){t.length===0&&e.removeChild(this);for(let r=t.length-1;r>=0;r--){let n=t[r];typeof n=="string"?n=document.createTextNode(n):n.parentNode&&n.parentNode.removeChild(n),r?e.insertBefore(this.previousSibling,n):e.replaceChild(n,this)}}}));function ie(t){let e=new Map;for(let r of t){let[n]=r.location.split("#"),i=e.get(n);typeof i=="undefined"?e.set(n,r):(e.set(r.location,r),r.parent=i)}return e}function W(t,e,r){var s;e=new RegExp(e,"g");let n,i=0;do{n=e.exec(t);let o=(s=n==null?void 0:n.index)!=null?s:t.length;if(in?e(r,1,n,n=i):t.charAt(i)===">"&&(t.charAt(n+1)==="/"?--s===0&&e(r++,2,n,i+1):t.charAt(i-1)!=="/"&&s++===0&&e(r,0,n,i+1),n=i+1);i>n&&e(r,1,n,i)}function oe(t,e,r,n=!1){return q([t],e,r,n).pop()}function q(t,e,r,n=!1){let i=[0];for(let s=1;s>>2&1023,c=a[0]>>>12;i.push(+(u>c)+i[i.length-1])}return t.map((s,o)=>{let a=0,u=new Map;for(let f of r.sort((g,l)=>g-l)){let g=f&1048575,l=f>>>20;if(i[l]!==o)continue;let m=u.get(l);typeof m=="undefined"&&u.set(l,m=[]),m.push(g)}if(u.size===0)return s;let c=[];for(let[f,g]of u){let l=e[f],m=l[0]>>>12,x=l[l.length-1]>>>12,v=l[l.length-1]>>>2&1023;n&&m>a&&c.push(s.slice(a,m));let d=s.slice(m,x+v);for(let y of g.sort((b,E)=>E-b)){let b=(l[y]>>>12)-m,E=(l[y]>>>2&1023)+b;d=[d.slice(0,b),"",d.slice(b,E),"",d.slice(E)].join("")}if(a=x+v,c.push(d)===2)break}return n&&a{var f;switch(i[f=o+=s]||(i[f]=[]),a){case 0:case 2:i[o].push(u<<12|c-u<<2|a);break;case 1:let g=r[n].slice(u,c);W(g,lunr.tokenizer.separator,(l,m)=>{if(typeof lunr.segmenter!="undefined"){let x=g.slice(l,m);if(/^[MHIK]$/.test(lunr.segmenter.ctype_(x))){let v=lunr.segmenter.segment(x);for(let d=0,y=0;dr){return t.trim().split(/"([^"]+)"/g).map((r,n)=>n&1?r.replace(/^\b|^(?![^\x00-\x7F]|$)|\s+/g," +"):r).join("").replace(/"|(?:^|\s+)[*+\-:^~]+(?=\s+|$)/g,"").split(/\s+/g).reduce((r,n)=>{let i=e(n);return[...r,...Array.isArray(i)?i:[i]]},[]).map(r=>/([~^]$)/.test(r)?`${r}1`:r).map(r=>/(^[+-]|[~^]\d+$)/.test(r)?r:`${r}*`).join(" ")}function ce(t){return ue(t,e=>{let r=[],n=new lunr.QueryLexer(e);n.run();for(let{type:i,str:s,start:o,end:a}of n.lexemes)switch(i){case"FIELD":["title","text","tags"].includes(s)||(e=[e.slice(0,a)," ",e.slice(a+1)].join(""));break;case"TERM":W(s,lunr.tokenizer.separator,(...u)=>{r.push([e.slice(0,o),s.slice(...u),e.slice(a)].join(""))})}return r})}function le(t){let e=new lunr.Query(["title","text","tags"]);new lunr.QueryParser(t,e).parse();for(let n of e.clauses)n.usePipeline=!0,n.term.startsWith("*")&&(n.wildcard=lunr.Query.wildcard.LEADING,n.term=n.term.slice(1)),n.term.endsWith("*")&&(n.wildcard=lunr.Query.wildcard.TRAILING,n.term=n.term.slice(0,-1));return e.clauses}function he(t,e){var i;let r=new Set(t),n={};for(let s=0;s0;){let o=i[--s];for(let u=1;un[o]-u&&(r.add(t.slice(o,o+u)),i[s++]=o+u);let a=o+n[o];n[a]&&ar=>{if(typeof r[e]=="undefined")return;let n=[r.location,e].join(":");return t.set(n,lunr.tokenizer.table=[]),r[e]}}function Re(t,e){let[r,n]=[new Set(t),new Set(e)];return[...new Set([...r].filter(i=>!n.has(i)))]}var H=class{constructor({config:e,docs:r,options:n}){let i=Oe(this.table=new Map);this.map=ie(r),this.options=n,this.index=lunr(function(){this.metadataWhitelist=["position"],this.b(0),e.lang.length===1&&e.lang[0]!=="en"?this.use(lunr[e.lang[0]]):e.lang.length>1&&this.use(lunr.multiLanguage(...e.lang)),this.tokenizer=ae,lunr.tokenizer.separator=new RegExp(e.separator),lunr.segmenter="TinySegmenter"in lunr?new lunr.TinySegmenter:void 0;let s=Re(["trimmer","stopWordFilter","stemmer"],e.pipeline);for(let o of e.lang.map(a=>a==="en"?lunr:lunr[a]))for(let a of s)this.pipeline.remove(o[a]),this.searchPipeline.remove(o[a]);this.ref("location"),this.field("title",{boost:1e3,extractor:i("title")}),this.field("text",{boost:1,extractor:i("text")}),this.field("tags",{boost:1e6,extractor:i("tags")});for(let o of r)this.add(o,{boost:o.boost})})}search(e){if(e=e.replace(new RegExp("\\p{sc=Han}+","gu"),s=>[...fe(s,this.index.invertedIndex)].join("* ")),e=ce(e),!e)return{items:[]};let r=le(e).filter(s=>s.presence!==lunr.Query.presence.PROHIBITED),n=this.index.search(e).reduce((s,{ref:o,score:a,matchData:u})=>{let c=this.map.get(o);if(typeof c!="undefined"){c=A({},c),c.tags&&(c.tags=[...c.tags]);let f=he(r,Object.keys(u.metadata));for(let l of this.index.fields){if(typeof c[l]=="undefined")continue;let m=[];for(let d of Object.values(u.metadata))typeof d[l]!="undefined"&&m.push(...d[l].position);if(!m.length)continue;let x=this.table.get([c.location,l].join(":")),v=Array.isArray(c[l])?q:oe;c[l]=v(c[l],x,m,l!=="text")}let g=+!c.parent+Object.values(f).filter(l=>l).length/Object.keys(f).length;s.push(G(A({},c),{score:a*(1+K(g,2)),terms:f}))}return s},[]).sort((s,o)=>o.score-s.score).reduce((s,o)=>{let a=this.map.get(o.location);if(typeof a!="undefined"){let u=a.parent?a.parent.location:a.location;s.set(u,[...s.get(u)||[],o])}return s},new Map);for(let[s,o]of n)if(!o.find(a=>a.location===s)){let a=this.map.get(s);o.push(G(A({},a),{score:0,terms:{}}))}let i;if(this.options.suggest){let s=this.index.query(o=>{for(let a of r)o.term(a.term,{fields:["title"],presence:lunr.Query.presence.REQUIRED,wildcard:lunr.Query.wildcard.TRAILING})});i=s.length?Object.keys(s[0].matchData.metadata):[]}return A({items:[...n.values()]},typeof i!="undefined"&&{suggest:i})}};var de;function Ie(t){return B(this,null,function*(){let e="../lunr";if(typeof parent!="undefined"&&"IFrameWorker"in parent){let n=ne("script[src]"),[i]=n.src.split("/worker");e=e.replace("..",i)}let r=[];for(let n of t.lang){switch(n){case"ja":r.push(`${e}/tinyseg.js`);break;case"hi":case"th":r.push(`${e}/wordcut.js`);break}n!=="en"&&r.push(`${e}/min/lunr.${n}.min.js`)}t.lang.length>1&&r.push(`${e}/min/lunr.multi.min.js`),r.length&&(yield importScripts(`${e}/min/lunr.stemmer.support.min.js`,...r))})}function Fe(t){return B(this,null,function*(){switch(t.type){case 0:return yield Ie(t.data.config),de=new H(t.data),{type:1};case 2:let e=t.data;try{return{type:3,data:de.search(e)}}catch(r){return console.warn(`Invalid query: ${e} \u2013 see https://bit.ly/2s3ChXG`),console.warn(r),{type:3,data:{items:[]}}}default:throw new TypeError("Invalid message type")}})}self.lunr=Y.default;Y.default.utils.warn=console.warn;addEventListener("message",t=>B(void 0,null,function*(){postMessage(yield Fe(t.data))}));})(); +//# sourceMappingURL=search.6ce7567c.min.js.map diff --git a/assets/javascripts/workers/search.07f07601.min.js.map b/assets/javascripts/workers/search.6ce7567c.min.js.map similarity index 78% rename from assets/javascripts/workers/search.07f07601.min.js.map rename to assets/javascripts/workers/search.6ce7567c.min.js.map index 7fdd4d0..e7c69d2 100644 --- a/assets/javascripts/workers/search.07f07601.min.js.map +++ b/assets/javascripts/workers/search.6ce7567c.min.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["node_modules/lunr/lunr.js", "src/templates/assets/javascripts/integrations/search/worker/main/index.ts", "src/templates/assets/javascripts/browser/element/_/index.ts", "src/templates/assets/javascripts/polyfills/index.ts", "src/templates/assets/javascripts/integrations/search/config/index.ts", "src/templates/assets/javascripts/integrations/search/internal/_/index.ts", "src/templates/assets/javascripts/integrations/search/internal/extract/index.ts", "src/templates/assets/javascripts/integrations/search/internal/highlight/index.ts", "src/templates/assets/javascripts/integrations/search/internal/tokenize/index.ts", "src/templates/assets/javascripts/integrations/search/query/transform/index.ts", "src/templates/assets/javascripts/integrations/search/query/_/index.ts", "src/templates/assets/javascripts/integrations/search/query/segment/index.ts", "src/templates/assets/javascripts/integrations/search/_/index.ts"], - "sourcesContent": ["/**\n * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9\n * Copyright (C) 2020 Oliver Nightingale\n * @license MIT\n */\n\n;(function(){\n\n/**\n * A convenience function for configuring and constructing\n * a new lunr Index.\n *\n * A lunr.Builder instance is created and the pipeline setup\n * with a trimmer, stop word filter and stemmer.\n *\n * This builder object is yielded to the configuration function\n * that is passed as a parameter, allowing the list of fields\n * and other builder parameters to be customised.\n *\n * All documents _must_ be added within the passed config function.\n *\n * @example\n * var idx = lunr(function () {\n * this.field('title')\n * this.field('body')\n * this.ref('id')\n *\n * documents.forEach(function (doc) {\n * this.add(doc)\n * }, this)\n * })\n *\n * @see {@link lunr.Builder}\n * @see {@link lunr.Pipeline}\n * @see {@link lunr.trimmer}\n * @see {@link lunr.stopWordFilter}\n * @see {@link lunr.stemmer}\n * @namespace {function} lunr\n */\nvar lunr = function (config) {\n var builder = new lunr.Builder\n\n builder.pipeline.add(\n lunr.trimmer,\n lunr.stopWordFilter,\n lunr.stemmer\n )\n\n builder.searchPipeline.add(\n lunr.stemmer\n )\n\n config.call(builder, builder)\n return builder.build()\n}\n\nlunr.version = \"2.3.9\"\n/*!\n * lunr.utils\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * A namespace containing utils for the rest of the lunr library\n * @namespace lunr.utils\n */\nlunr.utils = {}\n\n/**\n * Print a warning message to the console.\n *\n * @param {String} message The message to be printed.\n * @memberOf lunr.utils\n * @function\n */\nlunr.utils.warn = (function (global) {\n /* eslint-disable no-console */\n return function (message) {\n if (global.console && console.warn) {\n console.warn(message)\n }\n }\n /* eslint-enable no-console */\n})(this)\n\n/**\n * Convert an object to a string.\n *\n * In the case of `null` and `undefined` the function returns\n * the empty string, in all other cases the result of calling\n * `toString` on the passed object is returned.\n *\n * @param {Any} obj The object to convert to a string.\n * @return {String} string representation of the passed object.\n * @memberOf lunr.utils\n */\nlunr.utils.asString = function (obj) {\n if (obj === void 0 || obj === null) {\n return \"\"\n } else {\n return obj.toString()\n }\n}\n\n/**\n * Clones an object.\n *\n * Will create a copy of an existing object such that any mutations\n * on the copy cannot affect the original.\n *\n * Only shallow objects are supported, passing a nested object to this\n * function will cause a TypeError.\n *\n * Objects with primitives, and arrays of primitives are supported.\n *\n * @param {Object} obj The object to clone.\n * @return {Object} a clone of the passed object.\n * @throws {TypeError} when a nested object is passed.\n * @memberOf Utils\n */\nlunr.utils.clone = function (obj) {\n if (obj === null || obj === undefined) {\n return obj\n }\n\n var clone = Object.create(null),\n keys = Object.keys(obj)\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i],\n val = obj[key]\n\n if (Array.isArray(val)) {\n clone[key] = val.slice()\n continue\n }\n\n if (typeof val === 'string' ||\n typeof val === 'number' ||\n typeof val === 'boolean') {\n clone[key] = val\n continue\n }\n\n throw new TypeError(\"clone is not deep and does not support nested objects\")\n }\n\n return clone\n}\nlunr.FieldRef = function (docRef, fieldName, stringValue) {\n this.docRef = docRef\n this.fieldName = fieldName\n this._stringValue = stringValue\n}\n\nlunr.FieldRef.joiner = \"/\"\n\nlunr.FieldRef.fromString = function (s) {\n var n = s.indexOf(lunr.FieldRef.joiner)\n\n if (n === -1) {\n throw \"malformed field ref string\"\n }\n\n var fieldRef = s.slice(0, n),\n docRef = s.slice(n + 1)\n\n return new lunr.FieldRef (docRef, fieldRef, s)\n}\n\nlunr.FieldRef.prototype.toString = function () {\n if (this._stringValue == undefined) {\n this._stringValue = this.fieldName + lunr.FieldRef.joiner + this.docRef\n }\n\n return this._stringValue\n}\n/*!\n * lunr.Set\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * A lunr set.\n *\n * @constructor\n */\nlunr.Set = function (elements) {\n this.elements = Object.create(null)\n\n if (elements) {\n this.length = elements.length\n\n for (var i = 0; i < this.length; i++) {\n this.elements[elements[i]] = true\n }\n } else {\n this.length = 0\n }\n}\n\n/**\n * A complete set that contains all elements.\n *\n * @static\n * @readonly\n * @type {lunr.Set}\n */\nlunr.Set.complete = {\n intersect: function (other) {\n return other\n },\n\n union: function () {\n return this\n },\n\n contains: function () {\n return true\n }\n}\n\n/**\n * An empty set that contains no elements.\n *\n * @static\n * @readonly\n * @type {lunr.Set}\n */\nlunr.Set.empty = {\n intersect: function () {\n return this\n },\n\n union: function (other) {\n return other\n },\n\n contains: function () {\n return false\n }\n}\n\n/**\n * Returns true if this set contains the specified object.\n *\n * @param {object} object - Object whose presence in this set is to be tested.\n * @returns {boolean} - True if this set contains the specified object.\n */\nlunr.Set.prototype.contains = function (object) {\n return !!this.elements[object]\n}\n\n/**\n * Returns a new set containing only the elements that are present in both\n * this set and the specified set.\n *\n * @param {lunr.Set} other - set to intersect with this set.\n * @returns {lunr.Set} a new set that is the intersection of this and the specified set.\n */\n\nlunr.Set.prototype.intersect = function (other) {\n var a, b, elements, intersection = []\n\n if (other === lunr.Set.complete) {\n return this\n }\n\n if (other === lunr.Set.empty) {\n return other\n }\n\n if (this.length < other.length) {\n a = this\n b = other\n } else {\n a = other\n b = this\n }\n\n elements = Object.keys(a.elements)\n\n for (var i = 0; i < elements.length; i++) {\n var element = elements[i]\n if (element in b.elements) {\n intersection.push(element)\n }\n }\n\n return new lunr.Set (intersection)\n}\n\n/**\n * Returns a new set combining the elements of this and the specified set.\n *\n * @param {lunr.Set} other - set to union with this set.\n * @return {lunr.Set} a new set that is the union of this and the specified set.\n */\n\nlunr.Set.prototype.union = function (other) {\n if (other === lunr.Set.complete) {\n return lunr.Set.complete\n }\n\n if (other === lunr.Set.empty) {\n return this\n }\n\n return new lunr.Set(Object.keys(this.elements).concat(Object.keys(other.elements)))\n}\n/**\n * A function to calculate the inverse document frequency for\n * a posting. This is shared between the builder and the index\n *\n * @private\n * @param {object} posting - The posting for a given term\n * @param {number} documentCount - The total number of documents.\n */\nlunr.idf = function (posting, documentCount) {\n var documentsWithTerm = 0\n\n for (var fieldName in posting) {\n if (fieldName == '_index') continue // Ignore the term index, its not a field\n documentsWithTerm += Object.keys(posting[fieldName]).length\n }\n\n var x = (documentCount - documentsWithTerm + 0.5) / (documentsWithTerm + 0.5)\n\n return Math.log(1 + Math.abs(x))\n}\n\n/**\n * A token wraps a string representation of a token\n * as it is passed through the text processing pipeline.\n *\n * @constructor\n * @param {string} [str=''] - The string token being wrapped.\n * @param {object} [metadata={}] - Metadata associated with this token.\n */\nlunr.Token = function (str, metadata) {\n this.str = str || \"\"\n this.metadata = metadata || {}\n}\n\n/**\n * Returns the token string that is being wrapped by this object.\n *\n * @returns {string}\n */\nlunr.Token.prototype.toString = function () {\n return this.str\n}\n\n/**\n * A token update function is used when updating or optionally\n * when cloning a token.\n *\n * @callback lunr.Token~updateFunction\n * @param {string} str - The string representation of the token.\n * @param {Object} metadata - All metadata associated with this token.\n */\n\n/**\n * Applies the given function to the wrapped string token.\n *\n * @example\n * token.update(function (str, metadata) {\n * return str.toUpperCase()\n * })\n *\n * @param {lunr.Token~updateFunction} fn - A function to apply to the token string.\n * @returns {lunr.Token}\n */\nlunr.Token.prototype.update = function (fn) {\n this.str = fn(this.str, this.metadata)\n return this\n}\n\n/**\n * Creates a clone of this token. Optionally a function can be\n * applied to the cloned token.\n *\n * @param {lunr.Token~updateFunction} [fn] - An optional function to apply to the cloned token.\n * @returns {lunr.Token}\n */\nlunr.Token.prototype.clone = function (fn) {\n fn = fn || function (s) { return s }\n return new lunr.Token (fn(this.str, this.metadata), this.metadata)\n}\n/*!\n * lunr.tokenizer\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * A function for splitting a string into tokens ready to be inserted into\n * the search index. Uses `lunr.tokenizer.separator` to split strings, change\n * the value of this property to change how strings are split into tokens.\n *\n * This tokenizer will convert its parameter to a string by calling `toString` and\n * then will split this string on the character in `lunr.tokenizer.separator`.\n * Arrays will have their elements converted to strings and wrapped in a lunr.Token.\n *\n * Optional metadata can be passed to the tokenizer, this metadata will be cloned and\n * added as metadata to every token that is created from the object to be tokenized.\n *\n * @static\n * @param {?(string|object|object[])} obj - The object to convert into tokens\n * @param {?object} metadata - Optional metadata to associate with every token\n * @returns {lunr.Token[]}\n * @see {@link lunr.Pipeline}\n */\nlunr.tokenizer = function (obj, metadata) {\n if (obj == null || obj == undefined) {\n return []\n }\n\n if (Array.isArray(obj)) {\n return obj.map(function (t) {\n return new lunr.Token(\n lunr.utils.asString(t).toLowerCase(),\n lunr.utils.clone(metadata)\n )\n })\n }\n\n var str = obj.toString().toLowerCase(),\n len = str.length,\n tokens = []\n\n for (var sliceEnd = 0, sliceStart = 0; sliceEnd <= len; sliceEnd++) {\n var char = str.charAt(sliceEnd),\n sliceLength = sliceEnd - sliceStart\n\n if ((char.match(lunr.tokenizer.separator) || sliceEnd == len)) {\n\n if (sliceLength > 0) {\n var tokenMetadata = lunr.utils.clone(metadata) || {}\n tokenMetadata[\"position\"] = [sliceStart, sliceLength]\n tokenMetadata[\"index\"] = tokens.length\n\n tokens.push(\n new lunr.Token (\n str.slice(sliceStart, sliceEnd),\n tokenMetadata\n )\n )\n }\n\n sliceStart = sliceEnd + 1\n }\n\n }\n\n return tokens\n}\n\n/**\n * The separator used to split a string into tokens. Override this property to change the behaviour of\n * `lunr.tokenizer` behaviour when tokenizing strings. By default this splits on whitespace and hyphens.\n *\n * @static\n * @see lunr.tokenizer\n */\nlunr.tokenizer.separator = /[\\s\\-]+/\n/*!\n * lunr.Pipeline\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * lunr.Pipelines maintain an ordered list of functions to be applied to all\n * tokens in documents entering the search index and queries being ran against\n * the index.\n *\n * An instance of lunr.Index created with the lunr shortcut will contain a\n * pipeline with a stop word filter and an English language stemmer. Extra\n * functions can be added before or after either of these functions or these\n * default functions can be removed.\n *\n * When run the pipeline will call each function in turn, passing a token, the\n * index of that token in the original list of all tokens and finally a list of\n * all the original tokens.\n *\n * The output of functions in the pipeline will be passed to the next function\n * in the pipeline. To exclude a token from entering the index the function\n * should return undefined, the rest of the pipeline will not be called with\n * this token.\n *\n * For serialisation of pipelines to work, all functions used in an instance of\n * a pipeline should be registered with lunr.Pipeline. Registered functions can\n * then be loaded. If trying to load a serialised pipeline that uses functions\n * that are not registered an error will be thrown.\n *\n * If not planning on serialising the pipeline then registering pipeline functions\n * is not necessary.\n *\n * @constructor\n */\nlunr.Pipeline = function () {\n this._stack = []\n}\n\nlunr.Pipeline.registeredFunctions = Object.create(null)\n\n/**\n * A pipeline function maps lunr.Token to lunr.Token. A lunr.Token contains the token\n * string as well as all known metadata. A pipeline function can mutate the token string\n * or mutate (or add) metadata for a given token.\n *\n * A pipeline function can indicate that the passed token should be discarded by returning\n * null, undefined or an empty string. This token will not be passed to any downstream pipeline\n * functions and will not be added to the index.\n *\n * Multiple tokens can be returned by returning an array of tokens. Each token will be passed\n * to any downstream pipeline functions and all will returned tokens will be added to the index.\n *\n * Any number of pipeline functions may be chained together using a lunr.Pipeline.\n *\n * @interface lunr.PipelineFunction\n * @param {lunr.Token} token - A token from the document being processed.\n * @param {number} i - The index of this token in the complete list of tokens for this document/field.\n * @param {lunr.Token[]} tokens - All tokens for this document/field.\n * @returns {(?lunr.Token|lunr.Token[])}\n */\n\n/**\n * Register a function with the pipeline.\n *\n * Functions that are used in the pipeline should be registered if the pipeline\n * needs to be serialised, or a serialised pipeline needs to be loaded.\n *\n * Registering a function does not add it to a pipeline, functions must still be\n * added to instances of the pipeline for them to be used when running a pipeline.\n *\n * @param {lunr.PipelineFunction} fn - The function to check for.\n * @param {String} label - The label to register this function with\n */\nlunr.Pipeline.registerFunction = function (fn, label) {\n if (label in this.registeredFunctions) {\n lunr.utils.warn('Overwriting existing registered function: ' + label)\n }\n\n fn.label = label\n lunr.Pipeline.registeredFunctions[fn.label] = fn\n}\n\n/**\n * Warns if the function is not registered as a Pipeline function.\n *\n * @param {lunr.PipelineFunction} fn - The function to check for.\n * @private\n */\nlunr.Pipeline.warnIfFunctionNotRegistered = function (fn) {\n var isRegistered = fn.label && (fn.label in this.registeredFunctions)\n\n if (!isRegistered) {\n lunr.utils.warn('Function is not registered with pipeline. This may cause problems when serialising the index.\\n', fn)\n }\n}\n\n/**\n * Loads a previously serialised pipeline.\n *\n * All functions to be loaded must already be registered with lunr.Pipeline.\n * If any function from the serialised data has not been registered then an\n * error will be thrown.\n *\n * @param {Object} serialised - The serialised pipeline to load.\n * @returns {lunr.Pipeline}\n */\nlunr.Pipeline.load = function (serialised) {\n var pipeline = new lunr.Pipeline\n\n serialised.forEach(function (fnName) {\n var fn = lunr.Pipeline.registeredFunctions[fnName]\n\n if (fn) {\n pipeline.add(fn)\n } else {\n throw new Error('Cannot load unregistered function: ' + fnName)\n }\n })\n\n return pipeline\n}\n\n/**\n * Adds new functions to the end of the pipeline.\n *\n * Logs a warning if the function has not been registered.\n *\n * @param {lunr.PipelineFunction[]} functions - Any number of functions to add to the pipeline.\n */\nlunr.Pipeline.prototype.add = function () {\n var fns = Array.prototype.slice.call(arguments)\n\n fns.forEach(function (fn) {\n lunr.Pipeline.warnIfFunctionNotRegistered(fn)\n this._stack.push(fn)\n }, this)\n}\n\n/**\n * Adds a single function after a function that already exists in the\n * pipeline.\n *\n * Logs a warning if the function has not been registered.\n *\n * @param {lunr.PipelineFunction} existingFn - A function that already exists in the pipeline.\n * @param {lunr.PipelineFunction} newFn - The new function to add to the pipeline.\n */\nlunr.Pipeline.prototype.after = function (existingFn, newFn) {\n lunr.Pipeline.warnIfFunctionNotRegistered(newFn)\n\n var pos = this._stack.indexOf(existingFn)\n if (pos == -1) {\n throw new Error('Cannot find existingFn')\n }\n\n pos = pos + 1\n this._stack.splice(pos, 0, newFn)\n}\n\n/**\n * Adds a single function before a function that already exists in the\n * pipeline.\n *\n * Logs a warning if the function has not been registered.\n *\n * @param {lunr.PipelineFunction} existingFn - A function that already exists in the pipeline.\n * @param {lunr.PipelineFunction} newFn - The new function to add to the pipeline.\n */\nlunr.Pipeline.prototype.before = function (existingFn, newFn) {\n lunr.Pipeline.warnIfFunctionNotRegistered(newFn)\n\n var pos = this._stack.indexOf(existingFn)\n if (pos == -1) {\n throw new Error('Cannot find existingFn')\n }\n\n this._stack.splice(pos, 0, newFn)\n}\n\n/**\n * Removes a function from the pipeline.\n *\n * @param {lunr.PipelineFunction} fn The function to remove from the pipeline.\n */\nlunr.Pipeline.prototype.remove = function (fn) {\n var pos = this._stack.indexOf(fn)\n if (pos == -1) {\n return\n }\n\n this._stack.splice(pos, 1)\n}\n\n/**\n * Runs the current list of functions that make up the pipeline against the\n * passed tokens.\n *\n * @param {Array} tokens The tokens to run through the pipeline.\n * @returns {Array}\n */\nlunr.Pipeline.prototype.run = function (tokens) {\n var stackLength = this._stack.length\n\n for (var i = 0; i < stackLength; i++) {\n var fn = this._stack[i]\n var memo = []\n\n for (var j = 0; j < tokens.length; j++) {\n var result = fn(tokens[j], j, tokens)\n\n if (result === null || result === void 0 || result === '') continue\n\n if (Array.isArray(result)) {\n for (var k = 0; k < result.length; k++) {\n memo.push(result[k])\n }\n } else {\n memo.push(result)\n }\n }\n\n tokens = memo\n }\n\n return tokens\n}\n\n/**\n * Convenience method for passing a string through a pipeline and getting\n * strings out. This method takes care of wrapping the passed string in a\n * token and mapping the resulting tokens back to strings.\n *\n * @param {string} str - The string to pass through the pipeline.\n * @param {?object} metadata - Optional metadata to associate with the token\n * passed to the pipeline.\n * @returns {string[]}\n */\nlunr.Pipeline.prototype.runString = function (str, metadata) {\n var token = new lunr.Token (str, metadata)\n\n return this.run([token]).map(function (t) {\n return t.toString()\n })\n}\n\n/**\n * Resets the pipeline by removing any existing processors.\n *\n */\nlunr.Pipeline.prototype.reset = function () {\n this._stack = []\n}\n\n/**\n * Returns a representation of the pipeline ready for serialisation.\n *\n * Logs a warning if the function has not been registered.\n *\n * @returns {Array}\n */\nlunr.Pipeline.prototype.toJSON = function () {\n return this._stack.map(function (fn) {\n lunr.Pipeline.warnIfFunctionNotRegistered(fn)\n\n return fn.label\n })\n}\n/*!\n * lunr.Vector\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * A vector is used to construct the vector space of documents and queries. These\n * vectors support operations to determine the similarity between two documents or\n * a document and a query.\n *\n * Normally no parameters are required for initializing a vector, but in the case of\n * loading a previously dumped vector the raw elements can be provided to the constructor.\n *\n * For performance reasons vectors are implemented with a flat array, where an elements\n * index is immediately followed by its value. E.g. [index, value, index, value]. This\n * allows the underlying array to be as sparse as possible and still offer decent\n * performance when being used for vector calculations.\n *\n * @constructor\n * @param {Number[]} [elements] - The flat list of element index and element value pairs.\n */\nlunr.Vector = function (elements) {\n this._magnitude = 0\n this.elements = elements || []\n}\n\n\n/**\n * Calculates the position within the vector to insert a given index.\n *\n * This is used internally by insert and upsert. If there are duplicate indexes then\n * the position is returned as if the value for that index were to be updated, but it\n * is the callers responsibility to check whether there is a duplicate at that index\n *\n * @param {Number} insertIdx - The index at which the element should be inserted.\n * @returns {Number}\n */\nlunr.Vector.prototype.positionForIndex = function (index) {\n // For an empty vector the tuple can be inserted at the beginning\n if (this.elements.length == 0) {\n return 0\n }\n\n var start = 0,\n end = this.elements.length / 2,\n sliceLength = end - start,\n pivotPoint = Math.floor(sliceLength / 2),\n pivotIndex = this.elements[pivotPoint * 2]\n\n while (sliceLength > 1) {\n if (pivotIndex < index) {\n start = pivotPoint\n }\n\n if (pivotIndex > index) {\n end = pivotPoint\n }\n\n if (pivotIndex == index) {\n break\n }\n\n sliceLength = end - start\n pivotPoint = start + Math.floor(sliceLength / 2)\n pivotIndex = this.elements[pivotPoint * 2]\n }\n\n if (pivotIndex == index) {\n return pivotPoint * 2\n }\n\n if (pivotIndex > index) {\n return pivotPoint * 2\n }\n\n if (pivotIndex < index) {\n return (pivotPoint + 1) * 2\n }\n}\n\n/**\n * Inserts an element at an index within the vector.\n *\n * Does not allow duplicates, will throw an error if there is already an entry\n * for this index.\n *\n * @param {Number} insertIdx - The index at which the element should be inserted.\n * @param {Number} val - The value to be inserted into the vector.\n */\nlunr.Vector.prototype.insert = function (insertIdx, val) {\n this.upsert(insertIdx, val, function () {\n throw \"duplicate index\"\n })\n}\n\n/**\n * Inserts or updates an existing index within the vector.\n *\n * @param {Number} insertIdx - The index at which the element should be inserted.\n * @param {Number} val - The value to be inserted into the vector.\n * @param {function} fn - A function that is called for updates, the existing value and the\n * requested value are passed as arguments\n */\nlunr.Vector.prototype.upsert = function (insertIdx, val, fn) {\n this._magnitude = 0\n var position = this.positionForIndex(insertIdx)\n\n if (this.elements[position] == insertIdx) {\n this.elements[position + 1] = fn(this.elements[position + 1], val)\n } else {\n this.elements.splice(position, 0, insertIdx, val)\n }\n}\n\n/**\n * Calculates the magnitude of this vector.\n *\n * @returns {Number}\n */\nlunr.Vector.prototype.magnitude = function () {\n if (this._magnitude) return this._magnitude\n\n var sumOfSquares = 0,\n elementsLength = this.elements.length\n\n for (var i = 1; i < elementsLength; i += 2) {\n var val = this.elements[i]\n sumOfSquares += val * val\n }\n\n return this._magnitude = Math.sqrt(sumOfSquares)\n}\n\n/**\n * Calculates the dot product of this vector and another vector.\n *\n * @param {lunr.Vector} otherVector - The vector to compute the dot product with.\n * @returns {Number}\n */\nlunr.Vector.prototype.dot = function (otherVector) {\n var dotProduct = 0,\n a = this.elements, b = otherVector.elements,\n aLen = a.length, bLen = b.length,\n aVal = 0, bVal = 0,\n i = 0, j = 0\n\n while (i < aLen && j < bLen) {\n aVal = a[i], bVal = b[j]\n if (aVal < bVal) {\n i += 2\n } else if (aVal > bVal) {\n j += 2\n } else if (aVal == bVal) {\n dotProduct += a[i + 1] * b[j + 1]\n i += 2\n j += 2\n }\n }\n\n return dotProduct\n}\n\n/**\n * Calculates the similarity between this vector and another vector.\n *\n * @param {lunr.Vector} otherVector - The other vector to calculate the\n * similarity with.\n * @returns {Number}\n */\nlunr.Vector.prototype.similarity = function (otherVector) {\n return this.dot(otherVector) / this.magnitude() || 0\n}\n\n/**\n * Converts the vector to an array of the elements within the vector.\n *\n * @returns {Number[]}\n */\nlunr.Vector.prototype.toArray = function () {\n var output = new Array (this.elements.length / 2)\n\n for (var i = 1, j = 0; i < this.elements.length; i += 2, j++) {\n output[j] = this.elements[i]\n }\n\n return output\n}\n\n/**\n * A JSON serializable representation of the vector.\n *\n * @returns {Number[]}\n */\nlunr.Vector.prototype.toJSON = function () {\n return this.elements\n}\n/* eslint-disable */\n/*!\n * lunr.stemmer\n * Copyright (C) 2020 Oliver Nightingale\n * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt\n */\n\n/**\n * lunr.stemmer is an english language stemmer, this is a JavaScript\n * implementation of the PorterStemmer taken from http://tartarus.org/~martin\n *\n * @static\n * @implements {lunr.PipelineFunction}\n * @param {lunr.Token} token - The string to stem\n * @returns {lunr.Token}\n * @see {@link lunr.Pipeline}\n * @function\n */\nlunr.stemmer = (function(){\n var step2list = {\n \"ational\" : \"ate\",\n \"tional\" : \"tion\",\n \"enci\" : \"ence\",\n \"anci\" : \"ance\",\n \"izer\" : \"ize\",\n \"bli\" : \"ble\",\n \"alli\" : \"al\",\n \"entli\" : \"ent\",\n \"eli\" : \"e\",\n \"ousli\" : \"ous\",\n \"ization\" : \"ize\",\n \"ation\" : \"ate\",\n \"ator\" : \"ate\",\n \"alism\" : \"al\",\n \"iveness\" : \"ive\",\n \"fulness\" : \"ful\",\n \"ousness\" : \"ous\",\n \"aliti\" : \"al\",\n \"iviti\" : \"ive\",\n \"biliti\" : \"ble\",\n \"logi\" : \"log\"\n },\n\n step3list = {\n \"icate\" : \"ic\",\n \"ative\" : \"\",\n \"alize\" : \"al\",\n \"iciti\" : \"ic\",\n \"ical\" : \"ic\",\n \"ful\" : \"\",\n \"ness\" : \"\"\n },\n\n c = \"[^aeiou]\", // consonant\n v = \"[aeiouy]\", // vowel\n C = c + \"[^aeiouy]*\", // consonant sequence\n V = v + \"[aeiou]*\", // vowel sequence\n\n mgr0 = \"^(\" + C + \")?\" + V + C, // [C]VC... is m>0\n meq1 = \"^(\" + C + \")?\" + V + C + \"(\" + V + \")?$\", // [C]VC[V] is m=1\n mgr1 = \"^(\" + C + \")?\" + V + C + V + C, // [C]VCVC... is m>1\n s_v = \"^(\" + C + \")?\" + v; // vowel in stem\n\n var re_mgr0 = new RegExp(mgr0);\n var re_mgr1 = new RegExp(mgr1);\n var re_meq1 = new RegExp(meq1);\n var re_s_v = new RegExp(s_v);\n\n var re_1a = /^(.+?)(ss|i)es$/;\n var re2_1a = /^(.+?)([^s])s$/;\n var re_1b = /^(.+?)eed$/;\n var re2_1b = /^(.+?)(ed|ing)$/;\n var re_1b_2 = /.$/;\n var re2_1b_2 = /(at|bl|iz)$/;\n var re3_1b_2 = new RegExp(\"([^aeiouylsz])\\\\1$\");\n var re4_1b_2 = new RegExp(\"^\" + C + v + \"[^aeiouwxy]$\");\n\n var re_1c = /^(.+?[^aeiou])y$/;\n var re_2 = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;\n\n var re_3 = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;\n\n var re_4 = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;\n var re2_4 = /^(.+?)(s|t)(ion)$/;\n\n var re_5 = /^(.+?)e$/;\n var re_5_1 = /ll$/;\n var re3_5 = new RegExp(\"^\" + C + v + \"[^aeiouwxy]$\");\n\n var porterStemmer = function porterStemmer(w) {\n var stem,\n suffix,\n firstch,\n re,\n re2,\n re3,\n re4;\n\n if (w.length < 3) { return w; }\n\n firstch = w.substr(0,1);\n if (firstch == \"y\") {\n w = firstch.toUpperCase() + w.substr(1);\n }\n\n // Step 1a\n re = re_1a\n re2 = re2_1a;\n\n if (re.test(w)) { w = w.replace(re,\"$1$2\"); }\n else if (re2.test(w)) { w = w.replace(re2,\"$1$2\"); }\n\n // Step 1b\n re = re_1b;\n re2 = re2_1b;\n if (re.test(w)) {\n var fp = re.exec(w);\n re = re_mgr0;\n if (re.test(fp[1])) {\n re = re_1b_2;\n w = w.replace(re,\"\");\n }\n } else if (re2.test(w)) {\n var fp = re2.exec(w);\n stem = fp[1];\n re2 = re_s_v;\n if (re2.test(stem)) {\n w = stem;\n re2 = re2_1b_2;\n re3 = re3_1b_2;\n re4 = re4_1b_2;\n if (re2.test(w)) { w = w + \"e\"; }\n else if (re3.test(w)) { re = re_1b_2; w = w.replace(re,\"\"); }\n else if (re4.test(w)) { w = w + \"e\"; }\n }\n }\n\n // 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)\n re = re_1c;\n if (re.test(w)) {\n var fp = re.exec(w);\n stem = fp[1];\n w = stem + \"i\";\n }\n\n // Step 2\n re = re_2;\n if (re.test(w)) {\n var fp = re.exec(w);\n stem = fp[1];\n suffix = fp[2];\n re = re_mgr0;\n if (re.test(stem)) {\n w = stem + step2list[suffix];\n }\n }\n\n // Step 3\n re = re_3;\n if (re.test(w)) {\n var fp = re.exec(w);\n stem = fp[1];\n suffix = fp[2];\n re = re_mgr0;\n if (re.test(stem)) {\n w = stem + step3list[suffix];\n }\n }\n\n // Step 4\n re = re_4;\n re2 = re2_4;\n if (re.test(w)) {\n var fp = re.exec(w);\n stem = fp[1];\n re = re_mgr1;\n if (re.test(stem)) {\n w = stem;\n }\n } else if (re2.test(w)) {\n var fp = re2.exec(w);\n stem = fp[1] + fp[2];\n re2 = re_mgr1;\n if (re2.test(stem)) {\n w = stem;\n }\n }\n\n // Step 5\n re = re_5;\n if (re.test(w)) {\n var fp = re.exec(w);\n stem = fp[1];\n re = re_mgr1;\n re2 = re_meq1;\n re3 = re3_5;\n if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) {\n w = stem;\n }\n }\n\n re = re_5_1;\n re2 = re_mgr1;\n if (re.test(w) && re2.test(w)) {\n re = re_1b_2;\n w = w.replace(re,\"\");\n }\n\n // and turn initial Y back to y\n\n if (firstch == \"y\") {\n w = firstch.toLowerCase() + w.substr(1);\n }\n\n return w;\n };\n\n return function (token) {\n return token.update(porterStemmer);\n }\n})();\n\nlunr.Pipeline.registerFunction(lunr.stemmer, 'stemmer')\n/*!\n * lunr.stopWordFilter\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * lunr.generateStopWordFilter builds a stopWordFilter function from the provided\n * list of stop words.\n *\n * The built in lunr.stopWordFilter is built using this generator and can be used\n * to generate custom stopWordFilters for applications or non English languages.\n *\n * @function\n * @param {Array} token The token to pass through the filter\n * @returns {lunr.PipelineFunction}\n * @see lunr.Pipeline\n * @see lunr.stopWordFilter\n */\nlunr.generateStopWordFilter = function (stopWords) {\n var words = stopWords.reduce(function (memo, stopWord) {\n memo[stopWord] = stopWord\n return memo\n }, {})\n\n return function (token) {\n if (token && words[token.toString()] !== token.toString()) return token\n }\n}\n\n/**\n * lunr.stopWordFilter is an English language stop word list filter, any words\n * contained in the list will not be passed through the filter.\n *\n * This is intended to be used in the Pipeline. If the token does not pass the\n * filter then undefined will be returned.\n *\n * @function\n * @implements {lunr.PipelineFunction}\n * @params {lunr.Token} token - A token to check for being a stop word.\n * @returns {lunr.Token}\n * @see {@link lunr.Pipeline}\n */\nlunr.stopWordFilter = lunr.generateStopWordFilter([\n 'a',\n 'able',\n 'about',\n 'across',\n 'after',\n 'all',\n 'almost',\n 'also',\n 'am',\n 'among',\n 'an',\n 'and',\n 'any',\n 'are',\n 'as',\n 'at',\n 'be',\n 'because',\n 'been',\n 'but',\n 'by',\n 'can',\n 'cannot',\n 'could',\n 'dear',\n 'did',\n 'do',\n 'does',\n 'either',\n 'else',\n 'ever',\n 'every',\n 'for',\n 'from',\n 'get',\n 'got',\n 'had',\n 'has',\n 'have',\n 'he',\n 'her',\n 'hers',\n 'him',\n 'his',\n 'how',\n 'however',\n 'i',\n 'if',\n 'in',\n 'into',\n 'is',\n 'it',\n 'its',\n 'just',\n 'least',\n 'let',\n 'like',\n 'likely',\n 'may',\n 'me',\n 'might',\n 'most',\n 'must',\n 'my',\n 'neither',\n 'no',\n 'nor',\n 'not',\n 'of',\n 'off',\n 'often',\n 'on',\n 'only',\n 'or',\n 'other',\n 'our',\n 'own',\n 'rather',\n 'said',\n 'say',\n 'says',\n 'she',\n 'should',\n 'since',\n 'so',\n 'some',\n 'than',\n 'that',\n 'the',\n 'their',\n 'them',\n 'then',\n 'there',\n 'these',\n 'they',\n 'this',\n 'tis',\n 'to',\n 'too',\n 'twas',\n 'us',\n 'wants',\n 'was',\n 'we',\n 'were',\n 'what',\n 'when',\n 'where',\n 'which',\n 'while',\n 'who',\n 'whom',\n 'why',\n 'will',\n 'with',\n 'would',\n 'yet',\n 'you',\n 'your'\n])\n\nlunr.Pipeline.registerFunction(lunr.stopWordFilter, 'stopWordFilter')\n/*!\n * lunr.trimmer\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * lunr.trimmer is a pipeline function for trimming non word\n * characters from the beginning and end of tokens before they\n * enter the index.\n *\n * This implementation may not work correctly for non latin\n * characters and should either be removed or adapted for use\n * with languages with non-latin characters.\n *\n * @static\n * @implements {lunr.PipelineFunction}\n * @param {lunr.Token} token The token to pass through the filter\n * @returns {lunr.Token}\n * @see lunr.Pipeline\n */\nlunr.trimmer = function (token) {\n return token.update(function (s) {\n return s.replace(/^\\W+/, '').replace(/\\W+$/, '')\n })\n}\n\nlunr.Pipeline.registerFunction(lunr.trimmer, 'trimmer')\n/*!\n * lunr.TokenSet\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * A token set is used to store the unique list of all tokens\n * within an index. Token sets are also used to represent an\n * incoming query to the index, this query token set and index\n * token set are then intersected to find which tokens to look\n * up in the inverted index.\n *\n * A token set can hold multiple tokens, as in the case of the\n * index token set, or it can hold a single token as in the\n * case of a simple query token set.\n *\n * Additionally token sets are used to perform wildcard matching.\n * Leading, contained and trailing wildcards are supported, and\n * from this edit distance matching can also be provided.\n *\n * Token sets are implemented as a minimal finite state automata,\n * where both common prefixes and suffixes are shared between tokens.\n * This helps to reduce the space used for storing the token set.\n *\n * @constructor\n */\nlunr.TokenSet = function () {\n this.final = false\n this.edges = {}\n this.id = lunr.TokenSet._nextId\n lunr.TokenSet._nextId += 1\n}\n\n/**\n * Keeps track of the next, auto increment, identifier to assign\n * to a new tokenSet.\n *\n * TokenSets require a unique identifier to be correctly minimised.\n *\n * @private\n */\nlunr.TokenSet._nextId = 1\n\n/**\n * Creates a TokenSet instance from the given sorted array of words.\n *\n * @param {String[]} arr - A sorted array of strings to create the set from.\n * @returns {lunr.TokenSet}\n * @throws Will throw an error if the input array is not sorted.\n */\nlunr.TokenSet.fromArray = function (arr) {\n var builder = new lunr.TokenSet.Builder\n\n for (var i = 0, len = arr.length; i < len; i++) {\n builder.insert(arr[i])\n }\n\n builder.finish()\n return builder.root\n}\n\n/**\n * Creates a token set from a query clause.\n *\n * @private\n * @param {Object} clause - A single clause from lunr.Query.\n * @param {string} clause.term - The query clause term.\n * @param {number} [clause.editDistance] - The optional edit distance for the term.\n * @returns {lunr.TokenSet}\n */\nlunr.TokenSet.fromClause = function (clause) {\n if ('editDistance' in clause) {\n return lunr.TokenSet.fromFuzzyString(clause.term, clause.editDistance)\n } else {\n return lunr.TokenSet.fromString(clause.term)\n }\n}\n\n/**\n * Creates a token set representing a single string with a specified\n * edit distance.\n *\n * Insertions, deletions, substitutions and transpositions are each\n * treated as an edit distance of 1.\n *\n * Increasing the allowed edit distance will have a dramatic impact\n * on the performance of both creating and intersecting these TokenSets.\n * It is advised to keep the edit distance less than 3.\n *\n * @param {string} str - The string to create the token set from.\n * @param {number} editDistance - The allowed edit distance to match.\n * @returns {lunr.Vector}\n */\nlunr.TokenSet.fromFuzzyString = function (str, editDistance) {\n var root = new lunr.TokenSet\n\n var stack = [{\n node: root,\n editsRemaining: editDistance,\n str: str\n }]\n\n while (stack.length) {\n var frame = stack.pop()\n\n // no edit\n if (frame.str.length > 0) {\n var char = frame.str.charAt(0),\n noEditNode\n\n if (char in frame.node.edges) {\n noEditNode = frame.node.edges[char]\n } else {\n noEditNode = new lunr.TokenSet\n frame.node.edges[char] = noEditNode\n }\n\n if (frame.str.length == 1) {\n noEditNode.final = true\n }\n\n stack.push({\n node: noEditNode,\n editsRemaining: frame.editsRemaining,\n str: frame.str.slice(1)\n })\n }\n\n if (frame.editsRemaining == 0) {\n continue\n }\n\n // insertion\n if (\"*\" in frame.node.edges) {\n var insertionNode = frame.node.edges[\"*\"]\n } else {\n var insertionNode = new lunr.TokenSet\n frame.node.edges[\"*\"] = insertionNode\n }\n\n if (frame.str.length == 0) {\n insertionNode.final = true\n }\n\n stack.push({\n node: insertionNode,\n editsRemaining: frame.editsRemaining - 1,\n str: frame.str\n })\n\n // deletion\n // can only do a deletion if we have enough edits remaining\n // and if there are characters left to delete in the string\n if (frame.str.length > 1) {\n stack.push({\n node: frame.node,\n editsRemaining: frame.editsRemaining - 1,\n str: frame.str.slice(1)\n })\n }\n\n // deletion\n // just removing the last character from the str\n if (frame.str.length == 1) {\n frame.node.final = true\n }\n\n // substitution\n // can only do a substitution if we have enough edits remaining\n // and if there are characters left to substitute\n if (frame.str.length >= 1) {\n if (\"*\" in frame.node.edges) {\n var substitutionNode = frame.node.edges[\"*\"]\n } else {\n var substitutionNode = new lunr.TokenSet\n frame.node.edges[\"*\"] = substitutionNode\n }\n\n if (frame.str.length == 1) {\n substitutionNode.final = true\n }\n\n stack.push({\n node: substitutionNode,\n editsRemaining: frame.editsRemaining - 1,\n str: frame.str.slice(1)\n })\n }\n\n // transposition\n // can only do a transposition if there are edits remaining\n // and there are enough characters to transpose\n if (frame.str.length > 1) {\n var charA = frame.str.charAt(0),\n charB = frame.str.charAt(1),\n transposeNode\n\n if (charB in frame.node.edges) {\n transposeNode = frame.node.edges[charB]\n } else {\n transposeNode = new lunr.TokenSet\n frame.node.edges[charB] = transposeNode\n }\n\n if (frame.str.length == 1) {\n transposeNode.final = true\n }\n\n stack.push({\n node: transposeNode,\n editsRemaining: frame.editsRemaining - 1,\n str: charA + frame.str.slice(2)\n })\n }\n }\n\n return root\n}\n\n/**\n * Creates a TokenSet from a string.\n *\n * The string may contain one or more wildcard characters (*)\n * that will allow wildcard matching when intersecting with\n * another TokenSet.\n *\n * @param {string} str - The string to create a TokenSet from.\n * @returns {lunr.TokenSet}\n */\nlunr.TokenSet.fromString = function (str) {\n var node = new lunr.TokenSet,\n root = node\n\n /*\n * Iterates through all characters within the passed string\n * appending a node for each character.\n *\n * When a wildcard character is found then a self\n * referencing edge is introduced to continually match\n * any number of any characters.\n */\n for (var i = 0, len = str.length; i < len; i++) {\n var char = str[i],\n final = (i == len - 1)\n\n if (char == \"*\") {\n node.edges[char] = node\n node.final = final\n\n } else {\n var next = new lunr.TokenSet\n next.final = final\n\n node.edges[char] = next\n node = next\n }\n }\n\n return root\n}\n\n/**\n * Converts this TokenSet into an array of strings\n * contained within the TokenSet.\n *\n * This is not intended to be used on a TokenSet that\n * contains wildcards, in these cases the results are\n * undefined and are likely to cause an infinite loop.\n *\n * @returns {string[]}\n */\nlunr.TokenSet.prototype.toArray = function () {\n var words = []\n\n var stack = [{\n prefix: \"\",\n node: this\n }]\n\n while (stack.length) {\n var frame = stack.pop(),\n edges = Object.keys(frame.node.edges),\n len = edges.length\n\n if (frame.node.final) {\n /* In Safari, at this point the prefix is sometimes corrupted, see:\n * https://github.com/olivernn/lunr.js/issues/279 Calling any\n * String.prototype method forces Safari to \"cast\" this string to what\n * it's supposed to be, fixing the bug. */\n frame.prefix.charAt(0)\n words.push(frame.prefix)\n }\n\n for (var i = 0; i < len; i++) {\n var edge = edges[i]\n\n stack.push({\n prefix: frame.prefix.concat(edge),\n node: frame.node.edges[edge]\n })\n }\n }\n\n return words\n}\n\n/**\n * Generates a string representation of a TokenSet.\n *\n * This is intended to allow TokenSets to be used as keys\n * in objects, largely to aid the construction and minimisation\n * of a TokenSet. As such it is not designed to be a human\n * friendly representation of the TokenSet.\n *\n * @returns {string}\n */\nlunr.TokenSet.prototype.toString = function () {\n // NOTE: Using Object.keys here as this.edges is very likely\n // to enter 'hash-mode' with many keys being added\n //\n // avoiding a for-in loop here as it leads to the function\n // being de-optimised (at least in V8). From some simple\n // benchmarks the performance is comparable, but allowing\n // V8 to optimize may mean easy performance wins in the future.\n\n if (this._str) {\n return this._str\n }\n\n var str = this.final ? '1' : '0',\n labels = Object.keys(this.edges).sort(),\n len = labels.length\n\n for (var i = 0; i < len; i++) {\n var label = labels[i],\n node = this.edges[label]\n\n str = str + label + node.id\n }\n\n return str\n}\n\n/**\n * Returns a new TokenSet that is the intersection of\n * this TokenSet and the passed TokenSet.\n *\n * This intersection will take into account any wildcards\n * contained within the TokenSet.\n *\n * @param {lunr.TokenSet} b - An other TokenSet to intersect with.\n * @returns {lunr.TokenSet}\n */\nlunr.TokenSet.prototype.intersect = function (b) {\n var output = new lunr.TokenSet,\n frame = undefined\n\n var stack = [{\n qNode: b,\n output: output,\n node: this\n }]\n\n while (stack.length) {\n frame = stack.pop()\n\n // NOTE: As with the #toString method, we are using\n // Object.keys and a for loop instead of a for-in loop\n // as both of these objects enter 'hash' mode, causing\n // the function to be de-optimised in V8\n var qEdges = Object.keys(frame.qNode.edges),\n qLen = qEdges.length,\n nEdges = Object.keys(frame.node.edges),\n nLen = nEdges.length\n\n for (var q = 0; q < qLen; q++) {\n var qEdge = qEdges[q]\n\n for (var n = 0; n < nLen; n++) {\n var nEdge = nEdges[n]\n\n if (nEdge == qEdge || qEdge == '*') {\n var node = frame.node.edges[nEdge],\n qNode = frame.qNode.edges[qEdge],\n final = node.final && qNode.final,\n next = undefined\n\n if (nEdge in frame.output.edges) {\n // an edge already exists for this character\n // no need to create a new node, just set the finality\n // bit unless this node is already final\n next = frame.output.edges[nEdge]\n next.final = next.final || final\n\n } else {\n // no edge exists yet, must create one\n // set the finality bit and insert it\n // into the output\n next = new lunr.TokenSet\n next.final = final\n frame.output.edges[nEdge] = next\n }\n\n stack.push({\n qNode: qNode,\n output: next,\n node: node\n })\n }\n }\n }\n }\n\n return output\n}\nlunr.TokenSet.Builder = function () {\n this.previousWord = \"\"\n this.root = new lunr.TokenSet\n this.uncheckedNodes = []\n this.minimizedNodes = {}\n}\n\nlunr.TokenSet.Builder.prototype.insert = function (word) {\n var node,\n commonPrefix = 0\n\n if (word < this.previousWord) {\n throw new Error (\"Out of order word insertion\")\n }\n\n for (var i = 0; i < word.length && i < this.previousWord.length; i++) {\n if (word[i] != this.previousWord[i]) break\n commonPrefix++\n }\n\n this.minimize(commonPrefix)\n\n if (this.uncheckedNodes.length == 0) {\n node = this.root\n } else {\n node = this.uncheckedNodes[this.uncheckedNodes.length - 1].child\n }\n\n for (var i = commonPrefix; i < word.length; i++) {\n var nextNode = new lunr.TokenSet,\n char = word[i]\n\n node.edges[char] = nextNode\n\n this.uncheckedNodes.push({\n parent: node,\n char: char,\n child: nextNode\n })\n\n node = nextNode\n }\n\n node.final = true\n this.previousWord = word\n}\n\nlunr.TokenSet.Builder.prototype.finish = function () {\n this.minimize(0)\n}\n\nlunr.TokenSet.Builder.prototype.minimize = function (downTo) {\n for (var i = this.uncheckedNodes.length - 1; i >= downTo; i--) {\n var node = this.uncheckedNodes[i],\n childKey = node.child.toString()\n\n if (childKey in this.minimizedNodes) {\n node.parent.edges[node.char] = this.minimizedNodes[childKey]\n } else {\n // Cache the key for this node since\n // we know it can't change anymore\n node.child._str = childKey\n\n this.minimizedNodes[childKey] = node.child\n }\n\n this.uncheckedNodes.pop()\n }\n}\n/*!\n * lunr.Index\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * An index contains the built index of all documents and provides a query interface\n * to the index.\n *\n * Usually instances of lunr.Index will not be created using this constructor, instead\n * lunr.Builder should be used to construct new indexes, or lunr.Index.load should be\n * used to load previously built and serialized indexes.\n *\n * @constructor\n * @param {Object} attrs - The attributes of the built search index.\n * @param {Object} attrs.invertedIndex - An index of term/field to document reference.\n * @param {Object} attrs.fieldVectors - Field vectors\n * @param {lunr.TokenSet} attrs.tokenSet - An set of all corpus tokens.\n * @param {string[]} attrs.fields - The names of indexed document fields.\n * @param {lunr.Pipeline} attrs.pipeline - The pipeline to use for search terms.\n */\nlunr.Index = function (attrs) {\n this.invertedIndex = attrs.invertedIndex\n this.fieldVectors = attrs.fieldVectors\n this.tokenSet = attrs.tokenSet\n this.fields = attrs.fields\n this.pipeline = attrs.pipeline\n}\n\n/**\n * A result contains details of a document matching a search query.\n * @typedef {Object} lunr.Index~Result\n * @property {string} ref - The reference of the document this result represents.\n * @property {number} score - A number between 0 and 1 representing how similar this document is to the query.\n * @property {lunr.MatchData} matchData - Contains metadata about this match including which term(s) caused the match.\n */\n\n/**\n * Although lunr provides the ability to create queries using lunr.Query, it also provides a simple\n * query language which itself is parsed into an instance of lunr.Query.\n *\n * For programmatically building queries it is advised to directly use lunr.Query, the query language\n * is best used for human entered text rather than program generated text.\n *\n * At its simplest queries can just be a single term, e.g. `hello`, multiple terms are also supported\n * and will be combined with OR, e.g `hello world` will match documents that contain either 'hello'\n * or 'world', though those that contain both will rank higher in the results.\n *\n * Wildcards can be included in terms to match one or more unspecified characters, these wildcards can\n * be inserted anywhere within the term, and more than one wildcard can exist in a single term. Adding\n * wildcards will increase the number of documents that will be found but can also have a negative\n * impact on query performance, especially with wildcards at the beginning of a term.\n *\n * Terms can be restricted to specific fields, e.g. `title:hello`, only documents with the term\n * hello in the title field will match this query. Using a field not present in the index will lead\n * to an error being thrown.\n *\n * Modifiers can also be added to terms, lunr supports edit distance and boost modifiers on terms. A term\n * boost will make documents matching that term score higher, e.g. `foo^5`. Edit distance is also supported\n * to provide fuzzy matching, e.g. 'hello~2' will match documents with hello with an edit distance of 2.\n * Avoid large values for edit distance to improve query performance.\n *\n * Each term also supports a presence modifier. By default a term's presence in document is optional, however\n * this can be changed to either required or prohibited. For a term's presence to be required in a document the\n * term should be prefixed with a '+', e.g. `+foo bar` is a search for documents that must contain 'foo' and\n * optionally contain 'bar'. Conversely a leading '-' sets the terms presence to prohibited, i.e. it must not\n * appear in a document, e.g. `-foo bar` is a search for documents that do not contain 'foo' but may contain 'bar'.\n *\n * To escape special characters the backslash character '\\' can be used, this allows searches to include\n * characters that would normally be considered modifiers, e.g. `foo\\~2` will search for a term \"foo~2\" instead\n * of attempting to apply a boost of 2 to the search term \"foo\".\n *\n * @typedef {string} lunr.Index~QueryString\n * @example Simple single term query\n * hello\n * @example Multiple term query\n * hello world\n * @example term scoped to a field\n * title:hello\n * @example term with a boost of 10\n * hello^10\n * @example term with an edit distance of 2\n * hello~2\n * @example terms with presence modifiers\n * -foo +bar baz\n */\n\n/**\n * Performs a search against the index using lunr query syntax.\n *\n * Results will be returned sorted by their score, the most relevant results\n * will be returned first. For details on how the score is calculated, please see\n * the {@link https://lunrjs.com/guides/searching.html#scoring|guide}.\n *\n * For more programmatic querying use lunr.Index#query.\n *\n * @param {lunr.Index~QueryString} queryString - A string containing a lunr query.\n * @throws {lunr.QueryParseError} If the passed query string cannot be parsed.\n * @returns {lunr.Index~Result[]}\n */\nlunr.Index.prototype.search = function (queryString) {\n return this.query(function (query) {\n var parser = new lunr.QueryParser(queryString, query)\n parser.parse()\n })\n}\n\n/**\n * A query builder callback provides a query object to be used to express\n * the query to perform on the index.\n *\n * @callback lunr.Index~queryBuilder\n * @param {lunr.Query} query - The query object to build up.\n * @this lunr.Query\n */\n\n/**\n * Performs a query against the index using the yielded lunr.Query object.\n *\n * If performing programmatic queries against the index, this method is preferred\n * over lunr.Index#search so as to avoid the additional query parsing overhead.\n *\n * A query object is yielded to the supplied function which should be used to\n * express the query to be run against the index.\n *\n * Note that although this function takes a callback parameter it is _not_ an\n * asynchronous operation, the callback is just yielded a query object to be\n * customized.\n *\n * @param {lunr.Index~queryBuilder} fn - A function that is used to build the query.\n * @returns {lunr.Index~Result[]}\n */\nlunr.Index.prototype.query = function (fn) {\n // for each query clause\n // * process terms\n // * expand terms from token set\n // * find matching documents and metadata\n // * get document vectors\n // * score documents\n\n var query = new lunr.Query(this.fields),\n matchingFields = Object.create(null),\n queryVectors = Object.create(null),\n termFieldCache = Object.create(null),\n requiredMatches = Object.create(null),\n prohibitedMatches = Object.create(null)\n\n /*\n * To support field level boosts a query vector is created per\n * field. An empty vector is eagerly created to support negated\n * queries.\n */\n for (var i = 0; i < this.fields.length; i++) {\n queryVectors[this.fields[i]] = new lunr.Vector\n }\n\n fn.call(query, query)\n\n for (var i = 0; i < query.clauses.length; i++) {\n /*\n * Unless the pipeline has been disabled for this term, which is\n * the case for terms with wildcards, we need to pass the clause\n * term through the search pipeline. A pipeline returns an array\n * of processed terms. Pipeline functions may expand the passed\n * term, which means we may end up performing multiple index lookups\n * for a single query term.\n */\n var clause = query.clauses[i],\n terms = null,\n clauseMatches = lunr.Set.empty\n\n if (clause.usePipeline) {\n terms = this.pipeline.runString(clause.term, {\n fields: clause.fields\n })\n } else {\n terms = [clause.term]\n }\n\n for (var m = 0; m < terms.length; m++) {\n var term = terms[m]\n\n /*\n * Each term returned from the pipeline needs to use the same query\n * clause object, e.g. the same boost and or edit distance. The\n * simplest way to do this is to re-use the clause object but mutate\n * its term property.\n */\n clause.term = term\n\n /*\n * From the term in the clause we create a token set which will then\n * be used to intersect the indexes token set to get a list of terms\n * to lookup in the inverted index\n */\n var termTokenSet = lunr.TokenSet.fromClause(clause),\n expandedTerms = this.tokenSet.intersect(termTokenSet).toArray()\n\n /*\n * If a term marked as required does not exist in the tokenSet it is\n * impossible for the search to return any matches. We set all the field\n * scoped required matches set to empty and stop examining any further\n * clauses.\n */\n if (expandedTerms.length === 0 && clause.presence === lunr.Query.presence.REQUIRED) {\n for (var k = 0; k < clause.fields.length; k++) {\n var field = clause.fields[k]\n requiredMatches[field] = lunr.Set.empty\n }\n\n break\n }\n\n for (var j = 0; j < expandedTerms.length; j++) {\n /*\n * For each term get the posting and termIndex, this is required for\n * building the query vector.\n */\n var expandedTerm = expandedTerms[j],\n posting = this.invertedIndex[expandedTerm],\n termIndex = posting._index\n\n for (var k = 0; k < clause.fields.length; k++) {\n /*\n * For each field that this query term is scoped by (by default\n * all fields are in scope) we need to get all the document refs\n * that have this term in that field.\n *\n * The posting is the entry in the invertedIndex for the matching\n * term from above.\n */\n var field = clause.fields[k],\n fieldPosting = posting[field],\n matchingDocumentRefs = Object.keys(fieldPosting),\n termField = expandedTerm + \"/\" + field,\n matchingDocumentsSet = new lunr.Set(matchingDocumentRefs)\n\n /*\n * if the presence of this term is required ensure that the matching\n * documents are added to the set of required matches for this clause.\n *\n */\n if (clause.presence == lunr.Query.presence.REQUIRED) {\n clauseMatches = clauseMatches.union(matchingDocumentsSet)\n\n if (requiredMatches[field] === undefined) {\n requiredMatches[field] = lunr.Set.complete\n }\n }\n\n /*\n * if the presence of this term is prohibited ensure that the matching\n * documents are added to the set of prohibited matches for this field,\n * creating that set if it does not yet exist.\n */\n if (clause.presence == lunr.Query.presence.PROHIBITED) {\n if (prohibitedMatches[field] === undefined) {\n prohibitedMatches[field] = lunr.Set.empty\n }\n\n prohibitedMatches[field] = prohibitedMatches[field].union(matchingDocumentsSet)\n\n /*\n * Prohibited matches should not be part of the query vector used for\n * similarity scoring and no metadata should be extracted so we continue\n * to the next field\n */\n continue\n }\n\n /*\n * The query field vector is populated using the termIndex found for\n * the term and a unit value with the appropriate boost applied.\n * Using upsert because there could already be an entry in the vector\n * for the term we are working with. In that case we just add the scores\n * together.\n */\n queryVectors[field].upsert(termIndex, clause.boost, function (a, b) { return a + b })\n\n /**\n * If we've already seen this term, field combo then we've already collected\n * the matching documents and metadata, no need to go through all that again\n */\n if (termFieldCache[termField]) {\n continue\n }\n\n for (var l = 0; l < matchingDocumentRefs.length; l++) {\n /*\n * All metadata for this term/field/document triple\n * are then extracted and collected into an instance\n * of lunr.MatchData ready to be returned in the query\n * results\n */\n var matchingDocumentRef = matchingDocumentRefs[l],\n matchingFieldRef = new lunr.FieldRef (matchingDocumentRef, field),\n metadata = fieldPosting[matchingDocumentRef],\n fieldMatch\n\n if ((fieldMatch = matchingFields[matchingFieldRef]) === undefined) {\n matchingFields[matchingFieldRef] = new lunr.MatchData (expandedTerm, field, metadata)\n } else {\n fieldMatch.add(expandedTerm, field, metadata)\n }\n\n }\n\n termFieldCache[termField] = true\n }\n }\n }\n\n /**\n * If the presence was required we need to update the requiredMatches field sets.\n * We do this after all fields for the term have collected their matches because\n * the clause terms presence is required in _any_ of the fields not _all_ of the\n * fields.\n */\n if (clause.presence === lunr.Query.presence.REQUIRED) {\n for (var k = 0; k < clause.fields.length; k++) {\n var field = clause.fields[k]\n requiredMatches[field] = requiredMatches[field].intersect(clauseMatches)\n }\n }\n }\n\n /**\n * Need to combine the field scoped required and prohibited\n * matching documents into a global set of required and prohibited\n * matches\n */\n var allRequiredMatches = lunr.Set.complete,\n allProhibitedMatches = lunr.Set.empty\n\n for (var i = 0; i < this.fields.length; i++) {\n var field = this.fields[i]\n\n if (requiredMatches[field]) {\n allRequiredMatches = allRequiredMatches.intersect(requiredMatches[field])\n }\n\n if (prohibitedMatches[field]) {\n allProhibitedMatches = allProhibitedMatches.union(prohibitedMatches[field])\n }\n }\n\n var matchingFieldRefs = Object.keys(matchingFields),\n results = [],\n matches = Object.create(null)\n\n /*\n * If the query is negated (contains only prohibited terms)\n * we need to get _all_ fieldRefs currently existing in the\n * index. This is only done when we know that the query is\n * entirely prohibited terms to avoid any cost of getting all\n * fieldRefs unnecessarily.\n *\n * Additionally, blank MatchData must be created to correctly\n * populate the results.\n */\n if (query.isNegated()) {\n matchingFieldRefs = Object.keys(this.fieldVectors)\n\n for (var i = 0; i < matchingFieldRefs.length; i++) {\n var matchingFieldRef = matchingFieldRefs[i]\n var fieldRef = lunr.FieldRef.fromString(matchingFieldRef)\n matchingFields[matchingFieldRef] = new lunr.MatchData\n }\n }\n\n for (var i = 0; i < matchingFieldRefs.length; i++) {\n /*\n * Currently we have document fields that match the query, but we\n * need to return documents. The matchData and scores are combined\n * from multiple fields belonging to the same document.\n *\n * Scores are calculated by field, using the query vectors created\n * above, and combined into a final document score using addition.\n */\n var fieldRef = lunr.FieldRef.fromString(matchingFieldRefs[i]),\n docRef = fieldRef.docRef\n\n if (!allRequiredMatches.contains(docRef)) {\n continue\n }\n\n if (allProhibitedMatches.contains(docRef)) {\n continue\n }\n\n var fieldVector = this.fieldVectors[fieldRef],\n score = queryVectors[fieldRef.fieldName].similarity(fieldVector),\n docMatch\n\n if ((docMatch = matches[docRef]) !== undefined) {\n docMatch.score += score\n docMatch.matchData.combine(matchingFields[fieldRef])\n } else {\n var match = {\n ref: docRef,\n score: score,\n matchData: matchingFields[fieldRef]\n }\n matches[docRef] = match\n results.push(match)\n }\n }\n\n /*\n * Sort the results objects by score, highest first.\n */\n return results.sort(function (a, b) {\n return b.score - a.score\n })\n}\n\n/**\n * Prepares the index for JSON serialization.\n *\n * The schema for this JSON blob will be described in a\n * separate JSON schema file.\n *\n * @returns {Object}\n */\nlunr.Index.prototype.toJSON = function () {\n var invertedIndex = Object.keys(this.invertedIndex)\n .sort()\n .map(function (term) {\n return [term, this.invertedIndex[term]]\n }, this)\n\n var fieldVectors = Object.keys(this.fieldVectors)\n .map(function (ref) {\n return [ref, this.fieldVectors[ref].toJSON()]\n }, this)\n\n return {\n version: lunr.version,\n fields: this.fields,\n fieldVectors: fieldVectors,\n invertedIndex: invertedIndex,\n pipeline: this.pipeline.toJSON()\n }\n}\n\n/**\n * Loads a previously serialized lunr.Index\n *\n * @param {Object} serializedIndex - A previously serialized lunr.Index\n * @returns {lunr.Index}\n */\nlunr.Index.load = function (serializedIndex) {\n var attrs = {},\n fieldVectors = {},\n serializedVectors = serializedIndex.fieldVectors,\n invertedIndex = Object.create(null),\n serializedInvertedIndex = serializedIndex.invertedIndex,\n tokenSetBuilder = new lunr.TokenSet.Builder,\n pipeline = lunr.Pipeline.load(serializedIndex.pipeline)\n\n if (serializedIndex.version != lunr.version) {\n lunr.utils.warn(\"Version mismatch when loading serialised index. Current version of lunr '\" + lunr.version + \"' does not match serialized index '\" + serializedIndex.version + \"'\")\n }\n\n for (var i = 0; i < serializedVectors.length; i++) {\n var tuple = serializedVectors[i],\n ref = tuple[0],\n elements = tuple[1]\n\n fieldVectors[ref] = new lunr.Vector(elements)\n }\n\n for (var i = 0; i < serializedInvertedIndex.length; i++) {\n var tuple = serializedInvertedIndex[i],\n term = tuple[0],\n posting = tuple[1]\n\n tokenSetBuilder.insert(term)\n invertedIndex[term] = posting\n }\n\n tokenSetBuilder.finish()\n\n attrs.fields = serializedIndex.fields\n\n attrs.fieldVectors = fieldVectors\n attrs.invertedIndex = invertedIndex\n attrs.tokenSet = tokenSetBuilder.root\n attrs.pipeline = pipeline\n\n return new lunr.Index(attrs)\n}\n/*!\n * lunr.Builder\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * lunr.Builder performs indexing on a set of documents and\n * returns instances of lunr.Index ready for querying.\n *\n * All configuration of the index is done via the builder, the\n * fields to index, the document reference, the text processing\n * pipeline and document scoring parameters are all set on the\n * builder before indexing.\n *\n * @constructor\n * @property {string} _ref - Internal reference to the document reference field.\n * @property {string[]} _fields - Internal reference to the document fields to index.\n * @property {object} invertedIndex - The inverted index maps terms to document fields.\n * @property {object} documentTermFrequencies - Keeps track of document term frequencies.\n * @property {object} documentLengths - Keeps track of the length of documents added to the index.\n * @property {lunr.tokenizer} tokenizer - Function for splitting strings into tokens for indexing.\n * @property {lunr.Pipeline} pipeline - The pipeline performs text processing on tokens before indexing.\n * @property {lunr.Pipeline} searchPipeline - A pipeline for processing search terms before querying the index.\n * @property {number} documentCount - Keeps track of the total number of documents indexed.\n * @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.\n * @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.\n * @property {number} termIndex - A counter incremented for each unique term, used to identify a terms position in the vector space.\n * @property {array} metadataWhitelist - A list of metadata keys that have been whitelisted for entry in the index.\n */\nlunr.Builder = function () {\n this._ref = \"id\"\n this._fields = Object.create(null)\n this._documents = Object.create(null)\n this.invertedIndex = Object.create(null)\n this.fieldTermFrequencies = {}\n this.fieldLengths = {}\n this.tokenizer = lunr.tokenizer\n this.pipeline = new lunr.Pipeline\n this.searchPipeline = new lunr.Pipeline\n this.documentCount = 0\n this._b = 0.75\n this._k1 = 1.2\n this.termIndex = 0\n this.metadataWhitelist = []\n}\n\n/**\n * Sets the document field used as the document reference. Every document must have this field.\n * The type of this field in the document should be a string, if it is not a string it will be\n * coerced into a string by calling toString.\n *\n * The default ref is 'id'.\n *\n * The ref should _not_ be changed during indexing, it should be set before any documents are\n * added to the index. Changing it during indexing can lead to inconsistent results.\n *\n * @param {string} ref - The name of the reference field in the document.\n */\nlunr.Builder.prototype.ref = function (ref) {\n this._ref = ref\n}\n\n/**\n * A function that is used to extract a field from a document.\n *\n * Lunr expects a field to be at the top level of a document, if however the field\n * is deeply nested within a document an extractor function can be used to extract\n * the right field for indexing.\n *\n * @callback fieldExtractor\n * @param {object} doc - The document being added to the index.\n * @returns {?(string|object|object[])} obj - The object that will be indexed for this field.\n * @example Extracting a nested field\n * function (doc) { return doc.nested.field }\n */\n\n/**\n * Adds a field to the list of document fields that will be indexed. Every document being\n * indexed should have this field. Null values for this field in indexed documents will\n * not cause errors but will limit the chance of that document being retrieved by searches.\n *\n * All fields should be added before adding documents to the index. Adding fields after\n * a document has been indexed will have no effect on already indexed documents.\n *\n * Fields can be boosted at build time. This allows terms within that field to have more\n * importance when ranking search results. Use a field boost to specify that matches within\n * one field are more important than other fields.\n *\n * @param {string} fieldName - The name of a field to index in all documents.\n * @param {object} attributes - Optional attributes associated with this field.\n * @param {number} [attributes.boost=1] - Boost applied to all terms within this field.\n * @param {fieldExtractor} [attributes.extractor] - Function to extract a field from a document.\n * @throws {RangeError} fieldName cannot contain unsupported characters '/'\n */\nlunr.Builder.prototype.field = function (fieldName, attributes) {\n if (/\\//.test(fieldName)) {\n throw new RangeError (\"Field '\" + fieldName + \"' contains illegal character '/'\")\n }\n\n this._fields[fieldName] = attributes || {}\n}\n\n/**\n * A parameter to tune the amount of field length normalisation that is applied when\n * calculating relevance scores. A value of 0 will completely disable any normalisation\n * and a value of 1 will fully normalise field lengths. The default is 0.75. Values of b\n * will be clamped to the range 0 - 1.\n *\n * @param {number} number - The value to set for this tuning parameter.\n */\nlunr.Builder.prototype.b = function (number) {\n if (number < 0) {\n this._b = 0\n } else if (number > 1) {\n this._b = 1\n } else {\n this._b = number\n }\n}\n\n/**\n * A parameter that controls the speed at which a rise in term frequency results in term\n * frequency saturation. The default value is 1.2. Setting this to a higher value will give\n * slower saturation levels, a lower value will result in quicker saturation.\n *\n * @param {number} number - The value to set for this tuning parameter.\n */\nlunr.Builder.prototype.k1 = function (number) {\n this._k1 = number\n}\n\n/**\n * Adds a document to the index.\n *\n * Before adding fields to the index the index should have been fully setup, with the document\n * ref and all fields to index already having been specified.\n *\n * The document must have a field name as specified by the ref (by default this is 'id') and\n * it should have all fields defined for indexing, though null or undefined values will not\n * cause errors.\n *\n * Entire documents can be boosted at build time. Applying a boost to a document indicates that\n * this document should rank higher in search results than other documents.\n *\n * @param {object} doc - The document to add to the index.\n * @param {object} attributes - Optional attributes associated with this document.\n * @param {number} [attributes.boost=1] - Boost applied to all terms within this document.\n */\nlunr.Builder.prototype.add = function (doc, attributes) {\n var docRef = doc[this._ref],\n fields = Object.keys(this._fields)\n\n this._documents[docRef] = attributes || {}\n this.documentCount += 1\n\n for (var i = 0; i < fields.length; i++) {\n var fieldName = fields[i],\n extractor = this._fields[fieldName].extractor,\n field = extractor ? extractor(doc) : doc[fieldName],\n tokens = this.tokenizer(field, {\n fields: [fieldName]\n }),\n terms = this.pipeline.run(tokens),\n fieldRef = new lunr.FieldRef (docRef, fieldName),\n fieldTerms = Object.create(null)\n\n this.fieldTermFrequencies[fieldRef] = fieldTerms\n this.fieldLengths[fieldRef] = 0\n\n // store the length of this field for this document\n this.fieldLengths[fieldRef] += terms.length\n\n // calculate term frequencies for this field\n for (var j = 0; j < terms.length; j++) {\n var term = terms[j]\n\n if (fieldTerms[term] == undefined) {\n fieldTerms[term] = 0\n }\n\n fieldTerms[term] += 1\n\n // add to inverted index\n // create an initial posting if one doesn't exist\n if (this.invertedIndex[term] == undefined) {\n var posting = Object.create(null)\n posting[\"_index\"] = this.termIndex\n this.termIndex += 1\n\n for (var k = 0; k < fields.length; k++) {\n posting[fields[k]] = Object.create(null)\n }\n\n this.invertedIndex[term] = posting\n }\n\n // add an entry for this term/fieldName/docRef to the invertedIndex\n if (this.invertedIndex[term][fieldName][docRef] == undefined) {\n this.invertedIndex[term][fieldName][docRef] = Object.create(null)\n }\n\n // store all whitelisted metadata about this token in the\n // inverted index\n for (var l = 0; l < this.metadataWhitelist.length; l++) {\n var metadataKey = this.metadataWhitelist[l],\n metadata = term.metadata[metadataKey]\n\n if (this.invertedIndex[term][fieldName][docRef][metadataKey] == undefined) {\n this.invertedIndex[term][fieldName][docRef][metadataKey] = []\n }\n\n this.invertedIndex[term][fieldName][docRef][metadataKey].push(metadata)\n }\n }\n\n }\n}\n\n/**\n * Calculates the average document length for this index\n *\n * @private\n */\nlunr.Builder.prototype.calculateAverageFieldLengths = function () {\n\n var fieldRefs = Object.keys(this.fieldLengths),\n numberOfFields = fieldRefs.length,\n accumulator = {},\n documentsWithField = {}\n\n for (var i = 0; i < numberOfFields; i++) {\n var fieldRef = lunr.FieldRef.fromString(fieldRefs[i]),\n field = fieldRef.fieldName\n\n documentsWithField[field] || (documentsWithField[field] = 0)\n documentsWithField[field] += 1\n\n accumulator[field] || (accumulator[field] = 0)\n accumulator[field] += this.fieldLengths[fieldRef]\n }\n\n var fields = Object.keys(this._fields)\n\n for (var i = 0; i < fields.length; i++) {\n var fieldName = fields[i]\n accumulator[fieldName] = accumulator[fieldName] / documentsWithField[fieldName]\n }\n\n this.averageFieldLength = accumulator\n}\n\n/**\n * Builds a vector space model of every document using lunr.Vector\n *\n * @private\n */\nlunr.Builder.prototype.createFieldVectors = function () {\n var fieldVectors = {},\n fieldRefs = Object.keys(this.fieldTermFrequencies),\n fieldRefsLength = fieldRefs.length,\n termIdfCache = Object.create(null)\n\n for (var i = 0; i < fieldRefsLength; i++) {\n var fieldRef = lunr.FieldRef.fromString(fieldRefs[i]),\n fieldName = fieldRef.fieldName,\n fieldLength = this.fieldLengths[fieldRef],\n fieldVector = new lunr.Vector,\n termFrequencies = this.fieldTermFrequencies[fieldRef],\n terms = Object.keys(termFrequencies),\n termsLength = terms.length\n\n\n var fieldBoost = this._fields[fieldName].boost || 1,\n docBoost = this._documents[fieldRef.docRef].boost || 1\n\n for (var j = 0; j < termsLength; j++) {\n var term = terms[j],\n tf = termFrequencies[term],\n termIndex = this.invertedIndex[term]._index,\n idf, score, scoreWithPrecision\n\n if (termIdfCache[term] === undefined) {\n idf = lunr.idf(this.invertedIndex[term], this.documentCount)\n termIdfCache[term] = idf\n } else {\n idf = termIdfCache[term]\n }\n\n score = idf * ((this._k1 + 1) * tf) / (this._k1 * (1 - this._b + this._b * (fieldLength / this.averageFieldLength[fieldName])) + tf)\n score *= fieldBoost\n score *= docBoost\n scoreWithPrecision = Math.round(score * 1000) / 1000\n // Converts 1.23456789 to 1.234.\n // Reducing the precision so that the vectors take up less\n // space when serialised. Doing it now so that they behave\n // the same before and after serialisation. Also, this is\n // the fastest approach to reducing a number's precision in\n // JavaScript.\n\n fieldVector.insert(termIndex, scoreWithPrecision)\n }\n\n fieldVectors[fieldRef] = fieldVector\n }\n\n this.fieldVectors = fieldVectors\n}\n\n/**\n * Creates a token set of all tokens in the index using lunr.TokenSet\n *\n * @private\n */\nlunr.Builder.prototype.createTokenSet = function () {\n this.tokenSet = lunr.TokenSet.fromArray(\n Object.keys(this.invertedIndex).sort()\n )\n}\n\n/**\n * Builds the index, creating an instance of lunr.Index.\n *\n * This completes the indexing process and should only be called\n * once all documents have been added to the index.\n *\n * @returns {lunr.Index}\n */\nlunr.Builder.prototype.build = function () {\n this.calculateAverageFieldLengths()\n this.createFieldVectors()\n this.createTokenSet()\n\n return new lunr.Index({\n invertedIndex: this.invertedIndex,\n fieldVectors: this.fieldVectors,\n tokenSet: this.tokenSet,\n fields: Object.keys(this._fields),\n pipeline: this.searchPipeline\n })\n}\n\n/**\n * Applies a plugin to the index builder.\n *\n * A plugin is a function that is called with the index builder as its context.\n * Plugins can be used to customise or extend the behaviour of the index\n * in some way. A plugin is just a function, that encapsulated the custom\n * behaviour that should be applied when building the index.\n *\n * The plugin function will be called with the index builder as its argument, additional\n * arguments can also be passed when calling use. The function will be called\n * with the index builder as its context.\n *\n * @param {Function} plugin The plugin to apply.\n */\nlunr.Builder.prototype.use = function (fn) {\n var args = Array.prototype.slice.call(arguments, 1)\n args.unshift(this)\n fn.apply(this, args)\n}\n/**\n * Contains and collects metadata about a matching document.\n * A single instance of lunr.MatchData is returned as part of every\n * lunr.Index~Result.\n *\n * @constructor\n * @param {string} term - The term this match data is associated with\n * @param {string} field - The field in which the term was found\n * @param {object} metadata - The metadata recorded about this term in this field\n * @property {object} metadata - A cloned collection of metadata associated with this document.\n * @see {@link lunr.Index~Result}\n */\nlunr.MatchData = function (term, field, metadata) {\n var clonedMetadata = Object.create(null),\n metadataKeys = Object.keys(metadata || {})\n\n // Cloning the metadata to prevent the original\n // being mutated during match data combination.\n // Metadata is kept in an array within the inverted\n // index so cloning the data can be done with\n // Array#slice\n for (var i = 0; i < metadataKeys.length; i++) {\n var key = metadataKeys[i]\n clonedMetadata[key] = metadata[key].slice()\n }\n\n this.metadata = Object.create(null)\n\n if (term !== undefined) {\n this.metadata[term] = Object.create(null)\n this.metadata[term][field] = clonedMetadata\n }\n}\n\n/**\n * An instance of lunr.MatchData will be created for every term that matches a\n * document. However only one instance is required in a lunr.Index~Result. This\n * method combines metadata from another instance of lunr.MatchData with this\n * objects metadata.\n *\n * @param {lunr.MatchData} otherMatchData - Another instance of match data to merge with this one.\n * @see {@link lunr.Index~Result}\n */\nlunr.MatchData.prototype.combine = function (otherMatchData) {\n var terms = Object.keys(otherMatchData.metadata)\n\n for (var i = 0; i < terms.length; i++) {\n var term = terms[i],\n fields = Object.keys(otherMatchData.metadata[term])\n\n if (this.metadata[term] == undefined) {\n this.metadata[term] = Object.create(null)\n }\n\n for (var j = 0; j < fields.length; j++) {\n var field = fields[j],\n keys = Object.keys(otherMatchData.metadata[term][field])\n\n if (this.metadata[term][field] == undefined) {\n this.metadata[term][field] = Object.create(null)\n }\n\n for (var k = 0; k < keys.length; k++) {\n var key = keys[k]\n\n if (this.metadata[term][field][key] == undefined) {\n this.metadata[term][field][key] = otherMatchData.metadata[term][field][key]\n } else {\n this.metadata[term][field][key] = this.metadata[term][field][key].concat(otherMatchData.metadata[term][field][key])\n }\n\n }\n }\n }\n}\n\n/**\n * Add metadata for a term/field pair to this instance of match data.\n *\n * @param {string} term - The term this match data is associated with\n * @param {string} field - The field in which the term was found\n * @param {object} metadata - The metadata recorded about this term in this field\n */\nlunr.MatchData.prototype.add = function (term, field, metadata) {\n if (!(term in this.metadata)) {\n this.metadata[term] = Object.create(null)\n this.metadata[term][field] = metadata\n return\n }\n\n if (!(field in this.metadata[term])) {\n this.metadata[term][field] = metadata\n return\n }\n\n var metadataKeys = Object.keys(metadata)\n\n for (var i = 0; i < metadataKeys.length; i++) {\n var key = metadataKeys[i]\n\n if (key in this.metadata[term][field]) {\n this.metadata[term][field][key] = this.metadata[term][field][key].concat(metadata[key])\n } else {\n this.metadata[term][field][key] = metadata[key]\n }\n }\n}\n/**\n * A lunr.Query provides a programmatic way of defining queries to be performed\n * against a {@link lunr.Index}.\n *\n * Prefer constructing a lunr.Query using the {@link lunr.Index#query} method\n * so the query object is pre-initialized with the right index fields.\n *\n * @constructor\n * @property {lunr.Query~Clause[]} clauses - An array of query clauses.\n * @property {string[]} allFields - An array of all available fields in a lunr.Index.\n */\nlunr.Query = function (allFields) {\n this.clauses = []\n this.allFields = allFields\n}\n\n/**\n * Constants for indicating what kind of automatic wildcard insertion will be used when constructing a query clause.\n *\n * This allows wildcards to be added to the beginning and end of a term without having to manually do any string\n * concatenation.\n *\n * The wildcard constants can be bitwise combined to select both leading and trailing wildcards.\n *\n * @constant\n * @default\n * @property {number} wildcard.NONE - The term will have no wildcards inserted, this is the default behaviour\n * @property {number} wildcard.LEADING - Prepend the term with a wildcard, unless a leading wildcard already exists\n * @property {number} wildcard.TRAILING - Append a wildcard to the term, unless a trailing wildcard already exists\n * @see lunr.Query~Clause\n * @see lunr.Query#clause\n * @see lunr.Query#term\n * @example query term with trailing wildcard\n * query.term('foo', { wildcard: lunr.Query.wildcard.TRAILING })\n * @example query term with leading and trailing wildcard\n * query.term('foo', {\n * wildcard: lunr.Query.wildcard.LEADING | lunr.Query.wildcard.TRAILING\n * })\n */\n\nlunr.Query.wildcard = new String (\"*\")\nlunr.Query.wildcard.NONE = 0\nlunr.Query.wildcard.LEADING = 1\nlunr.Query.wildcard.TRAILING = 2\n\n/**\n * Constants for indicating what kind of presence a term must have in matching documents.\n *\n * @constant\n * @enum {number}\n * @see lunr.Query~Clause\n * @see lunr.Query#clause\n * @see lunr.Query#term\n * @example query term with required presence\n * query.term('foo', { presence: lunr.Query.presence.REQUIRED })\n */\nlunr.Query.presence = {\n /**\n * Term's presence in a document is optional, this is the default value.\n */\n OPTIONAL: 1,\n\n /**\n * Term's presence in a document is required, documents that do not contain\n * this term will not be returned.\n */\n REQUIRED: 2,\n\n /**\n * Term's presence in a document is prohibited, documents that do contain\n * this term will not be returned.\n */\n PROHIBITED: 3\n}\n\n/**\n * A single clause in a {@link lunr.Query} contains a term and details on how to\n * match that term against a {@link lunr.Index}.\n *\n * @typedef {Object} lunr.Query~Clause\n * @property {string[]} fields - The fields in an index this clause should be matched against.\n * @property {number} [boost=1] - Any boost that should be applied when matching this clause.\n * @property {number} [editDistance] - Whether the term should have fuzzy matching applied, and how fuzzy the match should be.\n * @property {boolean} [usePipeline] - Whether the term should be passed through the search pipeline.\n * @property {number} [wildcard=lunr.Query.wildcard.NONE] - Whether the term should have wildcards appended or prepended.\n * @property {number} [presence=lunr.Query.presence.OPTIONAL] - The terms presence in any matching documents.\n */\n\n/**\n * Adds a {@link lunr.Query~Clause} to this query.\n *\n * Unless the clause contains the fields to be matched all fields will be matched. In addition\n * a default boost of 1 is applied to the clause.\n *\n * @param {lunr.Query~Clause} clause - The clause to add to this query.\n * @see lunr.Query~Clause\n * @returns {lunr.Query}\n */\nlunr.Query.prototype.clause = function (clause) {\n if (!('fields' in clause)) {\n clause.fields = this.allFields\n }\n\n if (!('boost' in clause)) {\n clause.boost = 1\n }\n\n if (!('usePipeline' in clause)) {\n clause.usePipeline = true\n }\n\n if (!('wildcard' in clause)) {\n clause.wildcard = lunr.Query.wildcard.NONE\n }\n\n if ((clause.wildcard & lunr.Query.wildcard.LEADING) && (clause.term.charAt(0) != lunr.Query.wildcard)) {\n clause.term = \"*\" + clause.term\n }\n\n if ((clause.wildcard & lunr.Query.wildcard.TRAILING) && (clause.term.slice(-1) != lunr.Query.wildcard)) {\n clause.term = \"\" + clause.term + \"*\"\n }\n\n if (!('presence' in clause)) {\n clause.presence = lunr.Query.presence.OPTIONAL\n }\n\n this.clauses.push(clause)\n\n return this\n}\n\n/**\n * A negated query is one in which every clause has a presence of\n * prohibited. These queries require some special processing to return\n * the expected results.\n *\n * @returns boolean\n */\nlunr.Query.prototype.isNegated = function () {\n for (var i = 0; i < this.clauses.length; i++) {\n if (this.clauses[i].presence != lunr.Query.presence.PROHIBITED) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * Adds a term to the current query, under the covers this will create a {@link lunr.Query~Clause}\n * to the list of clauses that make up this query.\n *\n * The term is used as is, i.e. no tokenization will be performed by this method. Instead conversion\n * to a token or token-like string should be done before calling this method.\n *\n * The term will be converted to a string by calling `toString`. Multiple terms can be passed as an\n * array, each term in the array will share the same options.\n *\n * @param {object|object[]} term - The term(s) to add to the query.\n * @param {object} [options] - Any additional properties to add to the query clause.\n * @returns {lunr.Query}\n * @see lunr.Query#clause\n * @see lunr.Query~Clause\n * @example adding a single term to a query\n * query.term(\"foo\")\n * @example adding a single term to a query and specifying search fields, term boost and automatic trailing wildcard\n * query.term(\"foo\", {\n * fields: [\"title\"],\n * boost: 10,\n * wildcard: lunr.Query.wildcard.TRAILING\n * })\n * @example using lunr.tokenizer to convert a string to tokens before using them as terms\n * query.term(lunr.tokenizer(\"foo bar\"))\n */\nlunr.Query.prototype.term = function (term, options) {\n if (Array.isArray(term)) {\n term.forEach(function (t) { this.term(t, lunr.utils.clone(options)) }, this)\n return this\n }\n\n var clause = options || {}\n clause.term = term.toString()\n\n this.clause(clause)\n\n return this\n}\nlunr.QueryParseError = function (message, start, end) {\n this.name = \"QueryParseError\"\n this.message = message\n this.start = start\n this.end = end\n}\n\nlunr.QueryParseError.prototype = new Error\nlunr.QueryLexer = function (str) {\n this.lexemes = []\n this.str = str\n this.length = str.length\n this.pos = 0\n this.start = 0\n this.escapeCharPositions = []\n}\n\nlunr.QueryLexer.prototype.run = function () {\n var state = lunr.QueryLexer.lexText\n\n while (state) {\n state = state(this)\n }\n}\n\nlunr.QueryLexer.prototype.sliceString = function () {\n var subSlices = [],\n sliceStart = this.start,\n sliceEnd = this.pos\n\n for (var i = 0; i < this.escapeCharPositions.length; i++) {\n sliceEnd = this.escapeCharPositions[i]\n subSlices.push(this.str.slice(sliceStart, sliceEnd))\n sliceStart = sliceEnd + 1\n }\n\n subSlices.push(this.str.slice(sliceStart, this.pos))\n this.escapeCharPositions.length = 0\n\n return subSlices.join('')\n}\n\nlunr.QueryLexer.prototype.emit = function (type) {\n this.lexemes.push({\n type: type,\n str: this.sliceString(),\n start: this.start,\n end: this.pos\n })\n\n this.start = this.pos\n}\n\nlunr.QueryLexer.prototype.escapeCharacter = function () {\n this.escapeCharPositions.push(this.pos - 1)\n this.pos += 1\n}\n\nlunr.QueryLexer.prototype.next = function () {\n if (this.pos >= this.length) {\n return lunr.QueryLexer.EOS\n }\n\n var char = this.str.charAt(this.pos)\n this.pos += 1\n return char\n}\n\nlunr.QueryLexer.prototype.width = function () {\n return this.pos - this.start\n}\n\nlunr.QueryLexer.prototype.ignore = function () {\n if (this.start == this.pos) {\n this.pos += 1\n }\n\n this.start = this.pos\n}\n\nlunr.QueryLexer.prototype.backup = function () {\n this.pos -= 1\n}\n\nlunr.QueryLexer.prototype.acceptDigitRun = function () {\n var char, charCode\n\n do {\n char = this.next()\n charCode = char.charCodeAt(0)\n } while (charCode > 47 && charCode < 58)\n\n if (char != lunr.QueryLexer.EOS) {\n this.backup()\n }\n}\n\nlunr.QueryLexer.prototype.more = function () {\n return this.pos < this.length\n}\n\nlunr.QueryLexer.EOS = 'EOS'\nlunr.QueryLexer.FIELD = 'FIELD'\nlunr.QueryLexer.TERM = 'TERM'\nlunr.QueryLexer.EDIT_DISTANCE = 'EDIT_DISTANCE'\nlunr.QueryLexer.BOOST = 'BOOST'\nlunr.QueryLexer.PRESENCE = 'PRESENCE'\n\nlunr.QueryLexer.lexField = function (lexer) {\n lexer.backup()\n lexer.emit(lunr.QueryLexer.FIELD)\n lexer.ignore()\n return lunr.QueryLexer.lexText\n}\n\nlunr.QueryLexer.lexTerm = function (lexer) {\n if (lexer.width() > 1) {\n lexer.backup()\n lexer.emit(lunr.QueryLexer.TERM)\n }\n\n lexer.ignore()\n\n if (lexer.more()) {\n return lunr.QueryLexer.lexText\n }\n}\n\nlunr.QueryLexer.lexEditDistance = function (lexer) {\n lexer.ignore()\n lexer.acceptDigitRun()\n lexer.emit(lunr.QueryLexer.EDIT_DISTANCE)\n return lunr.QueryLexer.lexText\n}\n\nlunr.QueryLexer.lexBoost = function (lexer) {\n lexer.ignore()\n lexer.acceptDigitRun()\n lexer.emit(lunr.QueryLexer.BOOST)\n return lunr.QueryLexer.lexText\n}\n\nlunr.QueryLexer.lexEOS = function (lexer) {\n if (lexer.width() > 0) {\n lexer.emit(lunr.QueryLexer.TERM)\n }\n}\n\n// This matches the separator used when tokenising fields\n// within a document. These should match otherwise it is\n// not possible to search for some tokens within a document.\n//\n// It is possible for the user to change the separator on the\n// tokenizer so it _might_ clash with any other of the special\n// characters already used within the search string, e.g. :.\n//\n// This means that it is possible to change the separator in\n// such a way that makes some words unsearchable using a search\n// string.\nlunr.QueryLexer.termSeparator = lunr.tokenizer.separator\n\nlunr.QueryLexer.lexText = function (lexer) {\n while (true) {\n var char = lexer.next()\n\n if (char == lunr.QueryLexer.EOS) {\n return lunr.QueryLexer.lexEOS\n }\n\n // Escape character is '\\'\n if (char.charCodeAt(0) == 92) {\n lexer.escapeCharacter()\n continue\n }\n\n if (char == \":\") {\n return lunr.QueryLexer.lexField\n }\n\n if (char == \"~\") {\n lexer.backup()\n if (lexer.width() > 0) {\n lexer.emit(lunr.QueryLexer.TERM)\n }\n return lunr.QueryLexer.lexEditDistance\n }\n\n if (char == \"^\") {\n lexer.backup()\n if (lexer.width() > 0) {\n lexer.emit(lunr.QueryLexer.TERM)\n }\n return lunr.QueryLexer.lexBoost\n }\n\n // \"+\" indicates term presence is required\n // checking for length to ensure that only\n // leading \"+\" are considered\n if (char == \"+\" && lexer.width() === 1) {\n lexer.emit(lunr.QueryLexer.PRESENCE)\n return lunr.QueryLexer.lexText\n }\n\n // \"-\" indicates term presence is prohibited\n // checking for length to ensure that only\n // leading \"-\" are considered\n if (char == \"-\" && lexer.width() === 1) {\n lexer.emit(lunr.QueryLexer.PRESENCE)\n return lunr.QueryLexer.lexText\n }\n\n if (char.match(lunr.QueryLexer.termSeparator)) {\n return lunr.QueryLexer.lexTerm\n }\n }\n}\n\nlunr.QueryParser = function (str, query) {\n this.lexer = new lunr.QueryLexer (str)\n this.query = query\n this.currentClause = {}\n this.lexemeIdx = 0\n}\n\nlunr.QueryParser.prototype.parse = function () {\n this.lexer.run()\n this.lexemes = this.lexer.lexemes\n\n var state = lunr.QueryParser.parseClause\n\n while (state) {\n state = state(this)\n }\n\n return this.query\n}\n\nlunr.QueryParser.prototype.peekLexeme = function () {\n return this.lexemes[this.lexemeIdx]\n}\n\nlunr.QueryParser.prototype.consumeLexeme = function () {\n var lexeme = this.peekLexeme()\n this.lexemeIdx += 1\n return lexeme\n}\n\nlunr.QueryParser.prototype.nextClause = function () {\n var completedClause = this.currentClause\n this.query.clause(completedClause)\n this.currentClause = {}\n}\n\nlunr.QueryParser.parseClause = function (parser) {\n var lexeme = parser.peekLexeme()\n\n if (lexeme == undefined) {\n return\n }\n\n switch (lexeme.type) {\n case lunr.QueryLexer.PRESENCE:\n return lunr.QueryParser.parsePresence\n case lunr.QueryLexer.FIELD:\n return lunr.QueryParser.parseField\n case lunr.QueryLexer.TERM:\n return lunr.QueryParser.parseTerm\n default:\n var errorMessage = \"expected either a field or a term, found \" + lexeme.type\n\n if (lexeme.str.length >= 1) {\n errorMessage += \" with value '\" + lexeme.str + \"'\"\n }\n\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n}\n\nlunr.QueryParser.parsePresence = function (parser) {\n var lexeme = parser.consumeLexeme()\n\n if (lexeme == undefined) {\n return\n }\n\n switch (lexeme.str) {\n case \"-\":\n parser.currentClause.presence = lunr.Query.presence.PROHIBITED\n break\n case \"+\":\n parser.currentClause.presence = lunr.Query.presence.REQUIRED\n break\n default:\n var errorMessage = \"unrecognised presence operator'\" + lexeme.str + \"'\"\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n\n var nextLexeme = parser.peekLexeme()\n\n if (nextLexeme == undefined) {\n var errorMessage = \"expecting term or field, found nothing\"\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n\n switch (nextLexeme.type) {\n case lunr.QueryLexer.FIELD:\n return lunr.QueryParser.parseField\n case lunr.QueryLexer.TERM:\n return lunr.QueryParser.parseTerm\n default:\n var errorMessage = \"expecting term or field, found '\" + nextLexeme.type + \"'\"\n throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end)\n }\n}\n\nlunr.QueryParser.parseField = function (parser) {\n var lexeme = parser.consumeLexeme()\n\n if (lexeme == undefined) {\n return\n }\n\n if (parser.query.allFields.indexOf(lexeme.str) == -1) {\n var possibleFields = parser.query.allFields.map(function (f) { return \"'\" + f + \"'\" }).join(', '),\n errorMessage = \"unrecognised field '\" + lexeme.str + \"', possible fields: \" + possibleFields\n\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n\n parser.currentClause.fields = [lexeme.str]\n\n var nextLexeme = parser.peekLexeme()\n\n if (nextLexeme == undefined) {\n var errorMessage = \"expecting term, found nothing\"\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n\n switch (nextLexeme.type) {\n case lunr.QueryLexer.TERM:\n return lunr.QueryParser.parseTerm\n default:\n var errorMessage = \"expecting term, found '\" + nextLexeme.type + \"'\"\n throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end)\n }\n}\n\nlunr.QueryParser.parseTerm = function (parser) {\n var lexeme = parser.consumeLexeme()\n\n if (lexeme == undefined) {\n return\n }\n\n parser.currentClause.term = lexeme.str.toLowerCase()\n\n if (lexeme.str.indexOf(\"*\") != -1) {\n parser.currentClause.usePipeline = false\n }\n\n var nextLexeme = parser.peekLexeme()\n\n if (nextLexeme == undefined) {\n parser.nextClause()\n return\n }\n\n switch (nextLexeme.type) {\n case lunr.QueryLexer.TERM:\n parser.nextClause()\n return lunr.QueryParser.parseTerm\n case lunr.QueryLexer.FIELD:\n parser.nextClause()\n return lunr.QueryParser.parseField\n case lunr.QueryLexer.EDIT_DISTANCE:\n return lunr.QueryParser.parseEditDistance\n case lunr.QueryLexer.BOOST:\n return lunr.QueryParser.parseBoost\n case lunr.QueryLexer.PRESENCE:\n parser.nextClause()\n return lunr.QueryParser.parsePresence\n default:\n var errorMessage = \"Unexpected lexeme type '\" + nextLexeme.type + \"'\"\n throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end)\n }\n}\n\nlunr.QueryParser.parseEditDistance = function (parser) {\n var lexeme = parser.consumeLexeme()\n\n if (lexeme == undefined) {\n return\n }\n\n var editDistance = parseInt(lexeme.str, 10)\n\n if (isNaN(editDistance)) {\n var errorMessage = \"edit distance must be numeric\"\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n\n parser.currentClause.editDistance = editDistance\n\n var nextLexeme = parser.peekLexeme()\n\n if (nextLexeme == undefined) {\n parser.nextClause()\n return\n }\n\n switch (nextLexeme.type) {\n case lunr.QueryLexer.TERM:\n parser.nextClause()\n return lunr.QueryParser.parseTerm\n case lunr.QueryLexer.FIELD:\n parser.nextClause()\n return lunr.QueryParser.parseField\n case lunr.QueryLexer.EDIT_DISTANCE:\n return lunr.QueryParser.parseEditDistance\n case lunr.QueryLexer.BOOST:\n return lunr.QueryParser.parseBoost\n case lunr.QueryLexer.PRESENCE:\n parser.nextClause()\n return lunr.QueryParser.parsePresence\n default:\n var errorMessage = \"Unexpected lexeme type '\" + nextLexeme.type + \"'\"\n throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end)\n }\n}\n\nlunr.QueryParser.parseBoost = function (parser) {\n var lexeme = parser.consumeLexeme()\n\n if (lexeme == undefined) {\n return\n }\n\n var boost = parseInt(lexeme.str, 10)\n\n if (isNaN(boost)) {\n var errorMessage = \"boost must be numeric\"\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n\n parser.currentClause.boost = boost\n\n var nextLexeme = parser.peekLexeme()\n\n if (nextLexeme == undefined) {\n parser.nextClause()\n return\n }\n\n switch (nextLexeme.type) {\n case lunr.QueryLexer.TERM:\n parser.nextClause()\n return lunr.QueryParser.parseTerm\n case lunr.QueryLexer.FIELD:\n parser.nextClause()\n return lunr.QueryParser.parseField\n case lunr.QueryLexer.EDIT_DISTANCE:\n return lunr.QueryParser.parseEditDistance\n case lunr.QueryLexer.BOOST:\n return lunr.QueryParser.parseBoost\n case lunr.QueryLexer.PRESENCE:\n parser.nextClause()\n return lunr.QueryParser.parsePresence\n default:\n var errorMessage = \"Unexpected lexeme type '\" + nextLexeme.type + \"'\"\n throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end)\n }\n}\n\n /**\n * export the module via AMD, CommonJS or as a browser global\n * Export code from https://github.com/umdjs/umd/blob/master/returnExports.js\n */\n ;(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(factory)\n } else if (typeof exports === 'object') {\n /**\n * Node. Does not work with strict CommonJS, but\n * only CommonJS-like enviroments that support module.exports,\n * like Node.\n */\n module.exports = factory()\n } else {\n // Browser globals (root is window)\n root.lunr = factory()\n }\n }(this, function () {\n /**\n * Just return a value to define the module export.\n * This example returns an object, but the module\n * can return a function as the exported value.\n */\n return lunr\n }))\n})();\n", "/*\n * Copyright (c) 2016-2024 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A RTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport lunr from \"lunr\"\n\nimport { getElement } from \"~/browser/element/_\"\nimport \"~/polyfills\"\n\nimport { Search } from \"../../_\"\nimport { SearchConfig } from \"../../config\"\nimport {\n SearchMessage,\n SearchMessageType\n} from \"../message\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Add support for `iframe-worker` shim\n *\n * While `importScripts` is synchronous when executed inside of a web worker,\n * it's not possible to provide a synchronous shim implementation. The cool\n * thing is that awaiting a non-Promise will convert it into a Promise, so\n * extending the type definition to return a `Promise` shouldn't break anything.\n *\n * @see https://bit.ly/2PjDnXi - GitHub comment\n *\n * @param urls - Scripts to load\n *\n * @returns Promise resolving with no result\n */\ndeclare global {\n function importScripts(...urls: string[]): Promise | void\n}\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Search index\n */\nlet index: Search\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Fetch (= import) multi-language support through `lunr-languages`\n *\n * This function automatically imports the stemmers necessary to process the\n * languages which are defined as part of the search configuration.\n *\n * If the worker runs inside of an `iframe` (when using `iframe-worker` as\n * a shim), the base URL for the stemmers to be loaded must be determined by\n * searching for the first `script` element with a `src` attribute, which will\n * contain the contents of this script.\n *\n * @param config - Search configuration\n *\n * @returns Promise resolving with no result\n */\nasync function setupSearchLanguages(\n config: SearchConfig\n): Promise {\n let base = \"../lunr\"\n\n /* Detect `iframe-worker` and fix base URL */\n if (typeof parent !== \"undefined\" && \"IFrameWorker\" in parent) {\n const worker = getElement(\"script[src]\")\n const [path] = worker.src.split(\"/worker\")\n\n /* Prefix base with path */\n base = base.replace(\"..\", path)\n }\n\n /* Add scripts for languages */\n const scripts = []\n for (const lang of config.lang) {\n switch (lang) {\n\n /* Add segmenter for Japanese */\n case \"ja\":\n scripts.push(`${base}/tinyseg.js`)\n break\n\n /* Add segmenter for Hindi and Thai */\n case \"hi\":\n case \"th\":\n scripts.push(`${base}/wordcut.js`)\n break\n }\n\n /* Add language support */\n if (lang !== \"en\")\n scripts.push(`${base}/min/lunr.${lang}.min.js`)\n }\n\n /* Add multi-language support */\n if (config.lang.length > 1)\n scripts.push(`${base}/min/lunr.multi.min.js`)\n\n /* Load scripts synchronously */\n if (scripts.length)\n await importScripts(\n `${base}/min/lunr.stemmer.support.min.js`,\n ...scripts\n )\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Message handler\n *\n * @param message - Source message\n *\n * @returns Target message\n */\nexport async function handler(\n message: SearchMessage\n): Promise {\n switch (message.type) {\n\n /* Search setup message */\n case SearchMessageType.SETUP:\n await setupSearchLanguages(message.data.config)\n index = new Search(message.data)\n return {\n type: SearchMessageType.READY\n }\n\n /* Search query message */\n case SearchMessageType.QUERY:\n const query = message.data\n try {\n return {\n type: SearchMessageType.RESULT,\n data: index.search(query)\n }\n\n /* Return empty result in case of error */\n } catch (err) {\n console.warn(`Invalid query: ${query} \u2013 see https://bit.ly/2s3ChXG`)\n console.warn(err)\n return {\n type: SearchMessageType.RESULT,\n data: { items: [] }\n }\n }\n\n /* All other messages */\n default:\n throw new TypeError(\"Invalid message type\")\n }\n}\n\n/* ----------------------------------------------------------------------------\n * Worker\n * ------------------------------------------------------------------------- */\n\n/* Expose Lunr.js in global scope, or stemmers won't work */\nself.lunr = lunr\n\n/* Handle messages */\naddEventListener(\"message\", async ev => {\n postMessage(await handler(ev.data))\n})\n", "/*\n * Copyright (c) 2016-2024 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve all elements matching the query selector\n *\n * @template T - Element type\n *\n * @param selector - Query selector\n * @param node - Node of reference\n *\n * @returns Elements\n */\nexport function getElements(\n selector: T, node?: ParentNode\n): HTMLElementTagNameMap[T][]\n\nexport function getElements(\n selector: string, node?: ParentNode\n): T[]\n\nexport function getElements(\n selector: string, node: ParentNode = document\n): T[] {\n return Array.from(node.querySelectorAll(selector))\n}\n\n/**\n * Retrieve an element matching a query selector or throw a reference error\n *\n * Note that this function assumes that the element is present. If unsure if an\n * element is existent, use the `getOptionalElement` function instead.\n *\n * @template T - Element type\n *\n * @param selector - Query selector\n * @param node - Node of reference\n *\n * @returns Element\n */\nexport function getElement(\n selector: T, node?: ParentNode\n): HTMLElementTagNameMap[T]\n\nexport function getElement(\n selector: string, node?: ParentNode\n): T\n\nexport function getElement(\n selector: string, node: ParentNode = document\n): T {\n const el = getOptionalElement(selector, node)\n if (typeof el === \"undefined\")\n throw new ReferenceError(\n `Missing element: expected \"${selector}\" to be present`\n )\n\n /* Return element */\n return el\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Retrieve an optional element matching the query selector\n *\n * @template T - Element type\n *\n * @param selector - Query selector\n * @param node - Node of reference\n *\n * @returns Element or nothing\n */\nexport function getOptionalElement(\n selector: T, node?: ParentNode\n): HTMLElementTagNameMap[T] | undefined\n\nexport function getOptionalElement(\n selector: string, node?: ParentNode\n): T | undefined\n\nexport function getOptionalElement(\n selector: string, node: ParentNode = document\n): T | undefined {\n return node.querySelector(selector) || undefined\n}\n\n/**\n * Retrieve the currently active element\n *\n * @returns Element or nothing\n */\nexport function getActiveElement(): HTMLElement | undefined {\n return (\n document.activeElement?.shadowRoot?.activeElement as HTMLElement ??\n document.activeElement as HTMLElement ??\n undefined\n )\n}\n", "/*\n * Copyright (c) 2016-2024 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Polyfills\n * ------------------------------------------------------------------------- */\n\n/* Polyfill `Object.entries` */\nif (!Object.entries)\n Object.entries = function (obj: object) {\n const data: [string, string][] = []\n for (const key of Object.keys(obj))\n // @ts-expect-error - ignore property access warning\n data.push([key, obj[key]])\n\n /* Return entries */\n return data\n }\n\n/* Polyfill `Object.values` */\nif (!Object.values)\n Object.values = function (obj: object) {\n const data: string[] = []\n for (const key of Object.keys(obj))\n // @ts-expect-error - ignore property access warning\n data.push(obj[key])\n\n /* Return values */\n return data\n }\n\n/* ------------------------------------------------------------------------- */\n\n/* Polyfills for `Element` */\nif (typeof Element !== \"undefined\") {\n\n /* Polyfill `Element.scrollTo` */\n if (!Element.prototype.scrollTo)\n Element.prototype.scrollTo = function (\n x?: ScrollToOptions | number, y?: number\n ): void {\n if (typeof x === \"object\") {\n this.scrollLeft = x.left!\n this.scrollTop = x.top!\n } else {\n this.scrollLeft = x!\n this.scrollTop = y!\n }\n }\n\n /* Polyfill `Element.replaceWith` */\n if (!Element.prototype.replaceWith)\n Element.prototype.replaceWith = function (\n ...nodes: Array\n ): void {\n const parent = this.parentNode\n if (parent) {\n if (nodes.length === 0)\n parent.removeChild(this)\n\n /* Replace children and create text nodes */\n for (let i = nodes.length - 1; i >= 0; i--) {\n let node = nodes[i]\n if (typeof node === \"string\")\n node = document.createTextNode(node)\n else if (node.parentNode)\n node.parentNode.removeChild(node)\n\n /* Replace child or insert before previous sibling */\n if (!i)\n parent.replaceChild(node, this)\n else\n parent.insertBefore(this.previousSibling!, node)\n }\n }\n }\n}\n", "/*\n * Copyright (c) 2016-2024 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search configuration\n */\nexport interface SearchConfig {\n lang: string[] /* Search languages */\n separator: string /* Search separator */\n pipeline: SearchPipelineFn[] /* Search pipeline */\n}\n\n/**\n * Search document\n */\nexport interface SearchDocument {\n location: string /* Document location */\n title: string /* Document title */\n text: string /* Document text */\n tags?: string[] /* Document tags */\n boost?: number /* Document boost */\n parent?: SearchDocument /* Document parent */\n}\n\n/**\n * Search options\n */\nexport interface SearchOptions {\n suggest: boolean /* Search suggestions */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search index\n */\nexport interface SearchIndex {\n config: SearchConfig /* Search configuration */\n docs: SearchDocument[] /* Search documents */\n options: SearchOptions /* Search options */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search pipeline function\n */\ntype SearchPipelineFn =\n | \"trimmer\" /* Trimmer */\n | \"stopWordFilter\" /* Stop word filter */\n | \"stemmer\" /* Stemmer */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Create a search document map\n *\n * This function creates a mapping of URLs (including anchors) to the actual\n * articles and sections. It relies on the invariant that the search index is\n * ordered with the main article appearing before all sections with anchors.\n * If this is not the case, the logic music be changed.\n *\n * @param docs - Search documents\n *\n * @returns Search document map\n */\nexport function setupSearchDocumentMap(\n docs: SearchDocument[]\n): Map {\n const map = new Map()\n for (const doc of docs) {\n const [path] = doc.location.split(\"#\")\n\n /* Add document article */\n const article = map.get(path)\n if (typeof article === \"undefined\") {\n map.set(path, doc)\n\n /* Add document section */\n } else {\n map.set(doc.location, doc)\n doc.parent = article\n }\n }\n\n /* Return search document map */\n return map\n}\n", "/*\n * Copyright (c) 2016-2024 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Visitor function\n *\n * @param start - Start offset\n * @param end - End offset\n */\ntype VisitorFn = (\n start: number, end: number\n) => void\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Split a string using the given separator\n *\n * @param input - Input value\n * @param separator - Separator\n * @param fn - Visitor function\n */\nexport function split(\n input: string, separator: RegExp, fn: VisitorFn\n): void {\n separator = new RegExp(separator, \"g\")\n\n /* Split string using separator */\n let match: RegExpExecArray | null\n let index = 0\n do {\n match = separator.exec(input)\n\n /* Emit non-empty range */\n const until = match?.index ?? input.length\n if (index < until)\n fn(index, until)\n\n /* Update last index */\n if (match) {\n const [term] = match\n index = match.index + term.length\n\n /* Support zero-length lookaheads */\n if (term.length === 0)\n separator.lastIndex = match.index + 1\n }\n } while (match)\n}\n", "/*\n * Copyright (c) 2016-2024 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Extraction type\n *\n * This type defines the possible values that are encoded into the first two\n * bits of a section that is part of the blocks of a tokenization table. There\n * are three types of interest: HTML opening and closing tags, as well as the\n * actual text content we need to extract for indexing.\n */\nexport const enum Extract {\n TAG_OPEN = 0, /* HTML opening tag */\n TEXT = 1, /* Text content */\n TAG_CLOSE = 2 /* HTML closing tag */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Visitor function\n *\n * @param block - Block index\n * @param type - Extraction type\n * @param start - Start offset\n * @param end - End offset\n */\ntype VisitorFn = (\n block: number, type: Extract, start: number, end: number\n) => void\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Split a string into markup and text sections\n *\n * This function scans a string and divides it up into sections of markup and\n * text. For each section, it invokes the given visitor function with the block\n * index, extraction type, as well as start and end offsets. Using a visitor\n * function (= streaming data) is ideal for minimizing pressure on the GC.\n *\n * @param input - Input value\n * @param fn - Visitor function\n */\nexport function extract(\n input: string, fn: VisitorFn\n): void {\n\n let block = 0 /* Current block */\n let start = 0 /* Current start offset */\n let end = 0 /* Current end offset */\n\n /* Split string into sections */\n for (let stack = 0; end < input.length; end++) {\n\n /* Opening tag after non-empty section */\n if (input.charAt(end) === \"<\" && end > start) {\n fn(block, Extract.TEXT, start, start = end)\n\n /* Closing tag */\n } else if (input.charAt(end) === \">\") {\n if (input.charAt(start + 1) === \"/\") {\n if (--stack === 0)\n fn(block++, Extract.TAG_CLOSE, start, end + 1)\n\n /* Tag is not self-closing */\n } else if (input.charAt(end - 1) !== \"/\") {\n if (stack++ === 0)\n fn(block, Extract.TAG_OPEN, start, end + 1)\n }\n\n /* New section */\n start = end + 1\n }\n }\n\n /* Add trailing section */\n if (end > start)\n fn(block, Extract.TEXT, start, end)\n}\n", "/*\n * Copyright (c) 2016-2024 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Position table\n */\nexport type PositionTable = number[][]\n\n/**\n * Position\n */\nexport type Position = number\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Highlight all occurrences in a string\n *\n * This function receives a field's value (e.g. like `title` or `text`), it's\n * position table that was generated during indexing, and the positions found\n * when executing the query. It then highlights all occurrences, and returns\n * their concatenation. In case of multiple blocks, two are returned.\n *\n * @param input - Input value\n * @param table - Table for indexing\n * @param positions - Occurrences\n * @param full - Full results\n *\n * @returns Highlighted string value\n */\nexport function highlight(\n input: string, table: PositionTable, positions: Position[], full = false\n): string {\n return highlightAll([input], table, positions, full).pop()!\n}\n\n/**\n * Highlight all occurrences in a set of strings\n *\n * @param inputs - Input values\n * @param table - Table for indexing\n * @param positions - Occurrences\n * @param full - Full results\n *\n * @returns Highlighted string values\n */\nexport function highlightAll(\n inputs: string[], table: PositionTable, positions: Position[], full = false\n): string[] {\n\n /* Map blocks to input values */\n const mapping = [0]\n for (let t = 1; t < table.length; t++) {\n const prev = table[t - 1]\n const next = table[t]\n\n /* Check if table points to new block */\n const p = prev[prev.length - 1] >>> 2 & 0x3FF\n const q = next[0] >>> 12\n\n /* Add block to mapping */\n mapping.push(+(p > q) + mapping[mapping.length - 1])\n }\n\n /* Highlight strings one after another */\n return inputs.map((input, i) => {\n let cursor = 0\n\n /* Map occurrences to blocks */\n const blocks = new Map()\n for (const p of positions.sort((a, b) => a - b)) {\n const index = p & 0xFFFFF\n const block = p >>> 20\n if (mapping[block] !== i)\n continue\n\n /* Ensure presence of block group */\n let group = blocks.get(block)\n if (typeof group === \"undefined\")\n blocks.set(block, group = [])\n\n /* Add index to group */\n group.push(index)\n }\n\n /* Just return string, if no occurrences */\n if (blocks.size === 0)\n return input\n\n /* Compute slices */\n const slices: string[] = []\n for (const [block, indexes] of blocks) {\n const t = table[block]\n\n /* Extract positions and length */\n const start = t[0] >>> 12\n const end = t[t.length - 1] >>> 12\n const length = t[t.length - 1] >>> 2 & 0x3FF\n\n /* Add prefix, if full results are desired */\n if (full && start > cursor)\n slices.push(input.slice(cursor, start))\n\n /* Extract and highlight slice */\n let slice = input.slice(start, end + length)\n for (const j of indexes.sort((a, b) => b - a)) {\n\n /* Retrieve offset and length of match */\n const p = (t[j] >>> 12) - start\n const q = (t[j] >>> 2 & 0x3FF) + p\n\n /* Wrap occurrence */\n slice = [\n slice.slice(0, p),\n \"\",\n slice.slice(p, q),\n \"\",\n slice.slice(q)\n ].join(\"\")\n }\n\n /* Update cursor */\n cursor = end + length\n\n /* Append slice and abort if we have two */\n if (slices.push(slice) === 2)\n break\n }\n\n /* Add suffix, if full results are desired */\n if (full && cursor < input.length)\n slices.push(input.slice(cursor))\n\n /* Return highlighted slices */\n return slices.join(\"\")\n })\n}\n", "/*\n * Copyright (c) 2016-2024 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { split } from \"../_\"\nimport {\n Extract,\n extract\n} from \"../extract\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Split a string or set of strings into tokens\n *\n * This tokenizer supersedes the default tokenizer that is provided by Lunr.js,\n * as it is aware of HTML tags and allows for multi-character splitting.\n *\n * It takes the given inputs, splits each of them into markup and text sections,\n * tokenizes and segments (if necessary) each of them, and then indexes them in\n * a table by using a compact bit representation. Bitwise techniques are used\n * to write and read from the table during indexing and querying.\n *\n * @see https://bit.ly/3W3Xw4J - Search: better, faster, smaller\n *\n * @param input - Input value(s)\n *\n * @returns Tokens\n */\nexport function tokenize(\n input?: string | string[]\n): lunr.Token[] {\n const tokens: lunr.Token[] = []\n if (typeof input === \"undefined\")\n return tokens\n\n /* Tokenize strings one after another */\n const inputs = Array.isArray(input) ? input : [input]\n for (let i = 0; i < inputs.length; i++) {\n const table = lunr.tokenizer.table\n const total = table.length\n\n /* Split string into sections and tokenize content blocks */\n extract(inputs[i], (block, type, start, end) => {\n table[block += total] ||= []\n switch (type) {\n\n /* Handle markup */\n case Extract.TAG_OPEN:\n case Extract.TAG_CLOSE:\n table[block].push(\n start << 12 |\n end - start << 2 |\n type\n )\n break\n\n /* Handle text content */\n case Extract.TEXT:\n const section = inputs[i].slice(start, end)\n split(section, lunr.tokenizer.separator, (index, until) => {\n\n /**\n * Apply segmenter after tokenization. Note that the segmenter will\n * also split words at word boundaries, which is not what we want,\n * so we need to check if we can somehow mitigate this behavior.\n */\n if (typeof lunr.segmenter !== \"undefined\") {\n const subsection = section.slice(index, until)\n if (/^[MHIK]$/.test(lunr.segmenter.ctype_(subsection))) {\n const segments = lunr.segmenter.segment(subsection)\n for (let s = 0, l = 0; s < segments.length; s++) {\n\n /* Add block to section */\n table[block] ||= []\n table[block].push(\n start + index + l << 12 |\n segments[s].length << 2 |\n type\n )\n\n /* Add token with position */\n tokens.push(new lunr.Token(\n segments[s].toLowerCase(), {\n position: block << 20 | table[block].length - 1\n }\n ))\n\n /* Keep track of length */\n l += segments[s].length\n }\n return\n }\n }\n\n /* Add block to section */\n table[block].push(\n start + index << 12 |\n until - index << 2 |\n type\n )\n\n /* Add token with position */\n tokens.push(new lunr.Token(\n section.slice(index, until).toLowerCase(), {\n position: block << 20 | table[block].length - 1\n }\n ))\n })\n }\n })\n }\n\n /* Return tokens */\n return tokens\n}\n", "/*\n * Copyright (c) 2016-2024 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Visitor function\n *\n * @param value - String value\n *\n * @returns String term(s)\n */\ntype VisitorFn = (\n value: string\n) => string | string[]\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Default transformation function\n *\n * 1. Trim excess whitespace from left and right.\n *\n * 2. Search for parts in quotation marks and prepend a `+` modifier to denote\n * that the resulting document must contain all parts, converting the query\n * to an `AND` query (as opposed to the default `OR` behavior). While users\n * may expect parts enclosed in quotation marks to map to span queries, i.e.\n * for which order is important, Lunr.js doesn't support them, so the best\n * we can do is to convert the parts to an `AND` query.\n *\n * 3. Replace control characters which are not located at the beginning of the\n * query or preceded by white space, or are not followed by a non-whitespace\n * character or are at the end of the query string. Furthermore, filter\n * unmatched quotation marks.\n *\n * 4. Split the query string at whitespace, then pass each part to the visitor\n * function for tokenization, and append a wildcard to every resulting term\n * that is not explicitly marked with a `+`, `-`, `~` or `^` modifier, since\n * it ensures consistent and stable ranking when multiple terms are entered.\n * Also, if a fuzzy or boost modifier are given, but no numeric value has\n * been entered, default to 1 to not induce a query error.\n *\n * @param query - Query value\n * @param fn - Visitor function\n *\n * @returns Transformed query value\n */\nexport function transform(\n query: string, fn: VisitorFn = term => term\n): string {\n return query\n\n /* => 1 */\n .trim()\n\n /* => 2 */\n .split(/\"([^\"]+)\"/g)\n .map((parts, index) => index & 1\n ? parts.replace(/^\\b|^(?![^\\x00-\\x7F]|$)|\\s+/g, \" +\")\n : parts\n )\n .join(\"\")\n\n /* => 3 */\n .replace(/\"|(?:^|\\s+)[*+\\-:^~]+(?=\\s+|$)/g, \"\")\n\n /* => 4 */\n .split(/\\s+/g)\n .reduce((prev, term) => {\n const next = fn(term)\n return [...prev, ...Array.isArray(next) ? next : [next]]\n }, [] as string[])\n .map(term => /([~^]$)/.test(term) ? `${term}1` : term)\n .map(term => /(^[+-]|[~^]\\d+$)/.test(term) ? term : `${term}*`)\n .join(\" \")\n}\n", "/*\n * Copyright (c) 2016-2024 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { split } from \"../../internal\"\nimport { transform } from \"../transform\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search query clause\n */\nexport interface SearchQueryClause {\n presence: lunr.Query.presence /* Clause presence */\n term: string /* Clause term */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search query terms\n */\nexport type SearchQueryTerms = Record\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Transform search query\n *\n * This function lexes the given search query and applies the transformation\n * function to each term, preserving markup like `+` and `-` modifiers.\n *\n * @param query - Search query\n *\n * @returns Search query\n */\nexport function transformSearchQuery(\n query: string\n): string {\n\n /* Split query terms with tokenizer */\n return transform(query, part => {\n const terms: string[] = []\n\n /* Initialize lexer and analyze part */\n const lexer = new lunr.QueryLexer(part)\n lexer.run()\n\n /* Extract and tokenize term from lexeme */\n for (const { type, str: term, start, end } of lexer.lexemes)\n switch (type) {\n\n /* Hack: remove colon - see https://bit.ly/3wD3T3I */\n case \"FIELD\":\n if (![\"title\", \"text\", \"tags\"].includes(term))\n part = [\n part.slice(0, end),\n \" \",\n part.slice(end + 1)\n ].join(\"\")\n break\n\n /* Tokenize term */\n case \"TERM\":\n split(term, lunr.tokenizer.separator, (...range) => {\n terms.push([\n part.slice(0, start),\n term.slice(...range),\n part.slice(end)\n ].join(\"\"))\n })\n }\n\n /* Return terms */\n return terms\n })\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Parse a search query for analysis\n *\n * Lunr.js itself has a bug where it doesn't detect or remove wildcards for\n * query clauses, so we must do this here.\n *\n * @see https://bit.ly/3DpTGtz - GitHub issue\n *\n * @param value - Query value\n *\n * @returns Search query clauses\n */\nexport function parseSearchQuery(\n value: string\n): SearchQueryClause[] {\n const query = new lunr.Query([\"title\", \"text\", \"tags\"])\n const parser = new lunr.QueryParser(value, query)\n\n /* Parse Search query */\n parser.parse()\n for (const clause of query.clauses) {\n clause.usePipeline = true\n\n /* Handle leading wildcard */\n if (clause.term.startsWith(\"*\")) {\n clause.wildcard = lunr.Query.wildcard.LEADING\n clause.term = clause.term.slice(1)\n }\n\n /* Handle trailing wildcard */\n if (clause.term.endsWith(\"*\")) {\n clause.wildcard = lunr.Query.wildcard.TRAILING\n clause.term = clause.term.slice(0, -1)\n }\n }\n\n /* Return query clauses */\n return query.clauses\n}\n\n/**\n * Analyze the search query clauses in regard to the search terms found\n *\n * @param query - Search query clauses\n * @param terms - Search terms\n *\n * @returns Search query terms\n */\nexport function getSearchQueryTerms(\n query: SearchQueryClause[], terms: string[]\n): SearchQueryTerms {\n const clauses = new Set(query)\n\n /* Match query clauses against terms */\n const result: SearchQueryTerms = {}\n for (let t = 0; t < terms.length; t++)\n for (const clause of clauses)\n if (terms[t].startsWith(clause.term)) {\n result[clause.term] = true\n clauses.delete(clause)\n }\n\n /* Annotate unmatched non-stopword query clauses */\n for (const clause of clauses)\n if (lunr.stopWordFilter?.(clause.term))\n result[clause.term] = false\n\n /* Return query terms */\n return result\n}\n", "/*\n * Copyright (c) 2016-2024 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Segment a search query using the inverted index\n *\n * This function implements a clever approach to text segmentation for Asian\n * languages, as it used the information already available in the search index.\n * The idea is to greedily segment the search query based on the tokens that are\n * already part of the index, as described in the linked issue.\n *\n * @see https://bit.ly/3lwjrk7 - GitHub issue\n *\n * @param query - Query value\n * @param index - Inverted index\n *\n * @returns Segmented query value\n */\nexport function segment(\n query: string, index: object\n): Iterable {\n const segments = new Set()\n\n /* Segment search query */\n const wordcuts = new Uint16Array(query.length)\n for (let i = 0; i < query.length; i++)\n for (let j = i + 1; j < query.length; j++) {\n const value = query.slice(i, j)\n if (value in index)\n wordcuts[i] = j - i\n }\n\n /* Compute longest matches with minimum overlap */\n const stack = [0]\n for (let s = stack.length; s > 0;) {\n const p = stack[--s]\n for (let q = 1; q < wordcuts[p]; q++)\n if (wordcuts[p + q] > wordcuts[p] - q) {\n segments.add(query.slice(p, p + q))\n stack[s++] = p + q\n }\n\n /* Continue at end of query string */\n const q = p + wordcuts[p]\n if (wordcuts[q] && q < query.length - 1)\n stack[s++] = q\n\n /* Add current segment */\n segments.add(query.slice(p, q))\n }\n\n // @todo fix this case in the code block above, this is a hotfix\n if (segments.has(\"\"))\n return new Set([query])\n\n /* Return segmented query value */\n return segments\n}\n", "/*\n * Copyright (c) 2016-2024 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n SearchDocument,\n SearchIndex,\n SearchOptions,\n setupSearchDocumentMap\n} from \"../config\"\nimport {\n Position,\n PositionTable,\n highlight,\n highlightAll,\n tokenize\n} from \"../internal\"\nimport {\n SearchQueryTerms,\n getSearchQueryTerms,\n parseSearchQuery,\n segment,\n transformSearchQuery\n} from \"../query\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search item\n */\nexport interface SearchItem\n extends SearchDocument\n{\n score: number /* Score (relevance) */\n terms: SearchQueryTerms /* Search query terms */\n}\n\n/**\n * Search result\n */\nexport interface SearchResult {\n items: SearchItem[][] /* Search items */\n suggest?: string[] /* Search suggestions */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Create field extractor factory\n *\n * @param table - Position table map\n *\n * @returns Extractor factory\n */\nfunction extractor(table: Map) {\n return (name: keyof SearchDocument) => {\n return (doc: SearchDocument) => {\n if (typeof doc[name] === \"undefined\")\n return undefined\n\n /* Compute identifier and initialize table */\n const id = [doc.location, name].join(\":\")\n table.set(id, lunr.tokenizer.table = [])\n\n /* Return field value */\n return doc[name]\n }\n }\n}\n\n/**\n * Compute the difference of two lists of strings\n *\n * @param a - 1st list of strings\n * @param b - 2nd list of strings\n *\n * @returns Difference\n */\nfunction difference(a: string[], b: string[]): string[] {\n const [x, y] = [new Set(a), new Set(b)]\n return [\n ...new Set([...x].filter(value => !y.has(value)))\n ]\n}\n\n/* ----------------------------------------------------------------------------\n * Class\n * ------------------------------------------------------------------------- */\n\n/**\n * Search index\n */\nexport class Search {\n\n /**\n * Search document map\n */\n protected map: Map\n\n /**\n * Search options\n */\n protected options: SearchOptions\n\n /**\n * The underlying Lunr.js search index\n */\n protected index: lunr.Index\n\n /**\n * Internal position table map\n */\n protected table: Map\n\n /**\n * Create the search integration\n *\n * @param data - Search index\n */\n public constructor({ config, docs, options }: SearchIndex) {\n const field = extractor(this.table = new Map())\n\n /* Set up document map and options */\n this.map = setupSearchDocumentMap(docs)\n this.options = options\n\n /* Set up document index */\n this.index = lunr(function () {\n this.metadataWhitelist = [\"position\"]\n this.b(0)\n\n /* Set up (multi-)language support */\n if (config.lang.length === 1 && config.lang[0] !== \"en\") {\n // @ts-expect-error - namespace indexing not supported\n this.use(lunr[config.lang[0]])\n } else if (config.lang.length > 1) {\n this.use(lunr.multiLanguage(...config.lang))\n }\n\n /* Set up custom tokenizer (must be after language setup) */\n this.tokenizer = tokenize as typeof lunr.tokenizer\n lunr.tokenizer.separator = new RegExp(config.separator)\n\n /* Set up custom segmenter, if loaded */\n lunr.segmenter = \"TinySegmenter\" in lunr\n ? new lunr.TinySegmenter()\n : undefined\n\n /* Compute functions to be removed from the pipeline */\n const fns = difference([\n \"trimmer\", \"stopWordFilter\", \"stemmer\"\n ], config.pipeline)\n\n /* Remove functions from the pipeline for registered languages */\n for (const lang of config.lang.map(language => (\n // @ts-expect-error - namespace indexing not supported\n language === \"en\" ? lunr : lunr[language]\n )))\n for (const fn of fns) {\n this.pipeline.remove(lang[fn])\n this.searchPipeline.remove(lang[fn])\n }\n\n /* Set up index reference */\n this.ref(\"location\")\n\n /* Set up index fields */\n this.field(\"title\", { boost: 1e3, extractor: field(\"title\") })\n this.field(\"text\", { boost: 1e0, extractor: field(\"text\") })\n this.field(\"tags\", { boost: 1e6, extractor: field(\"tags\") })\n\n /* Add documents to index */\n for (const doc of docs)\n this.add(doc, { boost: doc.boost })\n })\n }\n\n /**\n * Search for matching documents\n *\n * @param query - Search query\n *\n * @returns Search result\n */\n public search(query: string): SearchResult {\n\n // Experimental Chinese segmentation\n query = query.replace(/\\p{sc=Han}+/gu, value => {\n return [...segment(value, this.index.invertedIndex)]\n .join(\"* \")\n })\n\n // @todo: move segmenter (above) into transformSearchQuery\n query = transformSearchQuery(query)\n if (!query)\n return { items: [] }\n\n /* Parse query to extract clauses for analysis */\n const clauses = parseSearchQuery(query)\n .filter(clause => (\n clause.presence !== lunr.Query.presence.PROHIBITED\n ))\n\n /* Perform search and post-process results */\n const groups = this.index.search(query)\n\n /* Apply post-query boosts based on title and search query terms */\n .reduce((item, { ref, score, matchData }) => {\n let doc = this.map.get(ref)\n if (typeof doc !== \"undefined\") {\n\n /* Shallow copy document */\n doc = { ...doc }\n if (doc.tags)\n doc.tags = [...doc.tags]\n\n /* Compute and analyze search query terms */\n const terms = getSearchQueryTerms(\n clauses,\n Object.keys(matchData.metadata)\n )\n\n /* Highlight matches in fields */\n for (const field of this.index.fields) {\n if (typeof doc[field] === \"undefined\")\n continue\n\n /* Collect positions from matches */\n const positions: Position[] = []\n for (const match of Object.values(matchData.metadata))\n if (typeof match[field] !== \"undefined\")\n positions.push(...match[field].position)\n\n /* Skip highlighting, if no positions were collected */\n if (!positions.length)\n continue\n\n /* Load table and determine highlighting method */\n const table = this.table.get([doc.location, field].join(\":\"))!\n const fn = Array.isArray(doc[field])\n ? highlightAll\n : highlight\n\n // @ts-expect-error - stop moaning, TypeScript!\n doc[field] = fn(doc[field], table, positions, field !== \"text\")\n }\n\n /* Highlight title and text and apply post-query boosts */\n const boost = +!doc.parent +\n Object.values(terms)\n .filter(t => t).length /\n Object.keys(terms).length\n\n /* Append item */\n item.push({\n ...doc,\n score: score * (1 + boost ** 2),\n terms\n })\n }\n return item\n }, [])\n\n /* Sort search results again after applying boosts */\n .sort((a, b) => b.score - a.score)\n\n /* Group search results by article */\n .reduce((items, result) => {\n const doc = this.map.get(result.location)\n if (typeof doc !== \"undefined\") {\n const ref = doc.parent\n ? doc.parent.location\n : doc.location\n items.set(ref, [...items.get(ref) || [], result])\n }\n return items\n }, new Map())\n\n /* Ensure that every item set has an article */\n for (const [ref, items] of groups)\n if (!items.find(item => item.location === ref)) {\n const doc = this.map.get(ref)!\n items.push({ ...doc, score: 0, terms: {} })\n }\n\n /* Generate search suggestions, if desired */\n let suggest: string[] | undefined\n if (this.options.suggest) {\n const titles = this.index.query(builder => {\n for (const clause of clauses)\n builder.term(clause.term, {\n fields: [\"title\"],\n presence: lunr.Query.presence.REQUIRED,\n wildcard: lunr.Query.wildcard.TRAILING\n })\n })\n\n /* Retrieve suggestions for best match */\n suggest = titles.length\n ? Object.keys(titles[0].matchData.metadata)\n : []\n }\n\n /* Return search result */\n return {\n items: [...groups.values()],\n ...typeof suggest !== \"undefined\" && { suggest }\n }\n }\n}\n"], - "mappings": "6lCAAA,IAAAA,GAAAC,GAAA,CAAAC,EAAAC,KAAA;AAAA;AAAA;AAAA;AAAA,IAME,UAAU,CAiCZ,IAAIC,EAAO,SAAUC,EAAQ,CAC3B,IAAIC,EAAU,IAAIF,EAAK,QAEvB,OAAAE,EAAQ,SAAS,IACfF,EAAK,QACLA,EAAK,eACLA,EAAK,OACP,EAEAE,EAAQ,eAAe,IACrBF,EAAK,OACP,EAEAC,EAAO,KAAKC,EAASA,CAAO,EACrBA,EAAQ,MAAM,CACvB,EAEAF,EAAK,QAAU,QACf;AAAA;AAAA;AAAA,GASAA,EAAK,MAAQ,CAAC,EASdA,EAAK,MAAM,KAAQ,SAAUG,EAAQ,CAEnC,OAAO,SAAUC,EAAS,CACpBD,EAAO,SAAW,QAAQ,MAC5B,QAAQ,KAAKC,CAAO,CAExB,CAEF,EAAG,IAAI,EAaPJ,EAAK,MAAM,S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KAAKH,CAAI,GAAMI,EAAI,KAAKJ,CAAI,GAAK,CAAEK,EAAI,KAAKL,CAAI,KACrDD,EAAIC,EAER,CAEA,OAAAG,EAAKP,EACLQ,EAAMzB,EACFwB,EAAG,KAAKJ,CAAC,GAAKK,EAAI,KAAKL,CAAC,IAC1BI,EAAKjB,EACLa,EAAIA,EAAE,QAAQI,EAAG,EAAE,GAKjBD,GAAW,MACbH,EAAIG,EAAQ,YAAY,EAAIH,EAAE,OAAO,CAAC,GAGjCA,CACT,EAEA,OAAO,SAAUhD,EAAO,CACtB,OAAOA,EAAM,OAAO+C,CAAa,CACnC,CACF,EAAG,EAEHpG,EAAK,SAAS,iBAAiBA,EAAK,QAAS,SAAS,EACtD;AAAA;AAAA;AAAA,GAkBAA,EAAK,uBAAyB,SAAU8G,EAAW,CACjD,IAAIC,EAAQD,EAAU,OAAO,SAAU7D,EAAM+D,EAAU,CACrD,OAAA/D,EAAK+D,CAAQ,EAAIA,EACV/D,CACT,EAAG,CAAC,CAAC,EAEL,OAAO,SAAUI,EAAO,CACtB,GAAIA,GAAS0D,EAAM1D,EAAM,SAAS,CAAC,IAAMA,EAAM,SAAS,EAAG,OAAOA,CACpE,CACF,EAeArD,EAAK,eAAiBA,EAAK,uBAAuB,CAChD,IACA,OACA,QACA,SACA,QACA,MACA,SACA,OACA,KACA,QACA,KACA,MACA,MACA,MACA,KACA,KACA,KACA,UACA,OACA,MACA,KACA,MACA,SACA,QACA,OACA,MACA,KACA,OACA,SACA,OACA,OACA,QACA,MACA,OACA,MACA,MACA,MACA,MACA,OACA,KACA,MACA,OACA,MACA,MACA,MACA,UACA,IACA,KACA,KACA,OACA,KACA,KACA,MACA,OACA,QACA,MACA,OACA,SACA,MACA,KACA,QACA,OACA,OACA,KACA,UACA,KACA,MACA,MACA,KACA,MACA,QACA,KACA,OACA,KACA,QACA,MACA,MACA,SACA,OACA,MACA,OACA,MACA,SACA,QACA,KACA,OACA,OACA,OACA,MACA,QACA,OACA,OACA,QACA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BAAkBD,CAAK,oCAA+B,EACnE,QAAQ,KAAKC,CAAG,EACT,CACL,OACA,KAAM,CAAE,MAAO,CAAC,CAAE,CACpB,CACF,CAGF,QACE,MAAM,IAAI,UAAU,sBAAsB,CAC9C,CACF,GAOA,KAAK,KAAO,GAAAC,QAGZ,iBAAiB,UAAiBC,GAAMb,EAAA,wBACtC,YAAY,MAAMO,GAAQM,EAAG,IAAI,CAAC,CACpC,EAAC", + "sourcesContent": ["/**\n * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9\n * Copyright (C) 2020 Oliver Nightingale\n * @license MIT\n */\n\n;(function(){\n\n/**\n * A convenience function for configuring and constructing\n * a new lunr Index.\n *\n * A lunr.Builder instance is created and the pipeline setup\n * with a trimmer, stop word filter and stemmer.\n *\n * This builder object is yielded to the configuration function\n * that is passed as a parameter, allowing the list of fields\n * and other builder parameters to be customised.\n *\n * All documents _must_ be added within the passed config function.\n *\n * @example\n * var idx = lunr(function () {\n * this.field('title')\n * this.field('body')\n * this.ref('id')\n *\n * documents.forEach(function (doc) {\n * this.add(doc)\n * }, this)\n * })\n *\n * @see {@link lunr.Builder}\n * @see {@link lunr.Pipeline}\n * @see {@link lunr.trimmer}\n * @see {@link lunr.stopWordFilter}\n * @see {@link lunr.stemmer}\n * @namespace {function} lunr\n */\nvar lunr = function (config) {\n var builder = new lunr.Builder\n\n builder.pipeline.add(\n lunr.trimmer,\n lunr.stopWordFilter,\n lunr.stemmer\n )\n\n builder.searchPipeline.add(\n lunr.stemmer\n )\n\n config.call(builder, builder)\n return builder.build()\n}\n\nlunr.version = \"2.3.9\"\n/*!\n * lunr.utils\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * A namespace containing utils for the rest of the lunr library\n * @namespace lunr.utils\n */\nlunr.utils = {}\n\n/**\n * Print a warning message to the console.\n *\n * @param {String} message The message to be printed.\n * @memberOf lunr.utils\n * @function\n */\nlunr.utils.warn = (function (global) {\n /* eslint-disable no-console */\n return function (message) {\n if (global.console && console.warn) {\n console.warn(message)\n }\n }\n /* eslint-enable no-console */\n})(this)\n\n/**\n * Convert an object to a string.\n *\n * In the case of `null` and `undefined` the function returns\n * the empty string, in all other cases the result of calling\n * `toString` on the passed object is returned.\n *\n * @param {Any} obj The object to convert to a string.\n * @return {String} string representation of the passed object.\n * @memberOf lunr.utils\n */\nlunr.utils.asString = function (obj) {\n if (obj === void 0 || obj === null) {\n return \"\"\n } else {\n return obj.toString()\n }\n}\n\n/**\n * Clones an object.\n *\n * Will create a copy of an existing object such that any mutations\n * on the copy cannot affect the original.\n *\n * Only shallow objects are supported, passing a nested object to this\n * function will cause a TypeError.\n *\n * Objects with primitives, and arrays of primitives are supported.\n *\n * @param {Object} obj The object to clone.\n * @return {Object} a clone of the passed object.\n * @throws {TypeError} when a nested object is passed.\n * @memberOf Utils\n */\nlunr.utils.clone = function (obj) {\n if (obj === null || obj === undefined) {\n return obj\n }\n\n var clone = Object.create(null),\n keys = Object.keys(obj)\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i],\n val = obj[key]\n\n if (Array.isArray(val)) {\n clone[key] = val.slice()\n continue\n }\n\n if (typeof val === 'string' ||\n typeof val === 'number' ||\n typeof val === 'boolean') {\n clone[key] = val\n continue\n }\n\n throw new TypeError(\"clone is not deep and does not support nested objects\")\n }\n\n return clone\n}\nlunr.FieldRef = function (docRef, fieldName, stringValue) {\n this.docRef = docRef\n this.fieldName = fieldName\n this._stringValue = stringValue\n}\n\nlunr.FieldRef.joiner = \"/\"\n\nlunr.FieldRef.fromString = function (s) {\n var n = s.indexOf(lunr.FieldRef.joiner)\n\n if (n === -1) {\n throw \"malformed field ref string\"\n }\n\n var fieldRef = s.slice(0, n),\n docRef = s.slice(n + 1)\n\n return new lunr.FieldRef (docRef, fieldRef, s)\n}\n\nlunr.FieldRef.prototype.toString = function () {\n if (this._stringValue == undefined) {\n this._stringValue = this.fieldName + lunr.FieldRef.joiner + this.docRef\n }\n\n return this._stringValue\n}\n/*!\n * lunr.Set\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * A lunr set.\n *\n * @constructor\n */\nlunr.Set = function (elements) {\n this.elements = Object.create(null)\n\n if (elements) {\n this.length = elements.length\n\n for (var i = 0; i < this.length; i++) {\n this.elements[elements[i]] = true\n }\n } else {\n this.length = 0\n }\n}\n\n/**\n * A complete set that contains all elements.\n *\n * @static\n * @readonly\n * @type {lunr.Set}\n */\nlunr.Set.complete = {\n intersect: function (other) {\n return other\n },\n\n union: function () {\n return this\n },\n\n contains: function () {\n return true\n }\n}\n\n/**\n * An empty set that contains no elements.\n *\n * @static\n * @readonly\n * @type {lunr.Set}\n */\nlunr.Set.empty = {\n intersect: function () {\n return this\n },\n\n union: function (other) {\n return other\n },\n\n contains: function () {\n return false\n }\n}\n\n/**\n * Returns true if this set contains the specified object.\n *\n * @param {object} object - Object whose presence in this set is to be tested.\n * @returns {boolean} - True if this set contains the specified object.\n */\nlunr.Set.prototype.contains = function (object) {\n return !!this.elements[object]\n}\n\n/**\n * Returns a new set containing only the elements that are present in both\n * this set and the specified set.\n *\n * @param {lunr.Set} other - set to intersect with this set.\n * @returns {lunr.Set} a new set that is the intersection of this and the specified set.\n */\n\nlunr.Set.prototype.intersect = function (other) {\n var a, b, elements, intersection = []\n\n if (other === lunr.Set.complete) {\n return this\n }\n\n if (other === lunr.Set.empty) {\n return other\n }\n\n if (this.length < other.length) {\n a = this\n b = other\n } else {\n a = other\n b = this\n }\n\n elements = Object.keys(a.elements)\n\n for (var i = 0; i < elements.length; i++) {\n var element = elements[i]\n if (element in b.elements) {\n intersection.push(element)\n }\n }\n\n return new lunr.Set (intersection)\n}\n\n/**\n * Returns a new set combining the elements of this and the specified set.\n *\n * @param {lunr.Set} other - set to union with this set.\n * @return {lunr.Set} a new set that is the union of this and the specified set.\n */\n\nlunr.Set.prototype.union = function (other) {\n if (other === lunr.Set.complete) {\n return lunr.Set.complete\n }\n\n if (other === lunr.Set.empty) {\n return this\n }\n\n return new lunr.Set(Object.keys(this.elements).concat(Object.keys(other.elements)))\n}\n/**\n * A function to calculate the inverse document frequency for\n * a posting. This is shared between the builder and the index\n *\n * @private\n * @param {object} posting - The posting for a given term\n * @param {number} documentCount - The total number of documents.\n */\nlunr.idf = function (posting, documentCount) {\n var documentsWithTerm = 0\n\n for (var fieldName in posting) {\n if (fieldName == '_index') continue // Ignore the term index, its not a field\n documentsWithTerm += Object.keys(posting[fieldName]).length\n }\n\n var x = (documentCount - documentsWithTerm + 0.5) / (documentsWithTerm + 0.5)\n\n return Math.log(1 + Math.abs(x))\n}\n\n/**\n * A token wraps a string representation of a token\n * as it is passed through the text processing pipeline.\n *\n * @constructor\n * @param {string} [str=''] - The string token being wrapped.\n * @param {object} [metadata={}] - Metadata associated with this token.\n */\nlunr.Token = function (str, metadata) {\n this.str = str || \"\"\n this.metadata = metadata || {}\n}\n\n/**\n * Returns the token string that is being wrapped by this object.\n *\n * @returns {string}\n */\nlunr.Token.prototype.toString = function () {\n return this.str\n}\n\n/**\n * A token update function is used when updating or optionally\n * when cloning a token.\n *\n * @callback lunr.Token~updateFunction\n * @param {string} str - The string representation of the token.\n * @param {Object} metadata - All metadata associated with this token.\n */\n\n/**\n * Applies the given function to the wrapped string token.\n *\n * @example\n * token.update(function (str, metadata) {\n * return str.toUpperCase()\n * })\n *\n * @param {lunr.Token~updateFunction} fn - A function to apply to the token string.\n * @returns {lunr.Token}\n */\nlunr.Token.prototype.update = function (fn) {\n this.str = fn(this.str, this.metadata)\n return this\n}\n\n/**\n * Creates a clone of this token. Optionally a function can be\n * applied to the cloned token.\n *\n * @param {lunr.Token~updateFunction} [fn] - An optional function to apply to the cloned token.\n * @returns {lunr.Token}\n */\nlunr.Token.prototype.clone = function (fn) {\n fn = fn || function (s) { return s }\n return new lunr.Token (fn(this.str, this.metadata), this.metadata)\n}\n/*!\n * lunr.tokenizer\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * A function for splitting a string into tokens ready to be inserted into\n * the search index. Uses `lunr.tokenizer.separator` to split strings, change\n * the value of this property to change how strings are split into tokens.\n *\n * This tokenizer will convert its parameter to a string by calling `toString` and\n * then will split this string on the character in `lunr.tokenizer.separator`.\n * Arrays will have their elements converted to strings and wrapped in a lunr.Token.\n *\n * Optional metadata can be passed to the tokenizer, this metadata will be cloned and\n * added as metadata to every token that is created from the object to be tokenized.\n *\n * @static\n * @param {?(string|object|object[])} obj - The object to convert into tokens\n * @param {?object} metadata - Optional metadata to associate with every token\n * @returns {lunr.Token[]}\n * @see {@link lunr.Pipeline}\n */\nlunr.tokenizer = function (obj, metadata) {\n if (obj == null || obj == undefined) {\n return []\n }\n\n if (Array.isArray(obj)) {\n return obj.map(function (t) {\n return new lunr.Token(\n lunr.utils.asString(t).toLowerCase(),\n lunr.utils.clone(metadata)\n )\n })\n }\n\n var str = obj.toString().toLowerCase(),\n len = str.length,\n tokens = []\n\n for (var sliceEnd = 0, sliceStart = 0; sliceEnd <= len; sliceEnd++) {\n var char = str.charAt(sliceEnd),\n sliceLength = sliceEnd - sliceStart\n\n if ((char.match(lunr.tokenizer.separator) || sliceEnd == len)) {\n\n if (sliceLength > 0) {\n var tokenMetadata = lunr.utils.clone(metadata) || {}\n tokenMetadata[\"position\"] = [sliceStart, sliceLength]\n tokenMetadata[\"index\"] = tokens.length\n\n tokens.push(\n new lunr.Token (\n str.slice(sliceStart, sliceEnd),\n tokenMetadata\n )\n )\n }\n\n sliceStart = sliceEnd + 1\n }\n\n }\n\n return tokens\n}\n\n/**\n * The separator used to split a string into tokens. Override this property to change the behaviour of\n * `lunr.tokenizer` behaviour when tokenizing strings. By default this splits on whitespace and hyphens.\n *\n * @static\n * @see lunr.tokenizer\n */\nlunr.tokenizer.separator = /[\\s\\-]+/\n/*!\n * lunr.Pipeline\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * lunr.Pipelines maintain an ordered list of functions to be applied to all\n * tokens in documents entering the search index and queries being ran against\n * the index.\n *\n * An instance of lunr.Index created with the lunr shortcut will contain a\n * pipeline with a stop word filter and an English language stemmer. Extra\n * functions can be added before or after either of these functions or these\n * default functions can be removed.\n *\n * When run the pipeline will call each function in turn, passing a token, the\n * index of that token in the original list of all tokens and finally a list of\n * all the original tokens.\n *\n * The output of functions in the pipeline will be passed to the next function\n * in the pipeline. To exclude a token from entering the index the function\n * should return undefined, the rest of the pipeline will not be called with\n * this token.\n *\n * For serialisation of pipelines to work, all functions used in an instance of\n * a pipeline should be registered with lunr.Pipeline. Registered functions can\n * then be loaded. If trying to load a serialised pipeline that uses functions\n * that are not registered an error will be thrown.\n *\n * If not planning on serialising the pipeline then registering pipeline functions\n * is not necessary.\n *\n * @constructor\n */\nlunr.Pipeline = function () {\n this._stack = []\n}\n\nlunr.Pipeline.registeredFunctions = Object.create(null)\n\n/**\n * A pipeline function maps lunr.Token to lunr.Token. A lunr.Token contains the token\n * string as well as all known metadata. A pipeline function can mutate the token string\n * or mutate (or add) metadata for a given token.\n *\n * A pipeline function can indicate that the passed token should be discarded by returning\n * null, undefined or an empty string. This token will not be passed to any downstream pipeline\n * functions and will not be added to the index.\n *\n * Multiple tokens can be returned by returning an array of tokens. Each token will be passed\n * to any downstream pipeline functions and all will returned tokens will be added to the index.\n *\n * Any number of pipeline functions may be chained together using a lunr.Pipeline.\n *\n * @interface lunr.PipelineFunction\n * @param {lunr.Token} token - A token from the document being processed.\n * @param {number} i - The index of this token in the complete list of tokens for this document/field.\n * @param {lunr.Token[]} tokens - All tokens for this document/field.\n * @returns {(?lunr.Token|lunr.Token[])}\n */\n\n/**\n * Register a function with the pipeline.\n *\n * Functions that are used in the pipeline should be registered if the pipeline\n * needs to be serialised, or a serialised pipeline needs to be loaded.\n *\n * Registering a function does not add it to a pipeline, functions must still be\n * added to instances of the pipeline for them to be used when running a pipeline.\n *\n * @param {lunr.PipelineFunction} fn - The function to check for.\n * @param {String} label - The label to register this function with\n */\nlunr.Pipeline.registerFunction = function (fn, label) {\n if (label in this.registeredFunctions) {\n lunr.utils.warn('Overwriting existing registered function: ' + label)\n }\n\n fn.label = label\n lunr.Pipeline.registeredFunctions[fn.label] = fn\n}\n\n/**\n * Warns if the function is not registered as a Pipeline function.\n *\n * @param {lunr.PipelineFunction} fn - The function to check for.\n * @private\n */\nlunr.Pipeline.warnIfFunctionNotRegistered = function (fn) {\n var isRegistered = fn.label && (fn.label in this.registeredFunctions)\n\n if (!isRegistered) {\n lunr.utils.warn('Function is not registered with pipeline. This may cause problems when serialising the index.\\n', fn)\n }\n}\n\n/**\n * Loads a previously serialised pipeline.\n *\n * All functions to be loaded must already be registered with lunr.Pipeline.\n * If any function from the serialised data has not been registered then an\n * error will be thrown.\n *\n * @param {Object} serialised - The serialised pipeline to load.\n * @returns {lunr.Pipeline}\n */\nlunr.Pipeline.load = function (serialised) {\n var pipeline = new lunr.Pipeline\n\n serialised.forEach(function (fnName) {\n var fn = lunr.Pipeline.registeredFunctions[fnName]\n\n if (fn) {\n pipeline.add(fn)\n } else {\n throw new Error('Cannot load unregistered function: ' + fnName)\n }\n })\n\n return pipeline\n}\n\n/**\n * Adds new functions to the end of the pipeline.\n *\n * Logs a warning if the function has not been registered.\n *\n * @param {lunr.PipelineFunction[]} functions - Any number of functions to add to the pipeline.\n */\nlunr.Pipeline.prototype.add = function () {\n var fns = Array.prototype.slice.call(arguments)\n\n fns.forEach(function (fn) {\n lunr.Pipeline.warnIfFunctionNotRegistered(fn)\n this._stack.push(fn)\n }, this)\n}\n\n/**\n * Adds a single function after a function that already exists in the\n * pipeline.\n *\n * Logs a warning if the function has not been registered.\n *\n * @param {lunr.PipelineFunction} existingFn - A function that already exists in the pipeline.\n * @param {lunr.PipelineFunction} newFn - The new function to add to the pipeline.\n */\nlunr.Pipeline.prototype.after = function (existingFn, newFn) {\n lunr.Pipeline.warnIfFunctionNotRegistered(newFn)\n\n var pos = this._stack.indexOf(existingFn)\n if (pos == -1) {\n throw new Error('Cannot find existingFn')\n }\n\n pos = pos + 1\n this._stack.splice(pos, 0, newFn)\n}\n\n/**\n * Adds a single function before a function that already exists in the\n * pipeline.\n *\n * Logs a warning if the function has not been registered.\n *\n * @param {lunr.PipelineFunction} existingFn - A function that already exists in the pipeline.\n * @param {lunr.PipelineFunction} newFn - The new function to add to the pipeline.\n */\nlunr.Pipeline.prototype.before = function (existingFn, newFn) {\n lunr.Pipeline.warnIfFunctionNotRegistered(newFn)\n\n var pos = this._stack.indexOf(existingFn)\n if (pos == -1) {\n throw new Error('Cannot find existingFn')\n }\n\n this._stack.splice(pos, 0, newFn)\n}\n\n/**\n * Removes a function from the pipeline.\n *\n * @param {lunr.PipelineFunction} fn The function to remove from the pipeline.\n */\nlunr.Pipeline.prototype.remove = function (fn) {\n var pos = this._stack.indexOf(fn)\n if (pos == -1) {\n return\n }\n\n this._stack.splice(pos, 1)\n}\n\n/**\n * Runs the current list of functions that make up the pipeline against the\n * passed tokens.\n *\n * @param {Array} tokens The tokens to run through the pipeline.\n * @returns {Array}\n */\nlunr.Pipeline.prototype.run = function (tokens) {\n var stackLength = this._stack.length\n\n for (var i = 0; i < stackLength; i++) {\n var fn = this._stack[i]\n var memo = []\n\n for (var j = 0; j < tokens.length; j++) {\n var result = fn(tokens[j], j, tokens)\n\n if (result === null || result === void 0 || result === '') continue\n\n if (Array.isArray(result)) {\n for (var k = 0; k < result.length; k++) {\n memo.push(result[k])\n }\n } else {\n memo.push(result)\n }\n }\n\n tokens = memo\n }\n\n return tokens\n}\n\n/**\n * Convenience method for passing a string through a pipeline and getting\n * strings out. This method takes care of wrapping the passed string in a\n * token and mapping the resulting tokens back to strings.\n *\n * @param {string} str - The string to pass through the pipeline.\n * @param {?object} metadata - Optional metadata to associate with the token\n * passed to the pipeline.\n * @returns {string[]}\n */\nlunr.Pipeline.prototype.runString = function (str, metadata) {\n var token = new lunr.Token (str, metadata)\n\n return this.run([token]).map(function (t) {\n return t.toString()\n })\n}\n\n/**\n * Resets the pipeline by removing any existing processors.\n *\n */\nlunr.Pipeline.prototype.reset = function () {\n this._stack = []\n}\n\n/**\n * Returns a representation of the pipeline ready for serialisation.\n *\n * Logs a warning if the function has not been registered.\n *\n * @returns {Array}\n */\nlunr.Pipeline.prototype.toJSON = function () {\n return this._stack.map(function (fn) {\n lunr.Pipeline.warnIfFunctionNotRegistered(fn)\n\n return fn.label\n })\n}\n/*!\n * lunr.Vector\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * A vector is used to construct the vector space of documents and queries. These\n * vectors support operations to determine the similarity between two documents or\n * a document and a query.\n *\n * Normally no parameters are required for initializing a vector, but in the case of\n * loading a previously dumped vector the raw elements can be provided to the constructor.\n *\n * For performance reasons vectors are implemented with a flat array, where an elements\n * index is immediately followed by its value. E.g. [index, value, index, value]. This\n * allows the underlying array to be as sparse as possible and still offer decent\n * performance when being used for vector calculations.\n *\n * @constructor\n * @param {Number[]} [elements] - The flat list of element index and element value pairs.\n */\nlunr.Vector = function (elements) {\n this._magnitude = 0\n this.elements = elements || []\n}\n\n\n/**\n * Calculates the position within the vector to insert a given index.\n *\n * This is used internally by insert and upsert. If there are duplicate indexes then\n * the position is returned as if the value for that index were to be updated, but it\n * is the callers responsibility to check whether there is a duplicate at that index\n *\n * @param {Number} insertIdx - The index at which the element should be inserted.\n * @returns {Number}\n */\nlunr.Vector.prototype.positionForIndex = function (index) {\n // For an empty vector the tuple can be inserted at the beginning\n if (this.elements.length == 0) {\n return 0\n }\n\n var start = 0,\n end = this.elements.length / 2,\n sliceLength = end - start,\n pivotPoint = Math.floor(sliceLength / 2),\n pivotIndex = this.elements[pivotPoint * 2]\n\n while (sliceLength > 1) {\n if (pivotIndex < index) {\n start = pivotPoint\n }\n\n if (pivotIndex > index) {\n end = pivotPoint\n }\n\n if (pivotIndex == index) {\n break\n }\n\n sliceLength = end - start\n pivotPoint = start + Math.floor(sliceLength / 2)\n pivotIndex = this.elements[pivotPoint * 2]\n }\n\n if (pivotIndex == index) {\n return pivotPoint * 2\n }\n\n if (pivotIndex > index) {\n return pivotPoint * 2\n }\n\n if (pivotIndex < index) {\n return (pivotPoint + 1) * 2\n }\n}\n\n/**\n * Inserts an element at an index within the vector.\n *\n * Does not allow duplicates, will throw an error if there is already an entry\n * for this index.\n *\n * @param {Number} insertIdx - The index at which the element should be inserted.\n * @param {Number} val - The value to be inserted into the vector.\n */\nlunr.Vector.prototype.insert = function (insertIdx, val) {\n this.upsert(insertIdx, val, function () {\n throw \"duplicate index\"\n })\n}\n\n/**\n * Inserts or updates an existing index within the vector.\n *\n * @param {Number} insertIdx - The index at which the element should be inserted.\n * @param {Number} val - The value to be inserted into the vector.\n * @param {function} fn - A function that is called for updates, the existing value and the\n * requested value are passed as arguments\n */\nlunr.Vector.prototype.upsert = function (insertIdx, val, fn) {\n this._magnitude = 0\n var position = this.positionForIndex(insertIdx)\n\n if (this.elements[position] == insertIdx) {\n this.elements[position + 1] = fn(this.elements[position + 1], val)\n } else {\n this.elements.splice(position, 0, insertIdx, val)\n }\n}\n\n/**\n * Calculates the magnitude of this vector.\n *\n * @returns {Number}\n */\nlunr.Vector.prototype.magnitude = function () {\n if (this._magnitude) return this._magnitude\n\n var sumOfSquares = 0,\n elementsLength = this.elements.length\n\n for (var i = 1; i < elementsLength; i += 2) {\n var val = this.elements[i]\n sumOfSquares += val * val\n }\n\n return this._magnitude = Math.sqrt(sumOfSquares)\n}\n\n/**\n * Calculates the dot product of this vector and another vector.\n *\n * @param {lunr.Vector} otherVector - The vector to compute the dot product with.\n * @returns {Number}\n */\nlunr.Vector.prototype.dot = function (otherVector) {\n var dotProduct = 0,\n a = this.elements, b = otherVector.elements,\n aLen = a.length, bLen = b.length,\n aVal = 0, bVal = 0,\n i = 0, j = 0\n\n while (i < aLen && j < bLen) {\n aVal = a[i], bVal = b[j]\n if (aVal < bVal) {\n i += 2\n } else if (aVal > bVal) {\n j += 2\n } else if (aVal == bVal) {\n dotProduct += a[i + 1] * b[j + 1]\n i += 2\n j += 2\n }\n }\n\n return dotProduct\n}\n\n/**\n * Calculates the similarity between this vector and another vector.\n *\n * @param {lunr.Vector} otherVector - The other vector to calculate the\n * similarity with.\n * @returns {Number}\n */\nlunr.Vector.prototype.similarity = function (otherVector) {\n return this.dot(otherVector) / this.magnitude() || 0\n}\n\n/**\n * Converts the vector to an array of the elements within the vector.\n *\n * @returns {Number[]}\n */\nlunr.Vector.prototype.toArray = function () {\n var output = new Array (this.elements.length / 2)\n\n for (var i = 1, j = 0; i < this.elements.length; i += 2, j++) {\n output[j] = this.elements[i]\n }\n\n return output\n}\n\n/**\n * A JSON serializable representation of the vector.\n *\n * @returns {Number[]}\n */\nlunr.Vector.prototype.toJSON = function () {\n return this.elements\n}\n/* eslint-disable */\n/*!\n * lunr.stemmer\n * Copyright (C) 2020 Oliver Nightingale\n * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt\n */\n\n/**\n * lunr.stemmer is an english language stemmer, this is a JavaScript\n * implementation of the PorterStemmer taken from http://tartarus.org/~martin\n *\n * @static\n * @implements {lunr.PipelineFunction}\n * @param {lunr.Token} token - The string to stem\n * @returns {lunr.Token}\n * @see {@link lunr.Pipeline}\n * @function\n */\nlunr.stemmer = (function(){\n var step2list = {\n \"ational\" : \"ate\",\n \"tional\" : \"tion\",\n \"enci\" : \"ence\",\n \"anci\" : \"ance\",\n \"izer\" : \"ize\",\n \"bli\" : \"ble\",\n \"alli\" : \"al\",\n \"entli\" : \"ent\",\n \"eli\" : \"e\",\n \"ousli\" : \"ous\",\n \"ization\" : \"ize\",\n \"ation\" : \"ate\",\n \"ator\" : \"ate\",\n \"alism\" : \"al\",\n \"iveness\" : \"ive\",\n \"fulness\" : \"ful\",\n \"ousness\" : \"ous\",\n \"aliti\" : \"al\",\n \"iviti\" : \"ive\",\n \"biliti\" : \"ble\",\n \"logi\" : \"log\"\n },\n\n step3list = {\n \"icate\" : \"ic\",\n \"ative\" : \"\",\n \"alize\" : \"al\",\n \"iciti\" : \"ic\",\n \"ical\" : \"ic\",\n \"ful\" : \"\",\n \"ness\" : \"\"\n },\n\n c = \"[^aeiou]\", // consonant\n v = \"[aeiouy]\", // vowel\n C = c + \"[^aeiouy]*\", // consonant sequence\n V = v + \"[aeiou]*\", // vowel sequence\n\n mgr0 = \"^(\" + C + \")?\" + V + C, // [C]VC... is m>0\n meq1 = \"^(\" + C + \")?\" + V + C + \"(\" + V + \")?$\", // [C]VC[V] is m=1\n mgr1 = \"^(\" + C + \")?\" + V + C + V + C, // [C]VCVC... is m>1\n s_v = \"^(\" + C + \")?\" + v; // vowel in stem\n\n var re_mgr0 = new RegExp(mgr0);\n var re_mgr1 = new RegExp(mgr1);\n var re_meq1 = new RegExp(meq1);\n var re_s_v = new RegExp(s_v);\n\n var re_1a = /^(.+?)(ss|i)es$/;\n var re2_1a = /^(.+?)([^s])s$/;\n var re_1b = /^(.+?)eed$/;\n var re2_1b = /^(.+?)(ed|ing)$/;\n var re_1b_2 = /.$/;\n var re2_1b_2 = /(at|bl|iz)$/;\n var re3_1b_2 = new RegExp(\"([^aeiouylsz])\\\\1$\");\n var re4_1b_2 = new RegExp(\"^\" + C + v + \"[^aeiouwxy]$\");\n\n var re_1c = /^(.+?[^aeiou])y$/;\n var re_2 = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;\n\n var re_3 = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;\n\n var re_4 = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;\n var re2_4 = /^(.+?)(s|t)(ion)$/;\n\n var re_5 = /^(.+?)e$/;\n var re_5_1 = /ll$/;\n var re3_5 = new RegExp(\"^\" + C + v + \"[^aeiouwxy]$\");\n\n var porterStemmer = function porterStemmer(w) {\n var stem,\n suffix,\n firstch,\n re,\n re2,\n re3,\n re4;\n\n if (w.length < 3) { return w; }\n\n firstch = w.substr(0,1);\n if (firstch == \"y\") {\n w = firstch.toUpperCase() + w.substr(1);\n }\n\n // Step 1a\n re = re_1a\n re2 = re2_1a;\n\n if (re.test(w)) { w = w.replace(re,\"$1$2\"); }\n else if (re2.test(w)) { w = w.replace(re2,\"$1$2\"); }\n\n // Step 1b\n re = re_1b;\n re2 = re2_1b;\n if (re.test(w)) {\n var fp = re.exec(w);\n re = re_mgr0;\n if (re.test(fp[1])) {\n re = re_1b_2;\n w = w.replace(re,\"\");\n }\n } else if (re2.test(w)) {\n var fp = re2.exec(w);\n stem = fp[1];\n re2 = re_s_v;\n if (re2.test(stem)) {\n w = stem;\n re2 = re2_1b_2;\n re3 = re3_1b_2;\n re4 = re4_1b_2;\n if (re2.test(w)) { w = w + \"e\"; }\n else if (re3.test(w)) { re = re_1b_2; w = w.replace(re,\"\"); }\n else if (re4.test(w)) { w = w + \"e\"; }\n }\n }\n\n // 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)\n re = re_1c;\n if (re.test(w)) {\n var fp = re.exec(w);\n stem = fp[1];\n w = stem + \"i\";\n }\n\n // Step 2\n re = re_2;\n if (re.test(w)) {\n var fp = re.exec(w);\n stem = fp[1];\n suffix = fp[2];\n re = re_mgr0;\n if (re.test(stem)) {\n w = stem + step2list[suffix];\n }\n }\n\n // Step 3\n re = re_3;\n if (re.test(w)) {\n var fp = re.exec(w);\n stem = fp[1];\n suffix = fp[2];\n re = re_mgr0;\n if (re.test(stem)) {\n w = stem + step3list[suffix];\n }\n }\n\n // Step 4\n re = re_4;\n re2 = re2_4;\n if (re.test(w)) {\n var fp = re.exec(w);\n stem = fp[1];\n re = re_mgr1;\n if (re.test(stem)) {\n w = stem;\n }\n } else if (re2.test(w)) {\n var fp = re2.exec(w);\n stem = fp[1] + fp[2];\n re2 = re_mgr1;\n if (re2.test(stem)) {\n w = stem;\n }\n }\n\n // Step 5\n re = re_5;\n if (re.test(w)) {\n var fp = re.exec(w);\n stem = fp[1];\n re = re_mgr1;\n re2 = re_meq1;\n re3 = re3_5;\n if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) {\n w = stem;\n }\n }\n\n re = re_5_1;\n re2 = re_mgr1;\n if (re.test(w) && re2.test(w)) {\n re = re_1b_2;\n w = w.replace(re,\"\");\n }\n\n // and turn initial Y back to y\n\n if (firstch == \"y\") {\n w = firstch.toLowerCase() + w.substr(1);\n }\n\n return w;\n };\n\n return function (token) {\n return token.update(porterStemmer);\n }\n})();\n\nlunr.Pipeline.registerFunction(lunr.stemmer, 'stemmer')\n/*!\n * lunr.stopWordFilter\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * lunr.generateStopWordFilter builds a stopWordFilter function from the provided\n * list of stop words.\n *\n * The built in lunr.stopWordFilter is built using this generator and can be used\n * to generate custom stopWordFilters for applications or non English languages.\n *\n * @function\n * @param {Array} token The token to pass through the filter\n * @returns {lunr.PipelineFunction}\n * @see lunr.Pipeline\n * @see lunr.stopWordFilter\n */\nlunr.generateStopWordFilter = function (stopWords) {\n var words = stopWords.reduce(function (memo, stopWord) {\n memo[stopWord] = stopWord\n return memo\n }, {})\n\n return function (token) {\n if (token && words[token.toString()] !== token.toString()) return token\n }\n}\n\n/**\n * lunr.stopWordFilter is an English language stop word list filter, any words\n * contained in the list will not be passed through the filter.\n *\n * This is intended to be used in the Pipeline. If the token does not pass the\n * filter then undefined will be returned.\n *\n * @function\n * @implements {lunr.PipelineFunction}\n * @params {lunr.Token} token - A token to check for being a stop word.\n * @returns {lunr.Token}\n * @see {@link lunr.Pipeline}\n */\nlunr.stopWordFilter = lunr.generateStopWordFilter([\n 'a',\n 'able',\n 'about',\n 'across',\n 'after',\n 'all',\n 'almost',\n 'also',\n 'am',\n 'among',\n 'an',\n 'and',\n 'any',\n 'are',\n 'as',\n 'at',\n 'be',\n 'because',\n 'been',\n 'but',\n 'by',\n 'can',\n 'cannot',\n 'could',\n 'dear',\n 'did',\n 'do',\n 'does',\n 'either',\n 'else',\n 'ever',\n 'every',\n 'for',\n 'from',\n 'get',\n 'got',\n 'had',\n 'has',\n 'have',\n 'he',\n 'her',\n 'hers',\n 'him',\n 'his',\n 'how',\n 'however',\n 'i',\n 'if',\n 'in',\n 'into',\n 'is',\n 'it',\n 'its',\n 'just',\n 'least',\n 'let',\n 'like',\n 'likely',\n 'may',\n 'me',\n 'might',\n 'most',\n 'must',\n 'my',\n 'neither',\n 'no',\n 'nor',\n 'not',\n 'of',\n 'off',\n 'often',\n 'on',\n 'only',\n 'or',\n 'other',\n 'our',\n 'own',\n 'rather',\n 'said',\n 'say',\n 'says',\n 'she',\n 'should',\n 'since',\n 'so',\n 'some',\n 'than',\n 'that',\n 'the',\n 'their',\n 'them',\n 'then',\n 'there',\n 'these',\n 'they',\n 'this',\n 'tis',\n 'to',\n 'too',\n 'twas',\n 'us',\n 'wants',\n 'was',\n 'we',\n 'were',\n 'what',\n 'when',\n 'where',\n 'which',\n 'while',\n 'who',\n 'whom',\n 'why',\n 'will',\n 'with',\n 'would',\n 'yet',\n 'you',\n 'your'\n])\n\nlunr.Pipeline.registerFunction(lunr.stopWordFilter, 'stopWordFilter')\n/*!\n * lunr.trimmer\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * lunr.trimmer is a pipeline function for trimming non word\n * characters from the beginning and end of tokens before they\n * enter the index.\n *\n * This implementation may not work correctly for non latin\n * characters and should either be removed or adapted for use\n * with languages with non-latin characters.\n *\n * @static\n * @implements {lunr.PipelineFunction}\n * @param {lunr.Token} token The token to pass through the filter\n * @returns {lunr.Token}\n * @see lunr.Pipeline\n */\nlunr.trimmer = function (token) {\n return token.update(function (s) {\n return s.replace(/^\\W+/, '').replace(/\\W+$/, '')\n })\n}\n\nlunr.Pipeline.registerFunction(lunr.trimmer, 'trimmer')\n/*!\n * lunr.TokenSet\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * A token set is used to store the unique list of all tokens\n * within an index. Token sets are also used to represent an\n * incoming query to the index, this query token set and index\n * token set are then intersected to find which tokens to look\n * up in the inverted index.\n *\n * A token set can hold multiple tokens, as in the case of the\n * index token set, or it can hold a single token as in the\n * case of a simple query token set.\n *\n * Additionally token sets are used to perform wildcard matching.\n * Leading, contained and trailing wildcards are supported, and\n * from this edit distance matching can also be provided.\n *\n * Token sets are implemented as a minimal finite state automata,\n * where both common prefixes and suffixes are shared between tokens.\n * This helps to reduce the space used for storing the token set.\n *\n * @constructor\n */\nlunr.TokenSet = function () {\n this.final = false\n this.edges = {}\n this.id = lunr.TokenSet._nextId\n lunr.TokenSet._nextId += 1\n}\n\n/**\n * Keeps track of the next, auto increment, identifier to assign\n * to a new tokenSet.\n *\n * TokenSets require a unique identifier to be correctly minimised.\n *\n * @private\n */\nlunr.TokenSet._nextId = 1\n\n/**\n * Creates a TokenSet instance from the given sorted array of words.\n *\n * @param {String[]} arr - A sorted array of strings to create the set from.\n * @returns {lunr.TokenSet}\n * @throws Will throw an error if the input array is not sorted.\n */\nlunr.TokenSet.fromArray = function (arr) {\n var builder = new lunr.TokenSet.Builder\n\n for (var i = 0, len = arr.length; i < len; i++) {\n builder.insert(arr[i])\n }\n\n builder.finish()\n return builder.root\n}\n\n/**\n * Creates a token set from a query clause.\n *\n * @private\n * @param {Object} clause - A single clause from lunr.Query.\n * @param {string} clause.term - The query clause term.\n * @param {number} [clause.editDistance] - The optional edit distance for the term.\n * @returns {lunr.TokenSet}\n */\nlunr.TokenSet.fromClause = function (clause) {\n if ('editDistance' in clause) {\n return lunr.TokenSet.fromFuzzyString(clause.term, clause.editDistance)\n } else {\n return lunr.TokenSet.fromString(clause.term)\n }\n}\n\n/**\n * Creates a token set representing a single string with a specified\n * edit distance.\n *\n * Insertions, deletions, substitutions and transpositions are each\n * treated as an edit distance of 1.\n *\n * Increasing the allowed edit distance will have a dramatic impact\n * on the performance of both creating and intersecting these TokenSets.\n * It is advised to keep the edit distance less than 3.\n *\n * @param {string} str - The string to create the token set from.\n * @param {number} editDistance - The allowed edit distance to match.\n * @returns {lunr.Vector}\n */\nlunr.TokenSet.fromFuzzyString = function (str, editDistance) {\n var root = new lunr.TokenSet\n\n var stack = [{\n node: root,\n editsRemaining: editDistance,\n str: str\n }]\n\n while (stack.length) {\n var frame = stack.pop()\n\n // no edit\n if (frame.str.length > 0) {\n var char = frame.str.charAt(0),\n noEditNode\n\n if (char in frame.node.edges) {\n noEditNode = frame.node.edges[char]\n } else {\n noEditNode = new lunr.TokenSet\n frame.node.edges[char] = noEditNode\n }\n\n if (frame.str.length == 1) {\n noEditNode.final = true\n }\n\n stack.push({\n node: noEditNode,\n editsRemaining: frame.editsRemaining,\n str: frame.str.slice(1)\n })\n }\n\n if (frame.editsRemaining == 0) {\n continue\n }\n\n // insertion\n if (\"*\" in frame.node.edges) {\n var insertionNode = frame.node.edges[\"*\"]\n } else {\n var insertionNode = new lunr.TokenSet\n frame.node.edges[\"*\"] = insertionNode\n }\n\n if (frame.str.length == 0) {\n insertionNode.final = true\n }\n\n stack.push({\n node: insertionNode,\n editsRemaining: frame.editsRemaining - 1,\n str: frame.str\n })\n\n // deletion\n // can only do a deletion if we have enough edits remaining\n // and if there are characters left to delete in the string\n if (frame.str.length > 1) {\n stack.push({\n node: frame.node,\n editsRemaining: frame.editsRemaining - 1,\n str: frame.str.slice(1)\n })\n }\n\n // deletion\n // just removing the last character from the str\n if (frame.str.length == 1) {\n frame.node.final = true\n }\n\n // substitution\n // can only do a substitution if we have enough edits remaining\n // and if there are characters left to substitute\n if (frame.str.length >= 1) {\n if (\"*\" in frame.node.edges) {\n var substitutionNode = frame.node.edges[\"*\"]\n } else {\n var substitutionNode = new lunr.TokenSet\n frame.node.edges[\"*\"] = substitutionNode\n }\n\n if (frame.str.length == 1) {\n substitutionNode.final = true\n }\n\n stack.push({\n node: substitutionNode,\n editsRemaining: frame.editsRemaining - 1,\n str: frame.str.slice(1)\n })\n }\n\n // transposition\n // can only do a transposition if there are edits remaining\n // and there are enough characters to transpose\n if (frame.str.length > 1) {\n var charA = frame.str.charAt(0),\n charB = frame.str.charAt(1),\n transposeNode\n\n if (charB in frame.node.edges) {\n transposeNode = frame.node.edges[charB]\n } else {\n transposeNode = new lunr.TokenSet\n frame.node.edges[charB] = transposeNode\n }\n\n if (frame.str.length == 1) {\n transposeNode.final = true\n }\n\n stack.push({\n node: transposeNode,\n editsRemaining: frame.editsRemaining - 1,\n str: charA + frame.str.slice(2)\n })\n }\n }\n\n return root\n}\n\n/**\n * Creates a TokenSet from a string.\n *\n * The string may contain one or more wildcard characters (*)\n * that will allow wildcard matching when intersecting with\n * another TokenSet.\n *\n * @param {string} str - The string to create a TokenSet from.\n * @returns {lunr.TokenSet}\n */\nlunr.TokenSet.fromString = function (str) {\n var node = new lunr.TokenSet,\n root = node\n\n /*\n * Iterates through all characters within the passed string\n * appending a node for each character.\n *\n * When a wildcard character is found then a self\n * referencing edge is introduced to continually match\n * any number of any characters.\n */\n for (var i = 0, len = str.length; i < len; i++) {\n var char = str[i],\n final = (i == len - 1)\n\n if (char == \"*\") {\n node.edges[char] = node\n node.final = final\n\n } else {\n var next = new lunr.TokenSet\n next.final = final\n\n node.edges[char] = next\n node = next\n }\n }\n\n return root\n}\n\n/**\n * Converts this TokenSet into an array of strings\n * contained within the TokenSet.\n *\n * This is not intended to be used on a TokenSet that\n * contains wildcards, in these cases the results are\n * undefined and are likely to cause an infinite loop.\n *\n * @returns {string[]}\n */\nlunr.TokenSet.prototype.toArray = function () {\n var words = []\n\n var stack = [{\n prefix: \"\",\n node: this\n }]\n\n while (stack.length) {\n var frame = stack.pop(),\n edges = Object.keys(frame.node.edges),\n len = edges.length\n\n if (frame.node.final) {\n /* In Safari, at this point the prefix is sometimes corrupted, see:\n * https://github.com/olivernn/lunr.js/issues/279 Calling any\n * String.prototype method forces Safari to \"cast\" this string to what\n * it's supposed to be, fixing the bug. */\n frame.prefix.charAt(0)\n words.push(frame.prefix)\n }\n\n for (var i = 0; i < len; i++) {\n var edge = edges[i]\n\n stack.push({\n prefix: frame.prefix.concat(edge),\n node: frame.node.edges[edge]\n })\n }\n }\n\n return words\n}\n\n/**\n * Generates a string representation of a TokenSet.\n *\n * This is intended to allow TokenSets to be used as keys\n * in objects, largely to aid the construction and minimisation\n * of a TokenSet. As such it is not designed to be a human\n * friendly representation of the TokenSet.\n *\n * @returns {string}\n */\nlunr.TokenSet.prototype.toString = function () {\n // NOTE: Using Object.keys here as this.edges is very likely\n // to enter 'hash-mode' with many keys being added\n //\n // avoiding a for-in loop here as it leads to the function\n // being de-optimised (at least in V8). From some simple\n // benchmarks the performance is comparable, but allowing\n // V8 to optimize may mean easy performance wins in the future.\n\n if (this._str) {\n return this._str\n }\n\n var str = this.final ? '1' : '0',\n labels = Object.keys(this.edges).sort(),\n len = labels.length\n\n for (var i = 0; i < len; i++) {\n var label = labels[i],\n node = this.edges[label]\n\n str = str + label + node.id\n }\n\n return str\n}\n\n/**\n * Returns a new TokenSet that is the intersection of\n * this TokenSet and the passed TokenSet.\n *\n * This intersection will take into account any wildcards\n * contained within the TokenSet.\n *\n * @param {lunr.TokenSet} b - An other TokenSet to intersect with.\n * @returns {lunr.TokenSet}\n */\nlunr.TokenSet.prototype.intersect = function (b) {\n var output = new lunr.TokenSet,\n frame = undefined\n\n var stack = [{\n qNode: b,\n output: output,\n node: this\n }]\n\n while (stack.length) {\n frame = stack.pop()\n\n // NOTE: As with the #toString method, we are using\n // Object.keys and a for loop instead of a for-in loop\n // as both of these objects enter 'hash' mode, causing\n // the function to be de-optimised in V8\n var qEdges = Object.keys(frame.qNode.edges),\n qLen = qEdges.length,\n nEdges = Object.keys(frame.node.edges),\n nLen = nEdges.length\n\n for (var q = 0; q < qLen; q++) {\n var qEdge = qEdges[q]\n\n for (var n = 0; n < nLen; n++) {\n var nEdge = nEdges[n]\n\n if (nEdge == qEdge || qEdge == '*') {\n var node = frame.node.edges[nEdge],\n qNode = frame.qNode.edges[qEdge],\n final = node.final && qNode.final,\n next = undefined\n\n if (nEdge in frame.output.edges) {\n // an edge already exists for this character\n // no need to create a new node, just set the finality\n // bit unless this node is already final\n next = frame.output.edges[nEdge]\n next.final = next.final || final\n\n } else {\n // no edge exists yet, must create one\n // set the finality bit and insert it\n // into the output\n next = new lunr.TokenSet\n next.final = final\n frame.output.edges[nEdge] = next\n }\n\n stack.push({\n qNode: qNode,\n output: next,\n node: node\n })\n }\n }\n }\n }\n\n return output\n}\nlunr.TokenSet.Builder = function () {\n this.previousWord = \"\"\n this.root = new lunr.TokenSet\n this.uncheckedNodes = []\n this.minimizedNodes = {}\n}\n\nlunr.TokenSet.Builder.prototype.insert = function (word) {\n var node,\n commonPrefix = 0\n\n if (word < this.previousWord) {\n throw new Error (\"Out of order word insertion\")\n }\n\n for (var i = 0; i < word.length && i < this.previousWord.length; i++) {\n if (word[i] != this.previousWord[i]) break\n commonPrefix++\n }\n\n this.minimize(commonPrefix)\n\n if (this.uncheckedNodes.length == 0) {\n node = this.root\n } else {\n node = this.uncheckedNodes[this.uncheckedNodes.length - 1].child\n }\n\n for (var i = commonPrefix; i < word.length; i++) {\n var nextNode = new lunr.TokenSet,\n char = word[i]\n\n node.edges[char] = nextNode\n\n this.uncheckedNodes.push({\n parent: node,\n char: char,\n child: nextNode\n })\n\n node = nextNode\n }\n\n node.final = true\n this.previousWord = word\n}\n\nlunr.TokenSet.Builder.prototype.finish = function () {\n this.minimize(0)\n}\n\nlunr.TokenSet.Builder.prototype.minimize = function (downTo) {\n for (var i = this.uncheckedNodes.length - 1; i >= downTo; i--) {\n var node = this.uncheckedNodes[i],\n childKey = node.child.toString()\n\n if (childKey in this.minimizedNodes) {\n node.parent.edges[node.char] = this.minimizedNodes[childKey]\n } else {\n // Cache the key for this node since\n // we know it can't change anymore\n node.child._str = childKey\n\n this.minimizedNodes[childKey] = node.child\n }\n\n this.uncheckedNodes.pop()\n }\n}\n/*!\n * lunr.Index\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * An index contains the built index of all documents and provides a query interface\n * to the index.\n *\n * Usually instances of lunr.Index will not be created using this constructor, instead\n * lunr.Builder should be used to construct new indexes, or lunr.Index.load should be\n * used to load previously built and serialized indexes.\n *\n * @constructor\n * @param {Object} attrs - The attributes of the built search index.\n * @param {Object} attrs.invertedIndex - An index of term/field to document reference.\n * @param {Object} attrs.fieldVectors - Field vectors\n * @param {lunr.TokenSet} attrs.tokenSet - An set of all corpus tokens.\n * @param {string[]} attrs.fields - The names of indexed document fields.\n * @param {lunr.Pipeline} attrs.pipeline - The pipeline to use for search terms.\n */\nlunr.Index = function (attrs) {\n this.invertedIndex = attrs.invertedIndex\n this.fieldVectors = attrs.fieldVectors\n this.tokenSet = attrs.tokenSet\n this.fields = attrs.fields\n this.pipeline = attrs.pipeline\n}\n\n/**\n * A result contains details of a document matching a search query.\n * @typedef {Object} lunr.Index~Result\n * @property {string} ref - The reference of the document this result represents.\n * @property {number} score - A number between 0 and 1 representing how similar this document is to the query.\n * @property {lunr.MatchData} matchData - Contains metadata about this match including which term(s) caused the match.\n */\n\n/**\n * Although lunr provides the ability to create queries using lunr.Query, it also provides a simple\n * query language which itself is parsed into an instance of lunr.Query.\n *\n * For programmatically building queries it is advised to directly use lunr.Query, the query language\n * is best used for human entered text rather than program generated text.\n *\n * At its simplest queries can just be a single term, e.g. `hello`, multiple terms are also supported\n * and will be combined with OR, e.g `hello world` will match documents that contain either 'hello'\n * or 'world', though those that contain both will rank higher in the results.\n *\n * Wildcards can be included in terms to match one or more unspecified characters, these wildcards can\n * be inserted anywhere within the term, and more than one wildcard can exist in a single term. Adding\n * wildcards will increase the number of documents that will be found but can also have a negative\n * impact on query performance, especially with wildcards at the beginning of a term.\n *\n * Terms can be restricted to specific fields, e.g. `title:hello`, only documents with the term\n * hello in the title field will match this query. Using a field not present in the index will lead\n * to an error being thrown.\n *\n * Modifiers can also be added to terms, lunr supports edit distance and boost modifiers on terms. A term\n * boost will make documents matching that term score higher, e.g. `foo^5`. Edit distance is also supported\n * to provide fuzzy matching, e.g. 'hello~2' will match documents with hello with an edit distance of 2.\n * Avoid large values for edit distance to improve query performance.\n *\n * Each term also supports a presence modifier. By default a term's presence in document is optional, however\n * this can be changed to either required or prohibited. For a term's presence to be required in a document the\n * term should be prefixed with a '+', e.g. `+foo bar` is a search for documents that must contain 'foo' and\n * optionally contain 'bar'. Conversely a leading '-' sets the terms presence to prohibited, i.e. it must not\n * appear in a document, e.g. `-foo bar` is a search for documents that do not contain 'foo' but may contain 'bar'.\n *\n * To escape special characters the backslash character '\\' can be used, this allows searches to include\n * characters that would normally be considered modifiers, e.g. `foo\\~2` will search for a term \"foo~2\" instead\n * of attempting to apply a boost of 2 to the search term \"foo\".\n *\n * @typedef {string} lunr.Index~QueryString\n * @example Simple single term query\n * hello\n * @example Multiple term query\n * hello world\n * @example term scoped to a field\n * title:hello\n * @example term with a boost of 10\n * hello^10\n * @example term with an edit distance of 2\n * hello~2\n * @example terms with presence modifiers\n * -foo +bar baz\n */\n\n/**\n * Performs a search against the index using lunr query syntax.\n *\n * Results will be returned sorted by their score, the most relevant results\n * will be returned first. For details on how the score is calculated, please see\n * the {@link https://lunrjs.com/guides/searching.html#scoring|guide}.\n *\n * For more programmatic querying use lunr.Index#query.\n *\n * @param {lunr.Index~QueryString} queryString - A string containing a lunr query.\n * @throws {lunr.QueryParseError} If the passed query string cannot be parsed.\n * @returns {lunr.Index~Result[]}\n */\nlunr.Index.prototype.search = function (queryString) {\n return this.query(function (query) {\n var parser = new lunr.QueryParser(queryString, query)\n parser.parse()\n })\n}\n\n/**\n * A query builder callback provides a query object to be used to express\n * the query to perform on the index.\n *\n * @callback lunr.Index~queryBuilder\n * @param {lunr.Query} query - The query object to build up.\n * @this lunr.Query\n */\n\n/**\n * Performs a query against the index using the yielded lunr.Query object.\n *\n * If performing programmatic queries against the index, this method is preferred\n * over lunr.Index#search so as to avoid the additional query parsing overhead.\n *\n * A query object is yielded to the supplied function which should be used to\n * express the query to be run against the index.\n *\n * Note that although this function takes a callback parameter it is _not_ an\n * asynchronous operation, the callback is just yielded a query object to be\n * customized.\n *\n * @param {lunr.Index~queryBuilder} fn - A function that is used to build the query.\n * @returns {lunr.Index~Result[]}\n */\nlunr.Index.prototype.query = function (fn) {\n // for each query clause\n // * process terms\n // * expand terms from token set\n // * find matching documents and metadata\n // * get document vectors\n // * score documents\n\n var query = new lunr.Query(this.fields),\n matchingFields = Object.create(null),\n queryVectors = Object.create(null),\n termFieldCache = Object.create(null),\n requiredMatches = Object.create(null),\n prohibitedMatches = Object.create(null)\n\n /*\n * To support field level boosts a query vector is created per\n * field. An empty vector is eagerly created to support negated\n * queries.\n */\n for (var i = 0; i < this.fields.length; i++) {\n queryVectors[this.fields[i]] = new lunr.Vector\n }\n\n fn.call(query, query)\n\n for (var i = 0; i < query.clauses.length; i++) {\n /*\n * Unless the pipeline has been disabled for this term, which is\n * the case for terms with wildcards, we need to pass the clause\n * term through the search pipeline. A pipeline returns an array\n * of processed terms. Pipeline functions may expand the passed\n * term, which means we may end up performing multiple index lookups\n * for a single query term.\n */\n var clause = query.clauses[i],\n terms = null,\n clauseMatches = lunr.Set.empty\n\n if (clause.usePipeline) {\n terms = this.pipeline.runString(clause.term, {\n fields: clause.fields\n })\n } else {\n terms = [clause.term]\n }\n\n for (var m = 0; m < terms.length; m++) {\n var term = terms[m]\n\n /*\n * Each term returned from the pipeline needs to use the same query\n * clause object, e.g. the same boost and or edit distance. The\n * simplest way to do this is to re-use the clause object but mutate\n * its term property.\n */\n clause.term = term\n\n /*\n * From the term in the clause we create a token set which will then\n * be used to intersect the indexes token set to get a list of terms\n * to lookup in the inverted index\n */\n var termTokenSet = lunr.TokenSet.fromClause(clause),\n expandedTerms = this.tokenSet.intersect(termTokenSet).toArray()\n\n /*\n * If a term marked as required does not exist in the tokenSet it is\n * impossible for the search to return any matches. We set all the field\n * scoped required matches set to empty and stop examining any further\n * clauses.\n */\n if (expandedTerms.length === 0 && clause.presence === lunr.Query.presence.REQUIRED) {\n for (var k = 0; k < clause.fields.length; k++) {\n var field = clause.fields[k]\n requiredMatches[field] = lunr.Set.empty\n }\n\n break\n }\n\n for (var j = 0; j < expandedTerms.length; j++) {\n /*\n * For each term get the posting and termIndex, this is required for\n * building the query vector.\n */\n var expandedTerm = expandedTerms[j],\n posting = this.invertedIndex[expandedTerm],\n termIndex = posting._index\n\n for (var k = 0; k < clause.fields.length; k++) {\n /*\n * For each field that this query term is scoped by (by default\n * all fields are in scope) we need to get all the document refs\n * that have this term in that field.\n *\n * The posting is the entry in the invertedIndex for the matching\n * term from above.\n */\n var field = clause.fields[k],\n fieldPosting = posting[field],\n matchingDocumentRefs = Object.keys(fieldPosting),\n termField = expandedTerm + \"/\" + field,\n matchingDocumentsSet = new lunr.Set(matchingDocumentRefs)\n\n /*\n * if the presence of this term is required ensure that the matching\n * documents are added to the set of required matches for this clause.\n *\n */\n if (clause.presence == lunr.Query.presence.REQUIRED) {\n clauseMatches = clauseMatches.union(matchingDocumentsSet)\n\n if (requiredMatches[field] === undefined) {\n requiredMatches[field] = lunr.Set.complete\n }\n }\n\n /*\n * if the presence of this term is prohibited ensure that the matching\n * documents are added to the set of prohibited matches for this field,\n * creating that set if it does not yet exist.\n */\n if (clause.presence == lunr.Query.presence.PROHIBITED) {\n if (prohibitedMatches[field] === undefined) {\n prohibitedMatches[field] = lunr.Set.empty\n }\n\n prohibitedMatches[field] = prohibitedMatches[field].union(matchingDocumentsSet)\n\n /*\n * Prohibited matches should not be part of the query vector used for\n * similarity scoring and no metadata should be extracted so we continue\n * to the next field\n */\n continue\n }\n\n /*\n * The query field vector is populated using the termIndex found for\n * the term and a unit value with the appropriate boost applied.\n * Using upsert because there could already be an entry in the vector\n * for the term we are working with. In that case we just add the scores\n * together.\n */\n queryVectors[field].upsert(termIndex, clause.boost, function (a, b) { return a + b })\n\n /**\n * If we've already seen this term, field combo then we've already collected\n * the matching documents and metadata, no need to go through all that again\n */\n if (termFieldCache[termField]) {\n continue\n }\n\n for (var l = 0; l < matchingDocumentRefs.length; l++) {\n /*\n * All metadata for this term/field/document triple\n * are then extracted and collected into an instance\n * of lunr.MatchData ready to be returned in the query\n * results\n */\n var matchingDocumentRef = matchingDocumentRefs[l],\n matchingFieldRef = new lunr.FieldRef (matchingDocumentRef, field),\n metadata = fieldPosting[matchingDocumentRef],\n fieldMatch\n\n if ((fieldMatch = matchingFields[matchingFieldRef]) === undefined) {\n matchingFields[matchingFieldRef] = new lunr.MatchData (expandedTerm, field, metadata)\n } else {\n fieldMatch.add(expandedTerm, field, metadata)\n }\n\n }\n\n termFieldCache[termField] = true\n }\n }\n }\n\n /**\n * If the presence was required we need to update the requiredMatches field sets.\n * We do this after all fields for the term have collected their matches because\n * the clause terms presence is required in _any_ of the fields not _all_ of the\n * fields.\n */\n if (clause.presence === lunr.Query.presence.REQUIRED) {\n for (var k = 0; k < clause.fields.length; k++) {\n var field = clause.fields[k]\n requiredMatches[field] = requiredMatches[field].intersect(clauseMatches)\n }\n }\n }\n\n /**\n * Need to combine the field scoped required and prohibited\n * matching documents into a global set of required and prohibited\n * matches\n */\n var allRequiredMatches = lunr.Set.complete,\n allProhibitedMatches = lunr.Set.empty\n\n for (var i = 0; i < this.fields.length; i++) {\n var field = this.fields[i]\n\n if (requiredMatches[field]) {\n allRequiredMatches = allRequiredMatches.intersect(requiredMatches[field])\n }\n\n if (prohibitedMatches[field]) {\n allProhibitedMatches = allProhibitedMatches.union(prohibitedMatches[field])\n }\n }\n\n var matchingFieldRefs = Object.keys(matchingFields),\n results = [],\n matches = Object.create(null)\n\n /*\n * If the query is negated (contains only prohibited terms)\n * we need to get _all_ fieldRefs currently existing in the\n * index. This is only done when we know that the query is\n * entirely prohibited terms to avoid any cost of getting all\n * fieldRefs unnecessarily.\n *\n * Additionally, blank MatchData must be created to correctly\n * populate the results.\n */\n if (query.isNegated()) {\n matchingFieldRefs = Object.keys(this.fieldVectors)\n\n for (var i = 0; i < matchingFieldRefs.length; i++) {\n var matchingFieldRef = matchingFieldRefs[i]\n var fieldRef = lunr.FieldRef.fromString(matchingFieldRef)\n matchingFields[matchingFieldRef] = new lunr.MatchData\n }\n }\n\n for (var i = 0; i < matchingFieldRefs.length; i++) {\n /*\n * Currently we have document fields that match the query, but we\n * need to return documents. The matchData and scores are combined\n * from multiple fields belonging to the same document.\n *\n * Scores are calculated by field, using the query vectors created\n * above, and combined into a final document score using addition.\n */\n var fieldRef = lunr.FieldRef.fromString(matchingFieldRefs[i]),\n docRef = fieldRef.docRef\n\n if (!allRequiredMatches.contains(docRef)) {\n continue\n }\n\n if (allProhibitedMatches.contains(docRef)) {\n continue\n }\n\n var fieldVector = this.fieldVectors[fieldRef],\n score = queryVectors[fieldRef.fieldName].similarity(fieldVector),\n docMatch\n\n if ((docMatch = matches[docRef]) !== undefined) {\n docMatch.score += score\n docMatch.matchData.combine(matchingFields[fieldRef])\n } else {\n var match = {\n ref: docRef,\n score: score,\n matchData: matchingFields[fieldRef]\n }\n matches[docRef] = match\n results.push(match)\n }\n }\n\n /*\n * Sort the results objects by score, highest first.\n */\n return results.sort(function (a, b) {\n return b.score - a.score\n })\n}\n\n/**\n * Prepares the index for JSON serialization.\n *\n * The schema for this JSON blob will be described in a\n * separate JSON schema file.\n *\n * @returns {Object}\n */\nlunr.Index.prototype.toJSON = function () {\n var invertedIndex = Object.keys(this.invertedIndex)\n .sort()\n .map(function (term) {\n return [term, this.invertedIndex[term]]\n }, this)\n\n var fieldVectors = Object.keys(this.fieldVectors)\n .map(function (ref) {\n return [ref, this.fieldVectors[ref].toJSON()]\n }, this)\n\n return {\n version: lunr.version,\n fields: this.fields,\n fieldVectors: fieldVectors,\n invertedIndex: invertedIndex,\n pipeline: this.pipeline.toJSON()\n }\n}\n\n/**\n * Loads a previously serialized lunr.Index\n *\n * @param {Object} serializedIndex - A previously serialized lunr.Index\n * @returns {lunr.Index}\n */\nlunr.Index.load = function (serializedIndex) {\n var attrs = {},\n fieldVectors = {},\n serializedVectors = serializedIndex.fieldVectors,\n invertedIndex = Object.create(null),\n serializedInvertedIndex = serializedIndex.invertedIndex,\n tokenSetBuilder = new lunr.TokenSet.Builder,\n pipeline = lunr.Pipeline.load(serializedIndex.pipeline)\n\n if (serializedIndex.version != lunr.version) {\n lunr.utils.warn(\"Version mismatch when loading serialised index. Current version of lunr '\" + lunr.version + \"' does not match serialized index '\" + serializedIndex.version + \"'\")\n }\n\n for (var i = 0; i < serializedVectors.length; i++) {\n var tuple = serializedVectors[i],\n ref = tuple[0],\n elements = tuple[1]\n\n fieldVectors[ref] = new lunr.Vector(elements)\n }\n\n for (var i = 0; i < serializedInvertedIndex.length; i++) {\n var tuple = serializedInvertedIndex[i],\n term = tuple[0],\n posting = tuple[1]\n\n tokenSetBuilder.insert(term)\n invertedIndex[term] = posting\n }\n\n tokenSetBuilder.finish()\n\n attrs.fields = serializedIndex.fields\n\n attrs.fieldVectors = fieldVectors\n attrs.invertedIndex = invertedIndex\n attrs.tokenSet = tokenSetBuilder.root\n attrs.pipeline = pipeline\n\n return new lunr.Index(attrs)\n}\n/*!\n * lunr.Builder\n * Copyright (C) 2020 Oliver Nightingale\n */\n\n/**\n * lunr.Builder performs indexing on a set of documents and\n * returns instances of lunr.Index ready for querying.\n *\n * All configuration of the index is done via the builder, the\n * fields to index, the document reference, the text processing\n * pipeline and document scoring parameters are all set on the\n * builder before indexing.\n *\n * @constructor\n * @property {string} _ref - Internal reference to the document reference field.\n * @property {string[]} _fields - Internal reference to the document fields to index.\n * @property {object} invertedIndex - The inverted index maps terms to document fields.\n * @property {object} documentTermFrequencies - Keeps track of document term frequencies.\n * @property {object} documentLengths - Keeps track of the length of documents added to the index.\n * @property {lunr.tokenizer} tokenizer - Function for splitting strings into tokens for indexing.\n * @property {lunr.Pipeline} pipeline - The pipeline performs text processing on tokens before indexing.\n * @property {lunr.Pipeline} searchPipeline - A pipeline for processing search terms before querying the index.\n * @property {number} documentCount - Keeps track of the total number of documents indexed.\n * @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.\n * @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.\n * @property {number} termIndex - A counter incremented for each unique term, used to identify a terms position in the vector space.\n * @property {array} metadataWhitelist - A list of metadata keys that have been whitelisted for entry in the index.\n */\nlunr.Builder = function () {\n this._ref = \"id\"\n this._fields = Object.create(null)\n this._documents = Object.create(null)\n this.invertedIndex = Object.create(null)\n this.fieldTermFrequencies = {}\n this.fieldLengths = {}\n this.tokenizer = lunr.tokenizer\n this.pipeline = new lunr.Pipeline\n this.searchPipeline = new lunr.Pipeline\n this.documentCount = 0\n this._b = 0.75\n this._k1 = 1.2\n this.termIndex = 0\n this.metadataWhitelist = []\n}\n\n/**\n * Sets the document field used as the document reference. Every document must have this field.\n * The type of this field in the document should be a string, if it is not a string it will be\n * coerced into a string by calling toString.\n *\n * The default ref is 'id'.\n *\n * The ref should _not_ be changed during indexing, it should be set before any documents are\n * added to the index. Changing it during indexing can lead to inconsistent results.\n *\n * @param {string} ref - The name of the reference field in the document.\n */\nlunr.Builder.prototype.ref = function (ref) {\n this._ref = ref\n}\n\n/**\n * A function that is used to extract a field from a document.\n *\n * Lunr expects a field to be at the top level of a document, if however the field\n * is deeply nested within a document an extractor function can be used to extract\n * the right field for indexing.\n *\n * @callback fieldExtractor\n * @param {object} doc - The document being added to the index.\n * @returns {?(string|object|object[])} obj - The object that will be indexed for this field.\n * @example Extracting a nested field\n * function (doc) { return doc.nested.field }\n */\n\n/**\n * Adds a field to the list of document fields that will be indexed. Every document being\n * indexed should have this field. Null values for this field in indexed documents will\n * not cause errors but will limit the chance of that document being retrieved by searches.\n *\n * All fields should be added before adding documents to the index. Adding fields after\n * a document has been indexed will have no effect on already indexed documents.\n *\n * Fields can be boosted at build time. This allows terms within that field to have more\n * importance when ranking search results. Use a field boost to specify that matches within\n * one field are more important than other fields.\n *\n * @param {string} fieldName - The name of a field to index in all documents.\n * @param {object} attributes - Optional attributes associated with this field.\n * @param {number} [attributes.boost=1] - Boost applied to all terms within this field.\n * @param {fieldExtractor} [attributes.extractor] - Function to extract a field from a document.\n * @throws {RangeError} fieldName cannot contain unsupported characters '/'\n */\nlunr.Builder.prototype.field = function (fieldName, attributes) {\n if (/\\//.test(fieldName)) {\n throw new RangeError (\"Field '\" + fieldName + \"' contains illegal character '/'\")\n }\n\n this._fields[fieldName] = attributes || {}\n}\n\n/**\n * A parameter to tune the amount of field length normalisation that is applied when\n * calculating relevance scores. A value of 0 will completely disable any normalisation\n * and a value of 1 will fully normalise field lengths. The default is 0.75. Values of b\n * will be clamped to the range 0 - 1.\n *\n * @param {number} number - The value to set for this tuning parameter.\n */\nlunr.Builder.prototype.b = function (number) {\n if (number < 0) {\n this._b = 0\n } else if (number > 1) {\n this._b = 1\n } else {\n this._b = number\n }\n}\n\n/**\n * A parameter that controls the speed at which a rise in term frequency results in term\n * frequency saturation. The default value is 1.2. Setting this to a higher value will give\n * slower saturation levels, a lower value will result in quicker saturation.\n *\n * @param {number} number - The value to set for this tuning parameter.\n */\nlunr.Builder.prototype.k1 = function (number) {\n this._k1 = number\n}\n\n/**\n * Adds a document to the index.\n *\n * Before adding fields to the index the index should have been fully setup, with the document\n * ref and all fields to index already having been specified.\n *\n * The document must have a field name as specified by the ref (by default this is 'id') and\n * it should have all fields defined for indexing, though null or undefined values will not\n * cause errors.\n *\n * Entire documents can be boosted at build time. Applying a boost to a document indicates that\n * this document should rank higher in search results than other documents.\n *\n * @param {object} doc - The document to add to the index.\n * @param {object} attributes - Optional attributes associated with this document.\n * @param {number} [attributes.boost=1] - Boost applied to all terms within this document.\n */\nlunr.Builder.prototype.add = function (doc, attributes) {\n var docRef = doc[this._ref],\n fields = Object.keys(this._fields)\n\n this._documents[docRef] = attributes || {}\n this.documentCount += 1\n\n for (var i = 0; i < fields.length; i++) {\n var fieldName = fields[i],\n extractor = this._fields[fieldName].extractor,\n field = extractor ? extractor(doc) : doc[fieldName],\n tokens = this.tokenizer(field, {\n fields: [fieldName]\n }),\n terms = this.pipeline.run(tokens),\n fieldRef = new lunr.FieldRef (docRef, fieldName),\n fieldTerms = Object.create(null)\n\n this.fieldTermFrequencies[fieldRef] = fieldTerms\n this.fieldLengths[fieldRef] = 0\n\n // store the length of this field for this document\n this.fieldLengths[fieldRef] += terms.length\n\n // calculate term frequencies for this field\n for (var j = 0; j < terms.length; j++) {\n var term = terms[j]\n\n if (fieldTerms[term] == undefined) {\n fieldTerms[term] = 0\n }\n\n fieldTerms[term] += 1\n\n // add to inverted index\n // create an initial posting if one doesn't exist\n if (this.invertedIndex[term] == undefined) {\n var posting = Object.create(null)\n posting[\"_index\"] = this.termIndex\n this.termIndex += 1\n\n for (var k = 0; k < fields.length; k++) {\n posting[fields[k]] = Object.create(null)\n }\n\n this.invertedIndex[term] = posting\n }\n\n // add an entry for this term/fieldName/docRef to the invertedIndex\n if (this.invertedIndex[term][fieldName][docRef] == undefined) {\n this.invertedIndex[term][fieldName][docRef] = Object.create(null)\n }\n\n // store all whitelisted metadata about this token in the\n // inverted index\n for (var l = 0; l < this.metadataWhitelist.length; l++) {\n var metadataKey = this.metadataWhitelist[l],\n metadata = term.metadata[metadataKey]\n\n if (this.invertedIndex[term][fieldName][docRef][metadataKey] == undefined) {\n this.invertedIndex[term][fieldName][docRef][metadataKey] = []\n }\n\n this.invertedIndex[term][fieldName][docRef][metadataKey].push(metadata)\n }\n }\n\n }\n}\n\n/**\n * Calculates the average document length for this index\n *\n * @private\n */\nlunr.Builder.prototype.calculateAverageFieldLengths = function () {\n\n var fieldRefs = Object.keys(this.fieldLengths),\n numberOfFields = fieldRefs.length,\n accumulator = {},\n documentsWithField = {}\n\n for (var i = 0; i < numberOfFields; i++) {\n var fieldRef = lunr.FieldRef.fromString(fieldRefs[i]),\n field = fieldRef.fieldName\n\n documentsWithField[field] || (documentsWithField[field] = 0)\n documentsWithField[field] += 1\n\n accumulator[field] || (accumulator[field] = 0)\n accumulator[field] += this.fieldLengths[fieldRef]\n }\n\n var fields = Object.keys(this._fields)\n\n for (var i = 0; i < fields.length; i++) {\n var fieldName = fields[i]\n accumulator[fieldName] = accumulator[fieldName] / documentsWithField[fieldName]\n }\n\n this.averageFieldLength = accumulator\n}\n\n/**\n * Builds a vector space model of every document using lunr.Vector\n *\n * @private\n */\nlunr.Builder.prototype.createFieldVectors = function () {\n var fieldVectors = {},\n fieldRefs = Object.keys(this.fieldTermFrequencies),\n fieldRefsLength = fieldRefs.length,\n termIdfCache = Object.create(null)\n\n for (var i = 0; i < fieldRefsLength; i++) {\n var fieldRef = lunr.FieldRef.fromString(fieldRefs[i]),\n fieldName = fieldRef.fieldName,\n fieldLength = this.fieldLengths[fieldRef],\n fieldVector = new lunr.Vector,\n termFrequencies = this.fieldTermFrequencies[fieldRef],\n terms = Object.keys(termFrequencies),\n termsLength = terms.length\n\n\n var fieldBoost = this._fields[fieldName].boost || 1,\n docBoost = this._documents[fieldRef.docRef].boost || 1\n\n for (var j = 0; j < termsLength; j++) {\n var term = terms[j],\n tf = termFrequencies[term],\n termIndex = this.invertedIndex[term]._index,\n idf, score, scoreWithPrecision\n\n if (termIdfCache[term] === undefined) {\n idf = lunr.idf(this.invertedIndex[term], this.documentCount)\n termIdfCache[term] = idf\n } else {\n idf = termIdfCache[term]\n }\n\n score = idf * ((this._k1 + 1) * tf) / (this._k1 * (1 - this._b + this._b * (fieldLength / this.averageFieldLength[fieldName])) + tf)\n score *= fieldBoost\n score *= docBoost\n scoreWithPrecision = Math.round(score * 1000) / 1000\n // Converts 1.23456789 to 1.234.\n // Reducing the precision so that the vectors take up less\n // space when serialised. Doing it now so that they behave\n // the same before and after serialisation. Also, this is\n // the fastest approach to reducing a number's precision in\n // JavaScript.\n\n fieldVector.insert(termIndex, scoreWithPrecision)\n }\n\n fieldVectors[fieldRef] = fieldVector\n }\n\n this.fieldVectors = fieldVectors\n}\n\n/**\n * Creates a token set of all tokens in the index using lunr.TokenSet\n *\n * @private\n */\nlunr.Builder.prototype.createTokenSet = function () {\n this.tokenSet = lunr.TokenSet.fromArray(\n Object.keys(this.invertedIndex).sort()\n )\n}\n\n/**\n * Builds the index, creating an instance of lunr.Index.\n *\n * This completes the indexing process and should only be called\n * once all documents have been added to the index.\n *\n * @returns {lunr.Index}\n */\nlunr.Builder.prototype.build = function () {\n this.calculateAverageFieldLengths()\n this.createFieldVectors()\n this.createTokenSet()\n\n return new lunr.Index({\n invertedIndex: this.invertedIndex,\n fieldVectors: this.fieldVectors,\n tokenSet: this.tokenSet,\n fields: Object.keys(this._fields),\n pipeline: this.searchPipeline\n })\n}\n\n/**\n * Applies a plugin to the index builder.\n *\n * A plugin is a function that is called with the index builder as its context.\n * Plugins can be used to customise or extend the behaviour of the index\n * in some way. A plugin is just a function, that encapsulated the custom\n * behaviour that should be applied when building the index.\n *\n * The plugin function will be called with the index builder as its argument, additional\n * arguments can also be passed when calling use. The function will be called\n * with the index builder as its context.\n *\n * @param {Function} plugin The plugin to apply.\n */\nlunr.Builder.prototype.use = function (fn) {\n var args = Array.prototype.slice.call(arguments, 1)\n args.unshift(this)\n fn.apply(this, args)\n}\n/**\n * Contains and collects metadata about a matching document.\n * A single instance of lunr.MatchData is returned as part of every\n * lunr.Index~Result.\n *\n * @constructor\n * @param {string} term - The term this match data is associated with\n * @param {string} field - The field in which the term was found\n * @param {object} metadata - The metadata recorded about this term in this field\n * @property {object} metadata - A cloned collection of metadata associated with this document.\n * @see {@link lunr.Index~Result}\n */\nlunr.MatchData = function (term, field, metadata) {\n var clonedMetadata = Object.create(null),\n metadataKeys = Object.keys(metadata || {})\n\n // Cloning the metadata to prevent the original\n // being mutated during match data combination.\n // Metadata is kept in an array within the inverted\n // index so cloning the data can be done with\n // Array#slice\n for (var i = 0; i < metadataKeys.length; i++) {\n var key = metadataKeys[i]\n clonedMetadata[key] = metadata[key].slice()\n }\n\n this.metadata = Object.create(null)\n\n if (term !== undefined) {\n this.metadata[term] = Object.create(null)\n this.metadata[term][field] = clonedMetadata\n }\n}\n\n/**\n * An instance of lunr.MatchData will be created for every term that matches a\n * document. However only one instance is required in a lunr.Index~Result. This\n * method combines metadata from another instance of lunr.MatchData with this\n * objects metadata.\n *\n * @param {lunr.MatchData} otherMatchData - Another instance of match data to merge with this one.\n * @see {@link lunr.Index~Result}\n */\nlunr.MatchData.prototype.combine = function (otherMatchData) {\n var terms = Object.keys(otherMatchData.metadata)\n\n for (var i = 0; i < terms.length; i++) {\n var term = terms[i],\n fields = Object.keys(otherMatchData.metadata[term])\n\n if (this.metadata[term] == undefined) {\n this.metadata[term] = Object.create(null)\n }\n\n for (var j = 0; j < fields.length; j++) {\n var field = fields[j],\n keys = Object.keys(otherMatchData.metadata[term][field])\n\n if (this.metadata[term][field] == undefined) {\n this.metadata[term][field] = Object.create(null)\n }\n\n for (var k = 0; k < keys.length; k++) {\n var key = keys[k]\n\n if (this.metadata[term][field][key] == undefined) {\n this.metadata[term][field][key] = otherMatchData.metadata[term][field][key]\n } else {\n this.metadata[term][field][key] = this.metadata[term][field][key].concat(otherMatchData.metadata[term][field][key])\n }\n\n }\n }\n }\n}\n\n/**\n * Add metadata for a term/field pair to this instance of match data.\n *\n * @param {string} term - The term this match data is associated with\n * @param {string} field - The field in which the term was found\n * @param {object} metadata - The metadata recorded about this term in this field\n */\nlunr.MatchData.prototype.add = function (term, field, metadata) {\n if (!(term in this.metadata)) {\n this.metadata[term] = Object.create(null)\n this.metadata[term][field] = metadata\n return\n }\n\n if (!(field in this.metadata[term])) {\n this.metadata[term][field] = metadata\n return\n }\n\n var metadataKeys = Object.keys(metadata)\n\n for (var i = 0; i < metadataKeys.length; i++) {\n var key = metadataKeys[i]\n\n if (key in this.metadata[term][field]) {\n this.metadata[term][field][key] = this.metadata[term][field][key].concat(metadata[key])\n } else {\n this.metadata[term][field][key] = metadata[key]\n }\n }\n}\n/**\n * A lunr.Query provides a programmatic way of defining queries to be performed\n * against a {@link lunr.Index}.\n *\n * Prefer constructing a lunr.Query using the {@link lunr.Index#query} method\n * so the query object is pre-initialized with the right index fields.\n *\n * @constructor\n * @property {lunr.Query~Clause[]} clauses - An array of query clauses.\n * @property {string[]} allFields - An array of all available fields in a lunr.Index.\n */\nlunr.Query = function (allFields) {\n this.clauses = []\n this.allFields = allFields\n}\n\n/**\n * Constants for indicating what kind of automatic wildcard insertion will be used when constructing a query clause.\n *\n * This allows wildcards to be added to the beginning and end of a term without having to manually do any string\n * concatenation.\n *\n * The wildcard constants can be bitwise combined to select both leading and trailing wildcards.\n *\n * @constant\n * @default\n * @property {number} wildcard.NONE - The term will have no wildcards inserted, this is the default behaviour\n * @property {number} wildcard.LEADING - Prepend the term with a wildcard, unless a leading wildcard already exists\n * @property {number} wildcard.TRAILING - Append a wildcard to the term, unless a trailing wildcard already exists\n * @see lunr.Query~Clause\n * @see lunr.Query#clause\n * @see lunr.Query#term\n * @example query term with trailing wildcard\n * query.term('foo', { wildcard: lunr.Query.wildcard.TRAILING })\n * @example query term with leading and trailing wildcard\n * query.term('foo', {\n * wildcard: lunr.Query.wildcard.LEADING | lunr.Query.wildcard.TRAILING\n * })\n */\n\nlunr.Query.wildcard = new String (\"*\")\nlunr.Query.wildcard.NONE = 0\nlunr.Query.wildcard.LEADING = 1\nlunr.Query.wildcard.TRAILING = 2\n\n/**\n * Constants for indicating what kind of presence a term must have in matching documents.\n *\n * @constant\n * @enum {number}\n * @see lunr.Query~Clause\n * @see lunr.Query#clause\n * @see lunr.Query#term\n * @example query term with required presence\n * query.term('foo', { presence: lunr.Query.presence.REQUIRED })\n */\nlunr.Query.presence = {\n /**\n * Term's presence in a document is optional, this is the default value.\n */\n OPTIONAL: 1,\n\n /**\n * Term's presence in a document is required, documents that do not contain\n * this term will not be returned.\n */\n REQUIRED: 2,\n\n /**\n * Term's presence in a document is prohibited, documents that do contain\n * this term will not be returned.\n */\n PROHIBITED: 3\n}\n\n/**\n * A single clause in a {@link lunr.Query} contains a term and details on how to\n * match that term against a {@link lunr.Index}.\n *\n * @typedef {Object} lunr.Query~Clause\n * @property {string[]} fields - The fields in an index this clause should be matched against.\n * @property {number} [boost=1] - Any boost that should be applied when matching this clause.\n * @property {number} [editDistance] - Whether the term should have fuzzy matching applied, and how fuzzy the match should be.\n * @property {boolean} [usePipeline] - Whether the term should be passed through the search pipeline.\n * @property {number} [wildcard=lunr.Query.wildcard.NONE] - Whether the term should have wildcards appended or prepended.\n * @property {number} [presence=lunr.Query.presence.OPTIONAL] - The terms presence in any matching documents.\n */\n\n/**\n * Adds a {@link lunr.Query~Clause} to this query.\n *\n * Unless the clause contains the fields to be matched all fields will be matched. In addition\n * a default boost of 1 is applied to the clause.\n *\n * @param {lunr.Query~Clause} clause - The clause to add to this query.\n * @see lunr.Query~Clause\n * @returns {lunr.Query}\n */\nlunr.Query.prototype.clause = function (clause) {\n if (!('fields' in clause)) {\n clause.fields = this.allFields\n }\n\n if (!('boost' in clause)) {\n clause.boost = 1\n }\n\n if (!('usePipeline' in clause)) {\n clause.usePipeline = true\n }\n\n if (!('wildcard' in clause)) {\n clause.wildcard = lunr.Query.wildcard.NONE\n }\n\n if ((clause.wildcard & lunr.Query.wildcard.LEADING) && (clause.term.charAt(0) != lunr.Query.wildcard)) {\n clause.term = \"*\" + clause.term\n }\n\n if ((clause.wildcard & lunr.Query.wildcard.TRAILING) && (clause.term.slice(-1) != lunr.Query.wildcard)) {\n clause.term = \"\" + clause.term + \"*\"\n }\n\n if (!('presence' in clause)) {\n clause.presence = lunr.Query.presence.OPTIONAL\n }\n\n this.clauses.push(clause)\n\n return this\n}\n\n/**\n * A negated query is one in which every clause has a presence of\n * prohibited. These queries require some special processing to return\n * the expected results.\n *\n * @returns boolean\n */\nlunr.Query.prototype.isNegated = function () {\n for (var i = 0; i < this.clauses.length; i++) {\n if (this.clauses[i].presence != lunr.Query.presence.PROHIBITED) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * Adds a term to the current query, under the covers this will create a {@link lunr.Query~Clause}\n * to the list of clauses that make up this query.\n *\n * The term is used as is, i.e. no tokenization will be performed by this method. Instead conversion\n * to a token or token-like string should be done before calling this method.\n *\n * The term will be converted to a string by calling `toString`. Multiple terms can be passed as an\n * array, each term in the array will share the same options.\n *\n * @param {object|object[]} term - The term(s) to add to the query.\n * @param {object} [options] - Any additional properties to add to the query clause.\n * @returns {lunr.Query}\n * @see lunr.Query#clause\n * @see lunr.Query~Clause\n * @example adding a single term to a query\n * query.term(\"foo\")\n * @example adding a single term to a query and specifying search fields, term boost and automatic trailing wildcard\n * query.term(\"foo\", {\n * fields: [\"title\"],\n * boost: 10,\n * wildcard: lunr.Query.wildcard.TRAILING\n * })\n * @example using lunr.tokenizer to convert a string to tokens before using them as terms\n * query.term(lunr.tokenizer(\"foo bar\"))\n */\nlunr.Query.prototype.term = function (term, options) {\n if (Array.isArray(term)) {\n term.forEach(function (t) { this.term(t, lunr.utils.clone(options)) }, this)\n return this\n }\n\n var clause = options || {}\n clause.term = term.toString()\n\n this.clause(clause)\n\n return this\n}\nlunr.QueryParseError = function (message, start, end) {\n this.name = \"QueryParseError\"\n this.message = message\n this.start = start\n this.end = end\n}\n\nlunr.QueryParseError.prototype = new Error\nlunr.QueryLexer = function (str) {\n this.lexemes = []\n this.str = str\n this.length = str.length\n this.pos = 0\n this.start = 0\n this.escapeCharPositions = []\n}\n\nlunr.QueryLexer.prototype.run = function () {\n var state = lunr.QueryLexer.lexText\n\n while (state) {\n state = state(this)\n }\n}\n\nlunr.QueryLexer.prototype.sliceString = function () {\n var subSlices = [],\n sliceStart = this.start,\n sliceEnd = this.pos\n\n for (var i = 0; i < this.escapeCharPositions.length; i++) {\n sliceEnd = this.escapeCharPositions[i]\n subSlices.push(this.str.slice(sliceStart, sliceEnd))\n sliceStart = sliceEnd + 1\n }\n\n subSlices.push(this.str.slice(sliceStart, this.pos))\n this.escapeCharPositions.length = 0\n\n return subSlices.join('')\n}\n\nlunr.QueryLexer.prototype.emit = function (type) {\n this.lexemes.push({\n type: type,\n str: this.sliceString(),\n start: this.start,\n end: this.pos\n })\n\n this.start = this.pos\n}\n\nlunr.QueryLexer.prototype.escapeCharacter = function () {\n this.escapeCharPositions.push(this.pos - 1)\n this.pos += 1\n}\n\nlunr.QueryLexer.prototype.next = function () {\n if (this.pos >= this.length) {\n return lunr.QueryLexer.EOS\n }\n\n var char = this.str.charAt(this.pos)\n this.pos += 1\n return char\n}\n\nlunr.QueryLexer.prototype.width = function () {\n return this.pos - this.start\n}\n\nlunr.QueryLexer.prototype.ignore = function () {\n if (this.start == this.pos) {\n this.pos += 1\n }\n\n this.start = this.pos\n}\n\nlunr.QueryLexer.prototype.backup = function () {\n this.pos -= 1\n}\n\nlunr.QueryLexer.prototype.acceptDigitRun = function () {\n var char, charCode\n\n do {\n char = this.next()\n charCode = char.charCodeAt(0)\n } while (charCode > 47 && charCode < 58)\n\n if (char != lunr.QueryLexer.EOS) {\n this.backup()\n }\n}\n\nlunr.QueryLexer.prototype.more = function () {\n return this.pos < this.length\n}\n\nlunr.QueryLexer.EOS = 'EOS'\nlunr.QueryLexer.FIELD = 'FIELD'\nlunr.QueryLexer.TERM = 'TERM'\nlunr.QueryLexer.EDIT_DISTANCE = 'EDIT_DISTANCE'\nlunr.QueryLexer.BOOST = 'BOOST'\nlunr.QueryLexer.PRESENCE = 'PRESENCE'\n\nlunr.QueryLexer.lexField = function (lexer) {\n lexer.backup()\n lexer.emit(lunr.QueryLexer.FIELD)\n lexer.ignore()\n return lunr.QueryLexer.lexText\n}\n\nlunr.QueryLexer.lexTerm = function (lexer) {\n if (lexer.width() > 1) {\n lexer.backup()\n lexer.emit(lunr.QueryLexer.TERM)\n }\n\n lexer.ignore()\n\n if (lexer.more()) {\n return lunr.QueryLexer.lexText\n }\n}\n\nlunr.QueryLexer.lexEditDistance = function (lexer) {\n lexer.ignore()\n lexer.acceptDigitRun()\n lexer.emit(lunr.QueryLexer.EDIT_DISTANCE)\n return lunr.QueryLexer.lexText\n}\n\nlunr.QueryLexer.lexBoost = function (lexer) {\n lexer.ignore()\n lexer.acceptDigitRun()\n lexer.emit(lunr.QueryLexer.BOOST)\n return lunr.QueryLexer.lexText\n}\n\nlunr.QueryLexer.lexEOS = function (lexer) {\n if (lexer.width() > 0) {\n lexer.emit(lunr.QueryLexer.TERM)\n }\n}\n\n// This matches the separator used when tokenising fields\n// within a document. These should match otherwise it is\n// not possible to search for some tokens within a document.\n//\n// It is possible for the user to change the separator on the\n// tokenizer so it _might_ clash with any other of the special\n// characters already used within the search string, e.g. :.\n//\n// This means that it is possible to change the separator in\n// such a way that makes some words unsearchable using a search\n// string.\nlunr.QueryLexer.termSeparator = lunr.tokenizer.separator\n\nlunr.QueryLexer.lexText = function (lexer) {\n while (true) {\n var char = lexer.next()\n\n if (char == lunr.QueryLexer.EOS) {\n return lunr.QueryLexer.lexEOS\n }\n\n // Escape character is '\\'\n if (char.charCodeAt(0) == 92) {\n lexer.escapeCharacter()\n continue\n }\n\n if (char == \":\") {\n return lunr.QueryLexer.lexField\n }\n\n if (char == \"~\") {\n lexer.backup()\n if (lexer.width() > 0) {\n lexer.emit(lunr.QueryLexer.TERM)\n }\n return lunr.QueryLexer.lexEditDistance\n }\n\n if (char == \"^\") {\n lexer.backup()\n if (lexer.width() > 0) {\n lexer.emit(lunr.QueryLexer.TERM)\n }\n return lunr.QueryLexer.lexBoost\n }\n\n // \"+\" indicates term presence is required\n // checking for length to ensure that only\n // leading \"+\" are considered\n if (char == \"+\" && lexer.width() === 1) {\n lexer.emit(lunr.QueryLexer.PRESENCE)\n return lunr.QueryLexer.lexText\n }\n\n // \"-\" indicates term presence is prohibited\n // checking for length to ensure that only\n // leading \"-\" are considered\n if (char == \"-\" && lexer.width() === 1) {\n lexer.emit(lunr.QueryLexer.PRESENCE)\n return lunr.QueryLexer.lexText\n }\n\n if (char.match(lunr.QueryLexer.termSeparator)) {\n return lunr.QueryLexer.lexTerm\n }\n }\n}\n\nlunr.QueryParser = function (str, query) {\n this.lexer = new lunr.QueryLexer (str)\n this.query = query\n this.currentClause = {}\n this.lexemeIdx = 0\n}\n\nlunr.QueryParser.prototype.parse = function () {\n this.lexer.run()\n this.lexemes = this.lexer.lexemes\n\n var state = lunr.QueryParser.parseClause\n\n while (state) {\n state = state(this)\n }\n\n return this.query\n}\n\nlunr.QueryParser.prototype.peekLexeme = function () {\n return this.lexemes[this.lexemeIdx]\n}\n\nlunr.QueryParser.prototype.consumeLexeme = function () {\n var lexeme = this.peekLexeme()\n this.lexemeIdx += 1\n return lexeme\n}\n\nlunr.QueryParser.prototype.nextClause = function () {\n var completedClause = this.currentClause\n this.query.clause(completedClause)\n this.currentClause = {}\n}\n\nlunr.QueryParser.parseClause = function (parser) {\n var lexeme = parser.peekLexeme()\n\n if (lexeme == undefined) {\n return\n }\n\n switch (lexeme.type) {\n case lunr.QueryLexer.PRESENCE:\n return lunr.QueryParser.parsePresence\n case lunr.QueryLexer.FIELD:\n return lunr.QueryParser.parseField\n case lunr.QueryLexer.TERM:\n return lunr.QueryParser.parseTerm\n default:\n var errorMessage = \"expected either a field or a term, found \" + lexeme.type\n\n if (lexeme.str.length >= 1) {\n errorMessage += \" with value '\" + lexeme.str + \"'\"\n }\n\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n}\n\nlunr.QueryParser.parsePresence = function (parser) {\n var lexeme = parser.consumeLexeme()\n\n if (lexeme == undefined) {\n return\n }\n\n switch (lexeme.str) {\n case \"-\":\n parser.currentClause.presence = lunr.Query.presence.PROHIBITED\n break\n case \"+\":\n parser.currentClause.presence = lunr.Query.presence.REQUIRED\n break\n default:\n var errorMessage = \"unrecognised presence operator'\" + lexeme.str + \"'\"\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n\n var nextLexeme = parser.peekLexeme()\n\n if (nextLexeme == undefined) {\n var errorMessage = \"expecting term or field, found nothing\"\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n\n switch (nextLexeme.type) {\n case lunr.QueryLexer.FIELD:\n return lunr.QueryParser.parseField\n case lunr.QueryLexer.TERM:\n return lunr.QueryParser.parseTerm\n default:\n var errorMessage = \"expecting term or field, found '\" + nextLexeme.type + \"'\"\n throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end)\n }\n}\n\nlunr.QueryParser.parseField = function (parser) {\n var lexeme = parser.consumeLexeme()\n\n if (lexeme == undefined) {\n return\n }\n\n if (parser.query.allFields.indexOf(lexeme.str) == -1) {\n var possibleFields = parser.query.allFields.map(function (f) { return \"'\" + f + \"'\" }).join(', '),\n errorMessage = \"unrecognised field '\" + lexeme.str + \"', possible fields: \" + possibleFields\n\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n\n parser.currentClause.fields = [lexeme.str]\n\n var nextLexeme = parser.peekLexeme()\n\n if (nextLexeme == undefined) {\n var errorMessage = \"expecting term, found nothing\"\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n\n switch (nextLexeme.type) {\n case lunr.QueryLexer.TERM:\n return lunr.QueryParser.parseTerm\n default:\n var errorMessage = \"expecting term, found '\" + nextLexeme.type + \"'\"\n throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end)\n }\n}\n\nlunr.QueryParser.parseTerm = function (parser) {\n var lexeme = parser.consumeLexeme()\n\n if (lexeme == undefined) {\n return\n }\n\n parser.currentClause.term = lexeme.str.toLowerCase()\n\n if (lexeme.str.indexOf(\"*\") != -1) {\n parser.currentClause.usePipeline = false\n }\n\n var nextLexeme = parser.peekLexeme()\n\n if (nextLexeme == undefined) {\n parser.nextClause()\n return\n }\n\n switch (nextLexeme.type) {\n case lunr.QueryLexer.TERM:\n parser.nextClause()\n return lunr.QueryParser.parseTerm\n case lunr.QueryLexer.FIELD:\n parser.nextClause()\n return lunr.QueryParser.parseField\n case lunr.QueryLexer.EDIT_DISTANCE:\n return lunr.QueryParser.parseEditDistance\n case lunr.QueryLexer.BOOST:\n return lunr.QueryParser.parseBoost\n case lunr.QueryLexer.PRESENCE:\n parser.nextClause()\n return lunr.QueryParser.parsePresence\n default:\n var errorMessage = \"Unexpected lexeme type '\" + nextLexeme.type + \"'\"\n throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end)\n }\n}\n\nlunr.QueryParser.parseEditDistance = function (parser) {\n var lexeme = parser.consumeLexeme()\n\n if (lexeme == undefined) {\n return\n }\n\n var editDistance = parseInt(lexeme.str, 10)\n\n if (isNaN(editDistance)) {\n var errorMessage = \"edit distance must be numeric\"\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n\n parser.currentClause.editDistance = editDistance\n\n var nextLexeme = parser.peekLexeme()\n\n if (nextLexeme == undefined) {\n parser.nextClause()\n return\n }\n\n switch (nextLexeme.type) {\n case lunr.QueryLexer.TERM:\n parser.nextClause()\n return lunr.QueryParser.parseTerm\n case lunr.QueryLexer.FIELD:\n parser.nextClause()\n return lunr.QueryParser.parseField\n case lunr.QueryLexer.EDIT_DISTANCE:\n return lunr.QueryParser.parseEditDistance\n case lunr.QueryLexer.BOOST:\n return lunr.QueryParser.parseBoost\n case lunr.QueryLexer.PRESENCE:\n parser.nextClause()\n return lunr.QueryParser.parsePresence\n default:\n var errorMessage = \"Unexpected lexeme type '\" + nextLexeme.type + \"'\"\n throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end)\n }\n}\n\nlunr.QueryParser.parseBoost = function (parser) {\n var lexeme = parser.consumeLexeme()\n\n if (lexeme == undefined) {\n return\n }\n\n var boost = parseInt(lexeme.str, 10)\n\n if (isNaN(boost)) {\n var errorMessage = \"boost must be numeric\"\n throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end)\n }\n\n parser.currentClause.boost = boost\n\n var nextLexeme = parser.peekLexeme()\n\n if (nextLexeme == undefined) {\n parser.nextClause()\n return\n }\n\n switch (nextLexeme.type) {\n case lunr.QueryLexer.TERM:\n parser.nextClause()\n return lunr.QueryParser.parseTerm\n case lunr.QueryLexer.FIELD:\n parser.nextClause()\n return lunr.QueryParser.parseField\n case lunr.QueryLexer.EDIT_DISTANCE:\n return lunr.QueryParser.parseEditDistance\n case lunr.QueryLexer.BOOST:\n return lunr.QueryParser.parseBoost\n case lunr.QueryLexer.PRESENCE:\n parser.nextClause()\n return lunr.QueryParser.parsePresence\n default:\n var errorMessage = \"Unexpected lexeme type '\" + nextLexeme.type + \"'\"\n throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end)\n }\n}\n\n /**\n * export the module via AMD, CommonJS or as a browser global\n * Export code from https://github.com/umdjs/umd/blob/master/returnExports.js\n */\n ;(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(factory)\n } else if (typeof exports === 'object') {\n /**\n * Node. Does not work with strict CommonJS, but\n * only CommonJS-like enviroments that support module.exports,\n * like Node.\n */\n module.exports = factory()\n } else {\n // Browser globals (root is window)\n root.lunr = factory()\n }\n }(this, function () {\n /**\n * Just return a value to define the module export.\n * This example returns an object, but the module\n * can return a function as the exported value.\n */\n return lunr\n }))\n})();\n", "/*\n * Copyright (c) 2016-2024 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A RTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport lunr from \"lunr\"\n\nimport { getElement } from \"~/browser/element/_\"\nimport \"~/polyfills\"\n\nimport { Search } from \"../../_\"\nimport { SearchConfig } from \"../../config\"\nimport {\n SearchMessage,\n SearchMessageType\n} from \"../message\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Add support for `iframe-worker` shim\n *\n * While `importScripts` is synchronous when executed inside of a web worker,\n * it's not possible to provide a synchronous shim implementation. The cool\n * thing is that awaiting a non-Promise will convert it into a Promise, so\n * extending the type definition to return a `Promise` shouldn't break anything.\n *\n * @see https://bit.ly/2PjDnXi - GitHub comment\n *\n * @param urls - Scripts to load\n *\n * @returns Promise resolving with no result\n */\ndeclare global {\n function importScripts(...urls: string[]): Promise | void\n}\n\n/* ----------------------------------------------------------------------------\n * Data\n * ------------------------------------------------------------------------- */\n\n/**\n * Search index\n */\nlet index: Search\n\n/* ----------------------------------------------------------------------------\n * Helper functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Fetch (= import) multi-language support through `lunr-languages`\n *\n * This function automatically imports the stemmers necessary to process the\n * languages which are defined as part of the search configuration.\n *\n * If the worker runs inside of an `iframe` (when using `iframe-worker` as\n * a shim), the base URL for the stemmers to be loaded must be determined by\n * searching for the first `script` element with a `src` attribute, which will\n * contain the contents of this script.\n *\n * @param config - Search configuration\n *\n * @returns Promise resolving with no result\n */\nasync function setupSearchLanguages(\n config: SearchConfig\n): Promise {\n let base = \"../lunr\"\n\n /* Detect `iframe-worker` and fix base URL */\n if (typeof parent !== \"undefined\" && \"IFrameWorker\" in parent) {\n const worker = getElement(\"script[src]\")\n const [path] = worker.src.split(\"/worker\")\n\n /* Prefix base with path */\n base = base.replace(\"..\", path)\n }\n\n /* Add scripts for languages */\n const scripts = []\n for (const lang of config.lang) {\n switch (lang) {\n\n /* Add segmenter for Japanese */\n case \"ja\":\n scripts.push(`${base}/tinyseg.js`)\n break\n\n /* Add segmenter for Hindi and Thai */\n case \"hi\":\n case \"th\":\n scripts.push(`${base}/wordcut.js`)\n break\n }\n\n /* Add language support */\n if (lang !== \"en\")\n scripts.push(`${base}/min/lunr.${lang}.min.js`)\n }\n\n /* Add multi-language support */\n if (config.lang.length > 1)\n scripts.push(`${base}/min/lunr.multi.min.js`)\n\n /* Load scripts synchronously */\n if (scripts.length)\n await importScripts(\n `${base}/min/lunr.stemmer.support.min.js`,\n ...scripts\n )\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Message handler\n *\n * @param message - Source message\n *\n * @returns Target message\n */\nexport async function handler(\n message: SearchMessage\n): Promise {\n switch (message.type) {\n\n /* Search setup message */\n case SearchMessageType.SETUP:\n await setupSearchLanguages(message.data.config)\n index = new Search(message.data)\n return {\n type: SearchMessageType.READY\n }\n\n /* Search query message */\n case SearchMessageType.QUERY:\n const query = message.data\n try {\n return {\n type: SearchMessageType.RESULT,\n data: index.search(query)\n }\n\n /* Return empty result in case of error */\n } catch (err) {\n console.warn(`Invalid query: ${query} \u2013 see https://bit.ly/2s3ChXG`)\n console.warn(err)\n return {\n type: SearchMessageType.RESULT,\n data: { items: [] }\n }\n }\n\n /* All other messages */\n default:\n throw new TypeError(\"Invalid message type\")\n }\n}\n\n/* ----------------------------------------------------------------------------\n * Worker\n * ------------------------------------------------------------------------- */\n\n/* Expose Lunr.js in global scope, or stemmers won't work */\nself.lunr = lunr\n\n/* Monkey-patch Lunr.js to mitigate https://t.ly/68TLq */\nlunr.utils.warn = console.warn\n\n/* Handle messages */\naddEventListener(\"message\", async ev => {\n postMessage(await handler(ev.data))\n})\n", "/*\n * Copyright (c) 2016-2024 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Retrieve all elements matching the query selector\n *\n * @template T - Element type\n *\n * @param selector - Query selector\n * @param node - Node of reference\n *\n * @returns Elements\n */\nexport function getElements(\n selector: T, node?: ParentNode\n): HTMLElementTagNameMap[T][]\n\nexport function getElements(\n selector: string, node?: ParentNode\n): T[]\n\nexport function getElements(\n selector: string, node: ParentNode = document\n): T[] {\n return Array.from(node.querySelectorAll(selector))\n}\n\n/**\n * Retrieve an element matching a query selector or throw a reference error\n *\n * Note that this function assumes that the element is present. If unsure if an\n * element is existent, use the `getOptionalElement` function instead.\n *\n * @template T - Element type\n *\n * @param selector - Query selector\n * @param node - Node of reference\n *\n * @returns Element\n */\nexport function getElement(\n selector: T, node?: ParentNode\n): HTMLElementTagNameMap[T]\n\nexport function getElement(\n selector: string, node?: ParentNode\n): T\n\nexport function getElement(\n selector: string, node: ParentNode = document\n): T {\n const el = getOptionalElement(selector, node)\n if (typeof el === \"undefined\")\n throw new ReferenceError(\n `Missing element: expected \"${selector}\" to be present`\n )\n\n /* Return element */\n return el\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Retrieve an optional element matching the query selector\n *\n * @template T - Element type\n *\n * @param selector - Query selector\n * @param node - Node of reference\n *\n * @returns Element or nothing\n */\nexport function getOptionalElement(\n selector: T, node?: ParentNode\n): HTMLElementTagNameMap[T] | undefined\n\nexport function getOptionalElement(\n selector: string, node?: ParentNode\n): T | undefined\n\nexport function getOptionalElement(\n selector: string, node: ParentNode = document\n): T | undefined {\n return node.querySelector(selector) || undefined\n}\n\n/**\n * Retrieve the currently active element\n *\n * @returns Element or nothing\n */\nexport function getActiveElement(): HTMLElement | undefined {\n return (\n document.activeElement?.shadowRoot?.activeElement as HTMLElement ??\n document.activeElement as HTMLElement ??\n undefined\n )\n}\n", "/*\n * Copyright (c) 2016-2024 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Polyfills\n * ------------------------------------------------------------------------- */\n\n/* Polyfill `Object.entries` */\nif (!Object.entries)\n Object.entries = function (obj: object) {\n const data: [string, string][] = []\n for (const key of Object.keys(obj))\n // @ts-expect-error - ignore property access warning\n data.push([key, obj[key]])\n\n /* Return entries */\n return data\n }\n\n/* Polyfill `Object.values` */\nif (!Object.values)\n Object.values = function (obj: object) {\n const data: string[] = []\n for (const key of Object.keys(obj))\n // @ts-expect-error - ignore property access warning\n data.push(obj[key])\n\n /* Return values */\n return data\n }\n\n/* ------------------------------------------------------------------------- */\n\n/* Polyfills for `Element` */\nif (typeof Element !== \"undefined\") {\n\n /* Polyfill `Element.scrollTo` */\n if (!Element.prototype.scrollTo)\n Element.prototype.scrollTo = function (\n x?: ScrollToOptions | number, y?: number\n ): void {\n if (typeof x === \"object\") {\n this.scrollLeft = x.left!\n this.scrollTop = x.top!\n } else {\n this.scrollLeft = x!\n this.scrollTop = y!\n }\n }\n\n /* Polyfill `Element.replaceWith` */\n if (!Element.prototype.replaceWith)\n Element.prototype.replaceWith = function (\n ...nodes: Array\n ): void {\n const parent = this.parentNode\n if (parent) {\n if (nodes.length === 0)\n parent.removeChild(this)\n\n /* Replace children and create text nodes */\n for (let i = nodes.length - 1; i >= 0; i--) {\n let node = nodes[i]\n if (typeof node === \"string\")\n node = document.createTextNode(node)\n else if (node.parentNode)\n node.parentNode.removeChild(node)\n\n /* Replace child or insert before previous sibling */\n if (!i)\n parent.replaceChild(node, this)\n else\n parent.insertBefore(this.previousSibling!, node)\n }\n }\n }\n}\n", "/*\n * Copyright (c) 2016-2024 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search configuration\n */\nexport interface SearchConfig {\n lang: string[] /* Search languages */\n separator: string /* Search separator */\n pipeline: SearchPipelineFn[] /* Search pipeline */\n}\n\n/**\n * Search document\n */\nexport interface SearchDocument {\n location: string /* Document location */\n title: string /* Document title */\n text: string /* Document text */\n tags?: string[] /* Document tags */\n boost?: number /* Document boost */\n parent?: SearchDocument /* Document parent */\n}\n\n/**\n * Search options\n */\nexport interface SearchOptions {\n suggest: boolean /* Search suggestions */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search index\n */\nexport interface SearchIndex {\n config: SearchConfig /* Search configuration */\n docs: SearchDocument[] /* Search documents */\n options: SearchOptions /* Search options */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search pipeline function\n */\ntype SearchPipelineFn =\n | \"trimmer\" /* Trimmer */\n | \"stopWordFilter\" /* Stop word filter */\n | \"stemmer\" /* Stemmer */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Create a search document map\n *\n * This function creates a mapping of URLs (including anchors) to the actual\n * articles and sections. It relies on the invariant that the search index is\n * ordered with the main article appearing before all sections with anchors.\n * If this is not the case, the logic music be changed.\n *\n * @param docs - Search documents\n *\n * @returns Search document map\n */\nexport function setupSearchDocumentMap(\n docs: SearchDocument[]\n): Map {\n const map = new Map()\n for (const doc of docs) {\n const [path] = doc.location.split(\"#\")\n\n /* Add document article */\n const article = map.get(path)\n if (typeof article === \"undefined\") {\n map.set(path, doc)\n\n /* Add document section */\n } else {\n map.set(doc.location, doc)\n doc.parent = article\n }\n }\n\n /* Return search document map */\n return map\n}\n", "/*\n * Copyright (c) 2016-2024 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Visitor function\n *\n * @param start - Start offset\n * @param end - End offset\n */\ntype VisitorFn = (\n start: number, end: number\n) => void\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Split a string using the given separator\n *\n * @param input - Input value\n * @param separator - Separator\n * @param fn - Visitor function\n */\nexport function split(\n input: string, separator: RegExp, fn: VisitorFn\n): void {\n separator = new RegExp(separator, \"g\")\n\n /* Split string using separator */\n let match: RegExpExecArray | null\n let index = 0\n do {\n match = separator.exec(input)\n\n /* Emit non-empty range */\n const until = match?.index ?? input.length\n if (index < until)\n fn(index, until)\n\n /* Update last index */\n if (match) {\n const [term] = match\n index = match.index + term.length\n\n /* Support zero-length lookaheads */\n if (term.length === 0)\n separator.lastIndex = match.index + 1\n }\n } while (match)\n}\n", "/*\n * Copyright (c) 2016-2024 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Extraction type\n *\n * This type defines the possible values that are encoded into the first two\n * bits of a section that is part of the blocks of a tokenization table. There\n * are three types of interest: HTML opening and closing tags, as well as the\n * actual text content we need to extract for indexing.\n */\nexport const enum Extract {\n TAG_OPEN = 0, /* HTML opening tag */\n TEXT = 1, /* Text content */\n TAG_CLOSE = 2 /* HTML closing tag */\n}\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Visitor function\n *\n * @param block - Block index\n * @param type - Extraction type\n * @param start - Start offset\n * @param end - End offset\n */\ntype VisitorFn = (\n block: number, type: Extract, start: number, end: number\n) => void\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Split a string into markup and text sections\n *\n * This function scans a string and divides it up into sections of markup and\n * text. For each section, it invokes the given visitor function with the block\n * index, extraction type, as well as start and end offsets. Using a visitor\n * function (= streaming data) is ideal for minimizing pressure on the GC.\n *\n * @param input - Input value\n * @param fn - Visitor function\n */\nexport function extract(\n input: string, fn: VisitorFn\n): void {\n\n let block = 0 /* Current block */\n let start = 0 /* Current start offset */\n let end = 0 /* Current end offset */\n\n /* Split string into sections */\n for (let stack = 0; end < input.length; end++) {\n\n /* Opening tag after non-empty section */\n if (input.charAt(end) === \"<\" && end > start) {\n fn(block, Extract.TEXT, start, start = end)\n\n /* Closing tag */\n } else if (input.charAt(end) === \">\") {\n if (input.charAt(start + 1) === \"/\") {\n if (--stack === 0)\n fn(block++, Extract.TAG_CLOSE, start, end + 1)\n\n /* Tag is not self-closing */\n } else if (input.charAt(end - 1) !== \"/\") {\n if (stack++ === 0)\n fn(block, Extract.TAG_OPEN, start, end + 1)\n }\n\n /* New section */\n start = end + 1\n }\n }\n\n /* Add trailing section */\n if (end > start)\n fn(block, Extract.TEXT, start, end)\n}\n", "/*\n * Copyright (c) 2016-2024 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Position table\n */\nexport type PositionTable = number[][]\n\n/**\n * Position\n */\nexport type Position = number\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Highlight all occurrences in a string\n *\n * This function receives a field's value (e.g. like `title` or `text`), it's\n * position table that was generated during indexing, and the positions found\n * when executing the query. It then highlights all occurrences, and returns\n * their concatenation. In case of multiple blocks, two are returned.\n *\n * @param input - Input value\n * @param table - Table for indexing\n * @param positions - Occurrences\n * @param full - Full results\n *\n * @returns Highlighted string value\n */\nexport function highlight(\n input: string, table: PositionTable, positions: Position[], full = false\n): string {\n return highlightAll([input], table, positions, full).pop()!\n}\n\n/**\n * Highlight all occurrences in a set of strings\n *\n * @param inputs - Input values\n * @param table - Table for indexing\n * @param positions - Occurrences\n * @param full - Full results\n *\n * @returns Highlighted string values\n */\nexport function highlightAll(\n inputs: string[], table: PositionTable, positions: Position[], full = false\n): string[] {\n\n /* Map blocks to input values */\n const mapping = [0]\n for (let t = 1; t < table.length; t++) {\n const prev = table[t - 1]\n const next = table[t]\n\n /* Check if table points to new block */\n const p = prev[prev.length - 1] >>> 2 & 0x3FF\n const q = next[0] >>> 12\n\n /* Add block to mapping */\n mapping.push(+(p > q) + mapping[mapping.length - 1])\n }\n\n /* Highlight strings one after another */\n return inputs.map((input, i) => {\n let cursor = 0\n\n /* Map occurrences to blocks */\n const blocks = new Map()\n for (const p of positions.sort((a, b) => a - b)) {\n const index = p & 0xFFFFF\n const block = p >>> 20\n if (mapping[block] !== i)\n continue\n\n /* Ensure presence of block group */\n let group = blocks.get(block)\n if (typeof group === \"undefined\")\n blocks.set(block, group = [])\n\n /* Add index to group */\n group.push(index)\n }\n\n /* Just return string, if no occurrences */\n if (blocks.size === 0)\n return input\n\n /* Compute slices */\n const slices: string[] = []\n for (const [block, indexes] of blocks) {\n const t = table[block]\n\n /* Extract positions and length */\n const start = t[0] >>> 12\n const end = t[t.length - 1] >>> 12\n const length = t[t.length - 1] >>> 2 & 0x3FF\n\n /* Add prefix, if full results are desired */\n if (full && start > cursor)\n slices.push(input.slice(cursor, start))\n\n /* Extract and highlight slice */\n let slice = input.slice(start, end + length)\n for (const j of indexes.sort((a, b) => b - a)) {\n\n /* Retrieve offset and length of match */\n const p = (t[j] >>> 12) - start\n const q = (t[j] >>> 2 & 0x3FF) + p\n\n /* Wrap occurrence */\n slice = [\n slice.slice(0, p),\n \"\",\n slice.slice(p, q),\n \"\",\n slice.slice(q)\n ].join(\"\")\n }\n\n /* Update cursor */\n cursor = end + length\n\n /* Append slice and abort if we have two */\n if (slices.push(slice) === 2)\n break\n }\n\n /* Add suffix, if full results are desired */\n if (full && cursor < input.length)\n slices.push(input.slice(cursor))\n\n /* Return highlighted slices */\n return slices.join(\"\")\n })\n}\n", "/*\n * Copyright (c) 2016-2024 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { split } from \"../_\"\nimport {\n Extract,\n extract\n} from \"../extract\"\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Split a string or set of strings into tokens\n *\n * This tokenizer supersedes the default tokenizer that is provided by Lunr.js,\n * as it is aware of HTML tags and allows for multi-character splitting.\n *\n * It takes the given inputs, splits each of them into markup and text sections,\n * tokenizes and segments (if necessary) each of them, and then indexes them in\n * a table by using a compact bit representation. Bitwise techniques are used\n * to write and read from the table during indexing and querying.\n *\n * @see https://bit.ly/3W3Xw4J - Search: better, faster, smaller\n *\n * @param input - Input value(s)\n *\n * @returns Tokens\n */\nexport function tokenize(\n input?: string | string[]\n): lunr.Token[] {\n const tokens: lunr.Token[] = []\n if (typeof input === \"undefined\")\n return tokens\n\n /* Tokenize strings one after another */\n const inputs = Array.isArray(input) ? input : [input]\n for (let i = 0; i < inputs.length; i++) {\n const table = lunr.tokenizer.table\n const total = table.length\n\n /* Split string into sections and tokenize content blocks */\n extract(inputs[i], (block, type, start, end) => {\n table[block += total] ||= []\n switch (type) {\n\n /* Handle markup */\n case Extract.TAG_OPEN:\n case Extract.TAG_CLOSE:\n table[block].push(\n start << 12 |\n end - start << 2 |\n type\n )\n break\n\n /* Handle text content */\n case Extract.TEXT:\n const section = inputs[i].slice(start, end)\n split(section, lunr.tokenizer.separator, (index, until) => {\n\n /**\n * Apply segmenter after tokenization. Note that the segmenter will\n * also split words at word boundaries, which is not what we want,\n * so we need to check if we can somehow mitigate this behavior.\n */\n if (typeof lunr.segmenter !== \"undefined\") {\n const subsection = section.slice(index, until)\n if (/^[MHIK]$/.test(lunr.segmenter.ctype_(subsection))) {\n const segments = lunr.segmenter.segment(subsection)\n for (let s = 0, l = 0; s < segments.length; s++) {\n\n /* Add block to section */\n table[block] ||= []\n table[block].push(\n start + index + l << 12 |\n segments[s].length << 2 |\n type\n )\n\n /* Add token with position */\n tokens.push(new lunr.Token(\n segments[s].toLowerCase(), {\n position: block << 20 | table[block].length - 1\n }\n ))\n\n /* Keep track of length */\n l += segments[s].length\n }\n return\n }\n }\n\n /* Add block to section */\n table[block].push(\n start + index << 12 |\n until - index << 2 |\n type\n )\n\n /* Add token with position */\n tokens.push(new lunr.Token(\n section.slice(index, until).toLowerCase(), {\n position: block << 20 | table[block].length - 1\n }\n ))\n })\n }\n })\n }\n\n /* Return tokens */\n return tokens\n}\n", "/*\n * Copyright (c) 2016-2024 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Helper types\n * ------------------------------------------------------------------------- */\n\n/**\n * Visitor function\n *\n * @param value - String value\n *\n * @returns String term(s)\n */\ntype VisitorFn = (\n value: string\n) => string | string[]\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Default transformation function\n *\n * 1. Trim excess whitespace from left and right.\n *\n * 2. Search for parts in quotation marks and prepend a `+` modifier to denote\n * that the resulting document must contain all parts, converting the query\n * to an `AND` query (as opposed to the default `OR` behavior). While users\n * may expect parts enclosed in quotation marks to map to span queries, i.e.\n * for which order is important, Lunr.js doesn't support them, so the best\n * we can do is to convert the parts to an `AND` query.\n *\n * 3. Replace control characters which are not located at the beginning of the\n * query or preceded by white space, or are not followed by a non-whitespace\n * character or are at the end of the query string. Furthermore, filter\n * unmatched quotation marks.\n *\n * 4. Split the query string at whitespace, then pass each part to the visitor\n * function for tokenization, and append a wildcard to every resulting term\n * that is not explicitly marked with a `+`, `-`, `~` or `^` modifier, since\n * it ensures consistent and stable ranking when multiple terms are entered.\n * Also, if a fuzzy or boost modifier are given, but no numeric value has\n * been entered, default to 1 to not induce a query error.\n *\n * @param query - Query value\n * @param fn - Visitor function\n *\n * @returns Transformed query value\n */\nexport function transform(\n query: string, fn: VisitorFn = term => term\n): string {\n return query\n\n /* => 1 */\n .trim()\n\n /* => 2 */\n .split(/\"([^\"]+)\"/g)\n .map((parts, index) => index & 1\n ? parts.replace(/^\\b|^(?![^\\x00-\\x7F]|$)|\\s+/g, \" +\")\n : parts\n )\n .join(\"\")\n\n /* => 3 */\n .replace(/\"|(?:^|\\s+)[*+\\-:^~]+(?=\\s+|$)/g, \"\")\n\n /* => 4 */\n .split(/\\s+/g)\n .reduce((prev, term) => {\n const next = fn(term)\n return [...prev, ...Array.isArray(next) ? next : [next]]\n }, [] as string[])\n .map(term => /([~^]$)/.test(term) ? `${term}1` : term)\n .map(term => /(^[+-]|[~^]\\d+$)/.test(term) ? term : `${term}*`)\n .join(\" \")\n}\n", "/*\n * Copyright (c) 2016-2024 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { split } from \"../../internal\"\nimport { transform } from \"../transform\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search query clause\n */\nexport interface SearchQueryClause {\n presence: lunr.Query.presence /* Clause presence */\n term: string /* Clause term */\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Search query terms\n */\nexport type SearchQueryTerms = Record\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Transform search query\n *\n * This function lexes the given search query and applies the transformation\n * function to each term, preserving markup like `+` and `-` modifiers.\n *\n * @param query - Search query\n *\n * @returns Search query\n */\nexport function transformSearchQuery(\n query: string\n): string {\n\n /* Split query terms with tokenizer */\n return transform(query, part => {\n const terms: string[] = []\n\n /* Initialize lexer and analyze part */\n const lexer = new lunr.QueryLexer(part)\n lexer.run()\n\n /* Extract and tokenize term from lexeme */\n for (const { type, str: term, start, end } of lexer.lexemes)\n switch (type) {\n\n /* Hack: remove colon - see https://bit.ly/3wD3T3I */\n case \"FIELD\":\n if (![\"title\", \"text\", \"tags\"].includes(term))\n part = [\n part.slice(0, end),\n \" \",\n part.slice(end + 1)\n ].join(\"\")\n break\n\n /* Tokenize term */\n case \"TERM\":\n split(term, lunr.tokenizer.separator, (...range) => {\n terms.push([\n part.slice(0, start),\n term.slice(...range),\n part.slice(end)\n ].join(\"\"))\n })\n }\n\n /* Return terms */\n return terms\n })\n}\n\n/* ------------------------------------------------------------------------- */\n\n/**\n * Parse a search query for analysis\n *\n * Lunr.js itself has a bug where it doesn't detect or remove wildcards for\n * query clauses, so we must do this here.\n *\n * @see https://bit.ly/3DpTGtz - GitHub issue\n *\n * @param value - Query value\n *\n * @returns Search query clauses\n */\nexport function parseSearchQuery(\n value: string\n): SearchQueryClause[] {\n const query = new lunr.Query([\"title\", \"text\", \"tags\"])\n const parser = new lunr.QueryParser(value, query)\n\n /* Parse Search query */\n parser.parse()\n for (const clause of query.clauses) {\n clause.usePipeline = true\n\n /* Handle leading wildcard */\n if (clause.term.startsWith(\"*\")) {\n clause.wildcard = lunr.Query.wildcard.LEADING\n clause.term = clause.term.slice(1)\n }\n\n /* Handle trailing wildcard */\n if (clause.term.endsWith(\"*\")) {\n clause.wildcard = lunr.Query.wildcard.TRAILING\n clause.term = clause.term.slice(0, -1)\n }\n }\n\n /* Return query clauses */\n return query.clauses\n}\n\n/**\n * Analyze the search query clauses in regard to the search terms found\n *\n * @param query - Search query clauses\n * @param terms - Search terms\n *\n * @returns Search query terms\n */\nexport function getSearchQueryTerms(\n query: SearchQueryClause[], terms: string[]\n): SearchQueryTerms {\n const clauses = new Set(query)\n\n /* Match query clauses against terms */\n const result: SearchQueryTerms = {}\n for (let t = 0; t < terms.length; t++)\n for (const clause of clauses)\n if (terms[t].startsWith(clause.term)) {\n result[clause.term] = true\n clauses.delete(clause)\n }\n\n /* Annotate unmatched non-stopword query clauses */\n for (const clause of clauses)\n if (lunr.stopWordFilter?.(clause.term))\n result[clause.term] = false\n\n /* Return query terms */\n return result\n}\n", "/*\n * Copyright (c) 2016-2024 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Segment a search query using the inverted index\n *\n * This function implements a clever approach to text segmentation for Asian\n * languages, as it used the information already available in the search index.\n * The idea is to greedily segment the search query based on the tokens that are\n * already part of the index, as described in the linked issue.\n *\n * @see https://bit.ly/3lwjrk7 - GitHub issue\n *\n * @param query - Query value\n * @param index - Inverted index\n *\n * @returns Segmented query value\n */\nexport function segment(\n query: string, index: object\n): Iterable {\n const segments = new Set()\n\n /* Segment search query */\n const wordcuts = new Uint16Array(query.length)\n for (let i = 0; i < query.length; i++)\n for (let j = i + 1; j < query.length; j++) {\n const value = query.slice(i, j)\n if (value in index)\n wordcuts[i] = j - i\n }\n\n /* Compute longest matches with minimum overlap */\n const stack = [0]\n for (let s = stack.length; s > 0;) {\n const p = stack[--s]\n for (let q = 1; q < wordcuts[p]; q++)\n if (wordcuts[p + q] > wordcuts[p] - q) {\n segments.add(query.slice(p, p + q))\n stack[s++] = p + q\n }\n\n /* Continue at end of query string */\n const q = p + wordcuts[p]\n if (wordcuts[q] && q < query.length - 1)\n stack[s++] = q\n\n /* Add current segment */\n segments.add(query.slice(p, q))\n }\n\n // @todo fix this case in the code block above, this is a hotfix\n if (segments.has(\"\"))\n return new Set([query])\n\n /* Return segmented query value */\n return segments\n}\n", "/*\n * Copyright (c) 2016-2024 Martin Donath \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport {\n SearchDocument,\n SearchIndex,\n SearchOptions,\n setupSearchDocumentMap\n} from \"../config\"\nimport {\n Position,\n PositionTable,\n highlight,\n highlightAll,\n tokenize\n} from \"../internal\"\nimport {\n SearchQueryTerms,\n getSearchQueryTerms,\n parseSearchQuery,\n segment,\n transformSearchQuery\n} from \"../query\"\n\n/* ----------------------------------------------------------------------------\n * Types\n * ------------------------------------------------------------------------- */\n\n/**\n * Search item\n */\nexport interface SearchItem\n extends SearchDocument\n{\n score: number /* Score (relevance) */\n terms: SearchQueryTerms /* Search query terms */\n}\n\n/**\n * Search result\n */\nexport interface SearchResult {\n items: SearchItem[][] /* Search items */\n suggest?: string[] /* Search suggestions */\n}\n\n/* ----------------------------------------------------------------------------\n * Functions\n * ------------------------------------------------------------------------- */\n\n/**\n * Create field extractor factory\n *\n * @param table - Position table map\n *\n * @returns Extractor factory\n */\nfunction extractor(table: Map) {\n return (name: keyof SearchDocument) => {\n return (doc: SearchDocument) => {\n if (typeof doc[name] === \"undefined\")\n return undefined\n\n /* Compute identifier and initialize table */\n const id = [doc.location, name].join(\":\")\n table.set(id, lunr.tokenizer.table = [])\n\n /* Return field value */\n return doc[name]\n }\n }\n}\n\n/**\n * Compute the difference of two lists of strings\n *\n * @param a - 1st list of strings\n * @param b - 2nd list of strings\n *\n * @returns Difference\n */\nfunction difference(a: string[], b: string[]): string[] {\n const [x, y] = [new Set(a), new Set(b)]\n return [\n ...new Set([...x].filter(value => !y.has(value)))\n ]\n}\n\n/* ----------------------------------------------------------------------------\n * Class\n * ------------------------------------------------------------------------- */\n\n/**\n * Search index\n */\nexport class Search {\n\n /**\n * Search document map\n */\n protected map: Map\n\n /**\n * Search options\n */\n protected options: SearchOptions\n\n /**\n * The underlying Lunr.js search index\n */\n protected index: lunr.Index\n\n /**\n * Internal position table map\n */\n protected table: Map\n\n /**\n * Create the search integration\n *\n * @param data - Search index\n */\n public constructor({ config, docs, options }: SearchIndex) {\n const field = extractor(this.table = new Map())\n\n /* Set up document map and options */\n this.map = setupSearchDocumentMap(docs)\n this.options = options\n\n /* Set up document index */\n this.index = lunr(function () {\n this.metadataWhitelist = [\"position\"]\n this.b(0)\n\n /* Set up (multi-)language support */\n if (config.lang.length === 1 && config.lang[0] !== \"en\") {\n // @ts-expect-error - namespace indexing not supported\n this.use(lunr[config.lang[0]])\n } else if (config.lang.length > 1) {\n this.use(lunr.multiLanguage(...config.lang))\n }\n\n /* Set up custom tokenizer (must be after language setup) */\n this.tokenizer = tokenize as typeof lunr.tokenizer\n lunr.tokenizer.separator = new RegExp(config.separator)\n\n /* Set up custom segmenter, if loaded */\n lunr.segmenter = \"TinySegmenter\" in lunr\n ? new lunr.TinySegmenter()\n : undefined\n\n /* Compute functions to be removed from the pipeline */\n const fns = difference([\n \"trimmer\", \"stopWordFilter\", \"stemmer\"\n ], config.pipeline)\n\n /* Remove functions from the pipeline for registered languages */\n for (const lang of config.lang.map(language => (\n // @ts-expect-error - namespace indexing not supported\n language === \"en\" ? lunr : lunr[language]\n )))\n for (const fn of fns) {\n this.pipeline.remove(lang[fn])\n this.searchPipeline.remove(lang[fn])\n }\n\n /* Set up index reference */\n this.ref(\"location\")\n\n /* Set up index fields */\n this.field(\"title\", { boost: 1e3, extractor: field(\"title\") })\n this.field(\"text\", { boost: 1e0, extractor: field(\"text\") })\n this.field(\"tags\", { boost: 1e6, extractor: field(\"tags\") })\n\n /* Add documents to index */\n for (const doc of docs)\n this.add(doc, { boost: doc.boost })\n })\n }\n\n /**\n * Search for matching documents\n *\n * @param query - Search query\n *\n * @returns Search result\n */\n public search(query: string): SearchResult {\n\n // Experimental Chinese segmentation\n query = query.replace(/\\p{sc=Han}+/gu, value => {\n return [...segment(value, this.index.invertedIndex)]\n .join(\"* \")\n })\n\n // @todo: move segmenter (above) into transformSearchQuery\n query = transformSearchQuery(query)\n if (!query)\n return { items: [] }\n\n /* Parse query to extract clauses for analysis */\n const clauses = parseSearchQuery(query)\n .filter(clause => (\n clause.presence !== lunr.Query.presence.PROHIBITED\n ))\n\n /* Perform search and post-process results */\n const groups = this.index.search(query)\n\n /* Apply post-query boosts based on title and search query terms */\n .reduce((item, { ref, score, matchData }) => {\n let doc = this.map.get(ref)\n if (typeof doc !== \"undefined\") {\n\n /* Shallow copy document */\n doc = { ...doc }\n if (doc.tags)\n doc.tags = [...doc.tags]\n\n /* Compute and analyze search query terms */\n const terms = getSearchQueryTerms(\n clauses,\n Object.keys(matchData.metadata)\n )\n\n /* Highlight matches in fields */\n for (const field of this.index.fields) {\n if (typeof doc[field] === \"undefined\")\n continue\n\n /* Collect positions from matches */\n const positions: Position[] = []\n for (const match of Object.values(matchData.metadata))\n if (typeof match[field] !== \"undefined\")\n positions.push(...match[field].position)\n\n /* Skip highlighting, if no positions were collected */\n if (!positions.length)\n continue\n\n /* Load table and determine highlighting method */\n const table = this.table.get([doc.location, field].join(\":\"))!\n const fn = Array.isArray(doc[field])\n ? highlightAll\n : highlight\n\n // @ts-expect-error - stop moaning, TypeScript!\n doc[field] = fn(doc[field], table, positions, field !== \"text\")\n }\n\n /* Highlight title and text and apply post-query boosts */\n const boost = +!doc.parent +\n Object.values(terms)\n .filter(t => t).length /\n Object.keys(terms).length\n\n /* Append item */\n item.push({\n ...doc,\n score: score * (1 + boost ** 2),\n terms\n })\n }\n return item\n }, [])\n\n /* Sort search results again after applying boosts */\n .sort((a, b) => b.score - a.score)\n\n /* Group search results by article */\n .reduce((items, result) => {\n const doc = this.map.get(result.location)\n if (typeof doc !== \"undefined\") {\n const ref = doc.parent\n ? doc.parent.location\n : doc.location\n items.set(ref, [...items.get(ref) || [], result])\n }\n return items\n }, new Map())\n\n /* Ensure that every item set has an article */\n for (const [ref, items] of groups)\n if (!items.find(item => item.location === ref)) {\n const doc = this.map.get(ref)!\n items.push({ ...doc, score: 0, terms: {} })\n }\n\n /* Generate search suggestions, if desired */\n let suggest: string[] | undefined\n if (this.options.suggest) {\n const titles = this.index.query(builder => {\n for (const clause of clauses)\n builder.term(clause.term, {\n fields: [\"title\"],\n presence: lunr.Query.presence.REQUIRED,\n wildcard: lunr.Query.wildcard.TRAILING\n })\n })\n\n /* Retrieve suggestions for best match */\n suggest = titles.length\n ? Object.keys(titles[0].matchData.metadata)\n : []\n }\n\n /* Return search result */\n return {\n items: [...groups.values()],\n ...typeof suggest !== \"undefined\" && { suggest }\n }\n }\n}\n"], + "mappings": "6lCAAA,IAAAA,GAAAC,GAAA,CAAAC,GAAAC,KAAA;AAAA;AAAA;AAAA;AAAA,IAME,UAAU,CAiCZ,IAAIC,EAAO,SAAUC,EAAQ,CAC3B,IAAIC,EAAU,IAAIF,EAAK,QAEvB,OAAAE,EAAQ,SAAS,IACfF,EAAK,QACLA,EAAK,eACLA,EAAK,OACP,EAEAE,EAAQ,eAAe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GAaA,SAAsBE,GACpBC,EACwB,QAAAR,EAAA,sBACxB,OAAQQ,EAAQ,KAAM,CAGpB,OACE,aAAMV,GAAqBU,EAAQ,KAAK,MAAM,EAC9CX,GAAQ,IAAIY,EAAOD,EAAQ,IAAI,EACxB,CACL,MACF,EAGF,OACE,IAAME,EAAQF,EAAQ,KACtB,GAAI,CACF,MAAO,CACL,OACA,KAAMX,GAAM,OAAOa,CAAK,CAC1B,CAGF,OAASC,EAAK,CACZ,eAAQ,KAAK,kBAAkBD,CAAK,oCAA+B,EACnE,QAAQ,KAAKC,CAAG,EACT,CACL,OACA,KAAM,CAAE,MAAO,CAAC,CAAE,CACpB,CACF,CAGF,QACE,MAAM,IAAI,UAAU,sBAAsB,CAC9C,CACF,GAOA,KAAK,KAAO,EAAAC,QAGZ,EAAAA,QAAK,MAAM,KAAO,QAAQ,KAG1B,iBAAiB,UAAiBC,GAAMb,EAAA,wBACtC,YAAY,MAAMO,GAAQM,EAAG,IAAI,CAAC,CACpC,EAAC", "names": ["require_lunr", "__commonJSMin", "exports", "module", "lunr", "config", "builder", "global", "message", "obj", "clone", "keys", "key", "val", "docRef", "fieldName", "stringValue", "s", "n", "fieldRef", "elements", "i", "other", "object", "a", "b", "intersection", "element", "posting", "documentCount", "documentsWithTerm", "x", "str", "metadata", "fn", "t", "len", "tokens", "sliceEnd", "sliceStart", "char", "sliceLength", "tokenMetadata", "label", "isRegistered", "serialised", "pipeline", "fnName", "fns", "existingFn", "newFn", "pos", "stackLength", "memo", "j", "result", "k", "token", "index", "start", "end", "pivotPoint", "pivotIndex", "insertIdx", "position", "sumOfSquares", "elementsLength", "otherVector", "dotProduct", "aLen", "bLen", "aVal", "bVal", "output", "step2list", "step3list", "c", "v", "C", "V", "mgr0", "meq1", "mgr1", "s_v", "re_mgr0", "re_mgr1", "re_meq1", "re_s_v", "re_1a", "re2_1a", "re_1b", "re2_1b", "re_1b_2", "re2_1b_2", "re3_1b_2", "re4_1b_2", "re_1c", "re_2", "re_3", "re_4", "re2_4", "re_5", "re_5_1", "re3_5", "porterStemmer", "w", "stem", "suffix", "firstch", "re", "re2", "re3", "re4", "fp", "stopWords", "words", "stopWord", "arr", "clause", "editDistance", "root", "stack", "frame", "noEditNode", "insertionNode", "substitutionNode", "charA", "charB", "transposeNode", "node", "final", "next", "edges", "edge", "labels", "qEdges", "qLen", "nEdges", "nLen", "q", "qEdge", "nEdge", "qNode", "word", "commonPrefix", "nextNode", "downTo", "childKey", "attrs", "queryString", "query", "parser", "matchingFields", "queryVectors", "termFieldCache", "requiredMatches", "prohibitedMatches", "terms", "clauseMatches", "m", "term", "termTokenSet", "expandedTerms", "field", "expandedTerm", "termIndex", "fieldPosting", "matchingDocumentRefs", "termField", "matchingDocumentsSet", "l", "matchingDocumentRef", "matchingFieldRef", "fieldMatch", "allRequiredMatches", "allProhibitedMatches", "matchingFieldRefs", "results", "matches", "fieldVector", "score", "docMatch", "match", "invertedIndex", "fieldVectors", "ref", "serializedIndex", "serializedVectors", "serializedInvertedIndex", "tokenSetBuilder", "tuple", "attributes", "number", "doc", "fields", "extractor", "fieldTerms", "metadataKey", "fieldRefs", "numberOfFields", "accumulator", "documentsWithField", "fieldRefsLength", "termIdfCache", "fieldLength", "termFrequencies", "termsLength", "fieldBoost", "docBoost", "tf", "idf", "scoreWithPrecision", "args", "clonedMetadata", "metadataKeys", "otherMatchData", "allFields", "options", "state", "subSlices", "type", "charCode", "lexer", "lexeme", "completedClause", "errorMessage", "nextLexeme", "possibleFields", "f", "boost", "factory", "import_lunr", "getElement", "selector", "node", "el", "getOptionalElement", "obj", "data", "key", "x", "y", "nodes", "parent", "i", "node", "setupSearchDocumentMap", "docs", "map", "doc", "path", "article", "split", "input", "separator", "fn", "_a", "match", "index", "until", "term", "extract", "input", "fn", "block", "start", "end", "stack", "highlight", "input", "table", "positions", "full", "highlightAll", "inputs", "mapping", "t", "prev", "next", "p", "q", "i", "cursor", "blocks", "a", "b", "index", "block", "group", "slices", "indexes", "start", "end", "length", "slice", "j", "tokenize", "input", "tokens", "inputs", "i", "table", "total", "extract", "block", "type", "start", "end", "_a", "section", "split", "index", "until", "subsection", "segments", "s", "l", "transform", "query", "fn", "term", "parts", "index", "prev", "next", "transformSearchQuery", "query", "transform", "part", "terms", "lexer", "type", "term", "start", "end", "split", "range", "parseSearchQuery", "value", "clause", "getSearchQueryTerms", "_a", "clauses", "result", "t", "segment", "query", "index", "segments", "wordcuts", "i", "j", "stack", "p", "q", "extractor", "table", "name", "doc", "id", "difference", "a", "b", "x", "y", "value", "Search", "config", "docs", "options", "field", "setupSearchDocumentMap", "tokenize", "fns", "lang", "language", "fn", "query", "segment", "transformSearchQuery", "clauses", "parseSearchQuery", "clause", "groups", "item", "ref", "score", "matchData", "__spreadValues", "terms", "getSearchQueryTerms", "positions", "match", "highlightAll", "highlight", "boost", "t", "__spreadProps", "__pow", "items", "result", "suggest", "titles", "builder", "index", "setupSearchLanguages", "config", "__async", "base", "worker", "getElement", "path", "scripts", "lang", "handler", "message", "Search", "query", "err", "lunr", "ev"] } diff --git a/contact/index.html b/contact/index.html index a42c18f..d445b69 100644 --- a/contact/index.html +++ b/contact/index.html @@ -14,7 +14,7 @@ - + @@ -1051,7 +1051,7 @@

Phasing engine: {"base": "..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/data-sensitivity/index.html b/data-sensitivity/index.html index b10e189..11e27d9 100644 --- a/data-sensitivity/index.html +++ b/data-sensitivity/index.html @@ -16,7 +16,7 @@ - + @@ -1093,7 +1093,7 @@

What enc - + diff --git a/faq/index.html b/faq/index.html index 4c8592a..102eefe 100644 --- a/faq/index.html +++ b/faq/index.html @@ -16,7 +16,7 @@ - + @@ -1065,7 +1065,7 @@

Yo - + diff --git a/getting-started/index.html b/getting-started/index.html index 12c6b29..8b5de2a 100644 --- a/getting-started/index.html +++ b/getting-started/index.html @@ -16,7 +16,7 @@ - + @@ -1417,7 +1417,7 @@

Download all results at once{"base": "..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/images/logo.png b/images/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..d423c30f1e89968425328c3695cbefa86c2d71d8 GIT binary patch literal 17414 zcmXtA18`)|*PYn5ZQI<~wr!geY^;r)Y_hR!b7O35+x9=duj+eMZ{|(c>pML?-S?b( z?yVQ8q#%g^iwg??01%|5#8dzPkofOwLuknFSLAtFzwbA2S5av-=pGJC)rW{a3ujHdj)kM%qV4&@SO}rscIcO7z3x-8OwG8mUCF{7# zWAjo>qEUM_>qJBmK$OK$#FczxMXBsPFJC_Dvdp+va#m8o-Grta6zkbMFT2(b*IlNb zkYj!yi@@k>&q{!zOXhpP|9jeP59HH8Mnv0_{HwM8yX_@9CI-H$nGb_hECRU?=r$Ee z$ifnP8paivB1I0OWK*vCB?kSBf&5fCt<%`t{D%79eL=fZUdVu=5%biz2VC}dP%(Ym zcGWK<863Z*uu6(Mn+`G((NJg<=z=*{P$LKD&lh>JGcGN3R(uhv7~!k?*jOT!H3Arv zZ&SifoP^-L@Wl1@XN*Zdkp*na6u;c$K<`E5UV(iun-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*)U~$oz;hS>4-Hwp)2oWO0IgGoZv;si+^t)|8_lh30t$mC7 z7Fn3*A`{S{Q!H9vI}5rR?0!&sa6kTjd=g}#&zUAY(k%WKv=}`O03d|GA3OHo*m3_7 zHkFiEapvT4*la$>jA&MC$)`t;>>d02&pE%sZ9rX!5FtXGJ5Z(n&9J-eHULo9@mzW5 z$@uF#Hbb(>cB+j@F`IE&dNC^z!5uj>L;K{tI>K9753Mj z10FSVjQD%|AAkP!_ijV$!_37}(+=CLCBNk#IXx0%TM2K^o%2S6j z0}=td@rZOhS5UFU^$(Gbtu`1H`$$&UBRJ1E{#p^5b%Y2J;vaxJLqM<_3p4D>q2Z4I zh2vbvc @@ -366,6 +377,36 @@ + + + + + + @@ -817,6 +858,23 @@ + + + @@ -833,6 +891,7 @@ +

Michigan Imputation Server
Free Next-Generation Genotype Imputation Platform

Michigan Imputation Server provides a free genotype imputation service using Minimac4. You can upload phased or unphased GWAS genotypes and receive phased and imputed genomes in return. Our server offers imputation from 1000 Genomes (Phase 1 and 3), CAAPA, HRC and the TOPMed reference panel. For all uploaded datasets an extensive QC is performed. The complete source code is hosted on GitHub.

Please cite this paper if you use Michigan Imputation Server in your publication:

@@ -840,7 +899,61 @@

Next-generation genotype imputation service and methods. Nature Genetics 48, 1284–1287 (2016).


-

+

Latest News

+

+ 21 May 2021
+ We have increased the max sample size to 110k. +

+ +

+ 15 April 2021
+ Update to new framework completed! Currently, max sample size will be limited to 25k, but we expect to lift this limitation in the next few weeks. +

+ +

+ 18 March 2020
+ Due to coronavirus-related impacts support may be slower than usual. If you haven't heard back from us after a week or so, feel free to e-mail again to check on the status of things. Take care! +

+ +

+ 07 November 2019
+ Updated MIS to v1.2.4! Major improvements: Minimac4 for imputation, improved chrX support, QC check right after upload, better documentation. Checkout out our GitHub repository for further information. +

+ +

+ 17 October 2019
+ Michigan Imputation Server at ASHG19. All information is available here. +

+ +

+ 27 November 2018
+ Redesigned user interface to improve user experience. +

+ +

+ 27 June 2017
+ Updated pipeline to v1.0.2. Release notes can be found here. +

+ +

+ 29 Aug 2016
+ Imputation server paper is out now: Das et al., Nature Genetics 2016 +

+ +

+ 19 April 2016
+ Updated HRC Panel (r1.1) available. +

+ +

+ 12 January 2016
+ New Reference Panel (CAAPA) available. +

+ +

+ 24 April 2015
+ HRC release 1 (64,976 haplotypes at 39,235,157 SNPs) is now ready for use for HRC consortium members. +

@@ -894,7 +1007,7 @@

{"base": ".", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/pgs/faq/index.html b/pgs/faq/index.html index 7615986..3dd6194 100644 --- a/pgs/faq/index.html +++ b/pgs/faq/index.html @@ -16,7 +16,7 @@ - + @@ -1025,7 +1025,7 @@

Can I perform PGS calculation loc - + diff --git a/pgs/getting-started/index.html b/pgs/getting-started/index.html index 1750824..231626b 100644 --- a/pgs/getting-started/index.html +++ b/pgs/getting-started/index.html @@ -16,7 +16,7 @@ - + @@ -1209,7 +1209,7 @@

Downloading Results{"base": "../..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/pgs/output-files/index.html b/pgs/output-files/index.html index 19248ce..e824570 100644 --- a/pgs/output-files/index.html +++ b/pgs/output-files/index.html @@ -16,7 +16,7 @@ - + @@ -1044,7 +1044,7 @@

Example{"base": "../..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/pgs/pipeline/index.html b/pgs/pipeline/index.html index f9003c6..1641ecc 100644 --- a/pgs/pipeline/index.html +++ b/pgs/pipeline/index.html @@ -16,7 +16,7 @@ - + @@ -946,7 +946,7 @@

Ancestry estimation{"base": "../..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/pgs/reference-panels/index.html b/pgs/reference-panels/index.html index 1807029..d809f6b 100644 --- a/pgs/reference-panels/index.html +++ b/pgs/reference-panels/index.html @@ -16,7 +16,7 @@ - + @@ -1108,7 +1108,7 @@

HapMap 2{"base": "../..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/pgs/report/index.html b/pgs/report/index.html index 9c75d52..1696281 100644 --- a/pgs/report/index.html +++ b/pgs/report/index.html @@ -16,7 +16,7 @@ - + @@ -891,7 +891,7 @@

Interactive Report{"base": "../..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/pgs/scores/index.html b/pgs/scores/index.html index 6dd6ecd..a4652cb 100644 --- a/pgs/scores/index.html +++ b/pgs/scores/index.html @@ -16,7 +16,7 @@ - + @@ -995,7 +995,7 @@

ExPRSweb{"base": "../..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/pgs/tutorial/index.html b/pgs/tutorial/index.html index c4bd804..397ec7b 100644 --- a/pgs/tutorial/index.html +++ b/pgs/tutorial/index.html @@ -12,7 +12,7 @@ - + @@ -891,7 +891,7 @@

Testing Imputationserver PGS: - + diff --git a/pipeline/index.html b/pipeline/index.html index b0da5f1..788dea3 100644 --- a/pipeline/index.html +++ b/pipeline/index.html @@ -16,7 +16,7 @@ - + @@ -1175,7 +1175,7 @@

Chromosome X Pipeline{"base": "..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/prepare-your-data/index.html b/prepare-your-data/index.html index 6325586..1273312 100644 --- a/prepare-your-data/index.html +++ b/prepare-your-data/index.html @@ -16,7 +16,7 @@ - + @@ -1156,7 +1156,7 @@

CheckVCF{"base": "..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/reference-panels/index.html b/reference-panels/index.html index 7487da5..ab42286 100644 --- a/reference-panels/index.html +++ b/reference-panels/index.html @@ -16,7 +16,7 @@ - + @@ -1607,7 +1607,7 @@

HapMap 2{"base": "..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/resources/index.html b/resources/index.html index 2c8be3e..c52058e 100644 --- a/resources/index.html +++ b/resources/index.html @@ -16,7 +16,7 @@ - + @@ -1023,7 +1023,7 @@

Workshops{"base": "..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/search/search_index.json b/search/search_index.json index b8051e8..04b1901 100644 --- a/search/search_index.json +++ b/search/search_index.json @@ -1 +1 @@ -{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Michigan Imputation ServerFree Next-Generation Genotype Imputation Platform","text":"

Michigan Imputation Server provides a free genotype imputation service using Minimac4. You can upload phased or unphased GWAS genotypes and receive phased and imputed genomes in return. Our server offers imputation from 1000 Genomes (Phase 1 and 3), CAAPA, HRC and the TOPMed reference panel. For all uploaded datasets an extensive QC is performed. The complete source code is hosted on GitHub.

Please cite this paper if you use Michigan Imputation Server in your publication:

Das S, Forer L, Sch\u00f6nherr S, Sidore C, Locke AE, Kwong A, Vrieze S, Chew EY, Levy S, McGue M, Schlessinger D, Stambolian D, Loh PR, Iacono WG, Swaroop A, Scott LJ, Cucca F, Kronenberg F, Boehnke M, Abecasis GR, Fuchsberger C. Next-generation genotype imputation service and methods. Nature Genetics 48, 1284\u20131287 (2016).

"},{"location":"contact/","title":"Contact","text":"

The complete Imputation Server 2 source code is available on GitHub and has been developed by Lukas Forer and Sebastian Sch\u00f6nherr from the Institute of Genetic Epidemiology, Medical University of Innsbruck.

Feel free to create issues and pull requests. Before contacting us, please have a look at the FAQ page first.

"},{"location":"contact/#michigan-imputation-server-team","title":"Michigan Imputation Server Team","text":"

Michigan Imputation Server provides a free genotype imputation service using Minimac4. You can upload phased or unphased GWAS genotypes and receive phased and imputed genomes in return. For all uploaded data sets an extensive QC is performed.

  • Christian Fuchsberger
  • Lukas Forer
  • Sebastian Sch\u00f6nherr
  • Sayantan Das
  • Gon\u00e7alo Abecasis

Please contact Christian Fuchsberger in case of other problems.

"},{"location":"contact/#topmed-imputation-server-team","title":"TOPMed Imputation Server Team","text":"

Michigan Imputation Server provides a free genotype imputation service using Minimac4. You can upload phased or unphased GWAS genotypes and receive phased and imputed genomes in return. For all uploaded data sets an extensive QC is performed.

  • Albert Smith
  • Andy Boughton

Please use this addrees for all inquiries.

"},{"location":"contact/#imputation-engine-minimac4","title":"Imputation engine: Minimac4","text":"

Minimac4 is a lower memory and more computationally efficient implementation of the genotype imputation algorithms in minimac/mininac2/minimac3.

  • Sayantan Das
  • Christian Fuchsberger
  • Gon\u00e7alo Abecasis
"},{"location":"contact/#cloud-framework-cloudgene","title":"Cloud framework: Cloudgene","text":"

Cloudgene is a framework to build Software As A Service (SaaS) platforms for data analysis pipelines. By connecting command-line programs, scripts or Hadoop applications to Cloudgene, a powerful web application can be created within minutes. Cloudgene supports the complete workflow including data transfer, program execution and data export. Cloudgene is developed at the Division of Genetic Epidemiology Innsbruck in cooperation with the Center for Statistical Genetics, University of Michigan.

  • Lukas Forer
  • Sebastian Sch\u00f6nherr
"},{"location":"contact/#phasing-engine-eagle2","title":"Phasing engine: Eagle2","text":"

For haplotype phasing Eagle2 is used. Eagle2 attains high accuracy across a broad range of cohort sizes by efficiently leveraging information from large external reference panels (such as the Haplotype Reference Consortium; HRC).

"},{"location":"data-sensitivity/","title":"Data Security","text":"

Since data is transfered to our server located in Michigan, a wide array of security measures are in force:

  • The complete interaction with the server is secured with HTTPS.
  • Input data is deleted from our servers as soon it is not needed anymore.
  • We only store the number of samples and markers analyzed, we don't ever \"look\" at your data in anyway.
  • All results are encrypted with a strong one-time password - thus, only you can read them.
  • After imputation is finished, the data uploader has 7 days to use an encrypted connection to get results back.
  • The complete source code is available in a public Github repository.
"},{"location":"data-sensitivity/#who-has-access","title":"Who has access?","text":"

To upload and download data, users must register with a unique e-mail address and strong password. Each user can only download imputation results for samples that they have themselves uploaded; no other imputation server users will be able to access your data.

"},{"location":"data-sensitivity/#cookies","title":"Cookies","text":"

We value your privacy and are committed to transparency regarding the use of cookies on our website. Below, we outline our cookie policy to provide you with clarity and assurance.

"},{"location":"data-sensitivity/#what-are-cookies","title":"What are cookies?","text":"

Cookies are small text files that are placed on your device when you visit a website. They serve various purposes, including enhancing user experience, facilitating website functionality, and analyzing website traffic.

"},{"location":"data-sensitivity/#how-do-we-use-cookies","title":"How do we use cookies?","text":"

We use cookies only for the purpose of facilitating login functionality. These cookies help us recognize your device and authenticate your access to our platform securely. We do not track any personal information or analyze user activities through cookies.

"},{"location":"data-sensitivity/#why-do-we-use-cookies","title":"Why do we use cookies?","text":"

Cookies are essential for providing seamless login experiences to our users. By storing authentication information, cookies enable you to access your account efficiently without the need for repetitive login procedures. We respect your privacy and limit cookie usage exclusively to login purposes.

"},{"location":"data-sensitivity/#what-security-or-firewalls-protect-access","title":"What security or firewalls protect access?","text":"

A wide array of security measures are in force on the imputation servers:

  • SSH login to the servers is restricted to only systems administrators.
  • Direct root login via SSH is not allowed from the public Internet.
  • The public-facing side of the servers sits behind the School of Public Health's Checkpoint virtual firewall instance where a default-deny policy is used on inbound traffic; only explicitly allowed TCP ports are passed.
  • The School of Public Health also makes use of NIDS technologies such as Snort and Peakflow on its network links for traffic analysis and threat detection.
  • On imputation server itself, updates are run regularly by systems administrators who follow several zero-day computer security announcement lists; the OSSEC HIDS is used for log analysis and anomaly detection; and Denyhosts is used to thwart brute-force SSH login attacks.
"},{"location":"data-sensitivity/#what-encryption-of-the-data-is-used-while-the-data-are-present","title":"What encryption of the data is used while the data are present?","text":"

Imputation results are encrypted with a one-time password generated by the system. The password consists of lower characters, upper characters, special characters and numbers with max. 3 duplicates.

"},{"location":"faq/","title":"Frequently Asked Questions","text":""},{"location":"faq/#i-did-not-receive-a-password-for-my-imputation-job","title":"I did not receive a password for my imputation job","text":"

Michigan Imputation Server creates a random password for each imputation job. This password is not stored on server-side at any time. If you didn't receive a password, please check your Mail SPAM folder. Please note that we are not able to re-send you the password.

"},{"location":"faq/#unzip-command-is-not-working","title":"Unzip command is not working","text":"

Please check the following points: (1) When selecting AES256 encryption, please use 7z to unzip your files (Debian: sudo apt-get install p7zip-full). For our default encryption all common programs should work. (2) If your password includes special characters (e.g. \\), please put single or double quotes around the password when extracting it from the command line (e.g. 7z x -p\"PASSWORD\" chr_22.zip).

"},{"location":"faq/#extending-expiration-date-or-reset-download-counter","title":"Extending expiration date or reset download counter","text":"

Your data is available for 7 days. In case you need an extension, please let us know.

"},{"location":"faq/#how-can-i-improve-the-download-speed","title":"How can I improve the download speed?","text":"

aria2 tries to utilize your maximum download bandwidth. Please keep in mind to raise the k parameter significantly (-k, --min-split-size=SIZE). You will otherwise hit the Michigan Imputation Server download limit for each file (thanks to Anthony Marcketta for point this out).

"},{"location":"faq/#can-i-download-all-results-at-once","title":"Can I download all results at once?","text":"

We provide wget command for all results. Please open the results tab. The last column in each row includes direct links to all files.

"},{"location":"faq/#can-i-set-up-michigan-imputation-server-locally","title":"Can I set up Michigan Imputation Server locally?","text":"

We are providing a single-node Docker image that can be used to impute from Hapmap2 and 1000G Phase3 locally. Click here to give it a try. For usage in production, we highly recommend setting up a Hadoop cluster.

"},{"location":"faq/#your-web-service-looks-great-can-i-set-up-my-own-web-service-as-well","title":"Your web service looks great. Can I set up my own web service as well?","text":"

All web service functionality is provided by Cloudgene. Please contact us, in case you want to set up your own service.

"},{"location":"getting-started/","title":"Getting started","text":"

To use Michigan Imputation Server, a registration is required. We send an activation mail to the provided address. Please follow the instructions in the email to activate your account. If it doesn't arrive, ensure you have entered the correct email address and check your spam folder.

After the email address has been verified, the service can be used without any costs.

Please cite this paper if you use Michigan Imputation Server in your GWAS study:

Das S, Forer L, Sch\u00f6nherr S, Sidore C, Locke AE, Kwong A, Vrieze S, Chew EY, Levy S, McGue M, Schlessinger D, Stambolian D, Loh PR, Iacono WG, Swaroop A, Scott LJ, Cucca F, Kronenberg F, Boehnke M, Abecasis GR, Fuchsberger C. Next-generation genotype imputation service and methods. Nature Genetics 48, 1284\u20131287 (2016).

"},{"location":"getting-started/#setup-your-first-imputation-job","title":"Setup your first imputation job","text":"

Please login with your credentials and click on the Run tab to start a new imputation job. The submission dialog allows you to specify the properties of your imputation job.

The following options are available:

"},{"location":"getting-started/#reference-panel","title":"Reference Panel","text":"

Our server offers genotype imputation from different reference panels. The most accurate and largest panel is HRC (Version r1.1 2016). Please select one that fulfills your needs and supports the population of your input data:

  • HRC (Version r1.1 2016)
  • HLA Imputation Panel: two-field (four-digit) and G-group resolution
  • HRC (Version r1 2015)
  • 1000 Genomes Phase 3 (Version 5)
  • 1000 Genomes Phase 1 (Version 3)
  • CAAPA - African American Panel
  • HapMap 2

More details about all available reference panels can be found here.

"},{"location":"getting-started/#upload-vcf-files-from-your-computer","title":"Upload VCF files from your computer","text":"

When using the file upload, data is uploaded from your local file system to Michigan Imputation Server. By clicking on Select Files an open dialog appears where you can select your VCF files:

Multiple files can be selected using the ctrl, cmd or shift keys, depending on your operating system. After you have confirmed your choice, all selected files are listed in the submission dialog:

Please make sure that all files fulfill the requirements.

Important

Since version 1.7.2 URL-based uploads (sftp and http) are no longer supported. Please use direct file uploads instead.

"},{"location":"getting-started/#build","title":"Build","text":"

Please select the build of your data. Currently the options hg19 and hg38 are supported. Michigan Imputation Server automatically updates the genome positions (liftOver) of your data. All reference panels except TOPMed are based on hg19 coordinates.

"},{"location":"getting-started/#rsq-filter","title":"rsq Filter","text":"

To minimize the file size, Michigan Imputation Server includes a r2 filter option, excluding all imputed SNPs with a r2-value (= imputation quality) smaller then the specified value.

"},{"location":"getting-started/#phasing","title":"Phasing","text":"

If your uploaded data is unphased, Eagle v2.4 will be used for phasing. In case your uploaded VCF file already contains phased genotypes, please select the \"No phasing\" option.

Algorithm Description Eagle v2.4 The Eagle algorithm estimates haplotype phase using the HRC reference panel. This method is also suitable for single sample imputation. After phasing or imputation you will receive phased genotypes in your VCF files."},{"location":"getting-started/#population","title":"Population","text":"

Please select the population of your uploaded samples. This information is used to compare the allele frequencies between your data and the reference panel. Please note that not every reference panel supports all sub-populations.

Population Supported Reference Panels AFR all AMR all EUR all Mixed all AA CAAPA ASN 1000 Genomes Phase 1 (Version 3) EAS 1000 Genomes Phase 3 (Version 5) SAS 1000 Genomes Phase 3 (Version 5)

In case your population is not listed or your samples are from different populations, please select Mixed to skip the allele frequency check. For mixed populations, no QC-Report will be created.

"},{"location":"getting-started/#mode","title":"Mode","text":"

Please select if you want to run Quality Control & Imputation, Quality Control & Phasing Only or Quality Control Only.

"},{"location":"getting-started/#aes-256-encryption","title":"AES 256 encryption","text":"

All Imputation Server results are encrypted by default. Please tick this checkbox if you want to use AES 256 encryption instead of the default encryption method. Please note that AES encryption does not work with standard unzip programs. We recommend to use 7z instead.

"},{"location":"getting-started/#start-your-imputation-job","title":"Start your imputation job","text":"

After confirming our Terms of Service, the imputation process can be started immediately by clicking on Start Imputation. Input Validation and Quality Control are executed immediately to give you feedback about the data-format and its quality. If your data passed this steps, your job is added to our imputation queue and will be processed as soon as possible. You can check the position in the queue on the job summary page.

We notify you by email as soon as the job is finished or your data don't pass the Quality Control steps.

"},{"location":"getting-started/#input-validation","title":"Input Validation","text":"

In a first step we check if your uploaded files are valid and we calculate some basic statistics such as amount of samples, chromosomes and SNPs.

After Input Validation has finished, basic statistics can be viewed directly in the web interface.

If you encounter problems with your data please read this tutorial about Data Preparation to ensure your data is in the correct format.

"},{"location":"getting-started/#quality-control","title":"Quality Control","text":"

In this step we check each variant and exclude it in case of:

  1. contains invalid alleles
  2. duplicates
  3. indels
  4. monomorphic sites
  5. allele mismatch between reference panel and uploaded data
  6. SNP call rate < 90%

All filtered variants are listed in a file called statistics.txt which can be downloaded by clicking on the provided link. More informations about our QC pipeline can be found here.

If you selected a population, we compare the allele frequencies of the uploaded data with those from the reference panel. The result of this check is available in the QC report and can be downloaded by clicking on qcreport.html.

"},{"location":"getting-started/#pre-phasing-and-imputation","title":"Pre-phasing and Imputation","text":"

Imputation is achieved with Minimac4. The progress of all uploaded chromosomes is updated in real time and visualized with different colors.

"},{"location":"getting-started/#data-compression-and-encryption","title":"Data Compression and Encryption","text":"

If imputation was successful, we compress and encrypt your data and send you a random password via mail.

This password is not stored on our server at any time. Therefore, if you lost the password, there is no way to resend it to you.

"},{"location":"getting-started/#download-results","title":"Download results","text":"

The user is notified by email, as soon as the imputation job has finished. A zip archive including the results can be downloaded directly from the server. To decrypt the results, a one-time password is generated by the server and included in the email. The QC report and filter statistics can be displayed and downloaded as well.

All data is deleted automatically after 7 days

Be sure to download all needed data in this time period. We send you a reminder 48 hours before we delete your data. Once your job hast the state retired, we are not able to recover your data!

"},{"location":"getting-started/#download-via-a-web-browser","title":"Download via a web browser","text":"

All results can be downloaded directly via your browser by clicking on the filename.

In order to download results via the commandline using wgetor aria2 you need to click on the share symbol (located right to the file size) to get the needed private links.

A new dialog appears which provides you the private link. Click on the tab wget command to get a copy & paste ready command that can be used on Linux or MacOS to download the file in you terminal:

"},{"location":"getting-started/#download-all-results-at-once","title":"Download all results at once","text":"

To download all files of a folder (for example folder Imputation Results) you can click on the share symbol of the folder:

A new dialog appears which provides you all private links at once. Click on the tab wget commands to get copy & paste ready commands that can be used on Linux or MacOS to download all files.

"},{"location":"pipeline/","title":"Pipeline Overview","text":"

Our pipeline performs the following steps:

"},{"location":"pipeline/#quality-control","title":"Quality Control","text":"
  • Create chunks with a size of 20 Mb
  • For each 20Mb chunk we perform the following checks:

    On Chunk level:

    • Determine amount of valid variants: A variant is valid iff it is included in the reference panel. At least 3 variants must be included.
    • Determine amount of variants found in the reference panel: At least 50 % of the variants must be be included in the reference panel.
    • Determine sample call rate: At least 50 % of the variants must be called for each sample.

    Chunk exclusion: if (#variants < 3 || overlap < 50% || sampleCallRate < 50%)

    On Variant level:

    • Check alleles: Only A,C,G,T are allowed
    • Calculate alternative allele frequency (AF): Mark all with a AF > 0.5.
    • Calculate SNP call rate
    • Calculate chi square for each variant (reference panel vs. study data)
    • Determine allele switches: Compare ref and alt of reference panel with study data (A/T and C/G variants are ignored).
    • Determine strand flips: After eliminating possible allele switches, flip and compare ref/alt from reference panel with study data.
    • Determine allele switches in combination with strand flips: Combine the two rules from above.

    Variant exclusion: Variants are excluded in case of: [a] invalid alleles occur (!(A,C,G,T)), [b] duplicates (DUP filter or (pos - 1 == pos)), [c] indels, [d] monomorphic sites, [e] allele mismatch between reference panel and study, [f] SNP call rate < 90%.

    On Sample level:

    • For chr1-22, a chunk is excluded if one sample has a call rate < 50 %. Only complete chunks are excluded, not samples (see \"On Chunk level\" above)
  • Perform a liftOver step, if build of input data and reference panel does not match (b37 vs b38).

"},{"location":"pipeline/#phasing","title":"Phasing","text":"
  • Execute for each chunk one of the following phasing algorithms (we use an overlap of 5 Mb). For example, chr20:1-20000000 and reference population EUR:

Eagle2

./eagle --vcfRef HRC.r1-1.GRCh37.chr20.shapeit3.mac5.aa.genotypes.bcf\n--vcfTarget chunk_20_0000000001_0020000000.vcf.gz  --geneticMapFile genetic_map_chr20_combined_b37.txt\n--outPrefix chunk_20_0000000001_0020000000.phased --bpStart 1 --bpEnd 25000000 --allowRefAltSwap\n--vcfOutFormat z\n

Please note: Target-only sites for unphased data are not included in the final output.

"},{"location":"pipeline/#imputation","title":"Imputation","text":""},{"location":"pipeline/#_1","title":"Pipeline Overview","text":"
  • Execute for each chunk minimac in order to impute the phased data (we use a window of 500 kb):

./Minimac4 --refHaps HRC.r1-1.GRCh37.chr1.shapeit3.mac5.aa.genotypes.m3vcf.gz\n--haps chunk_1_0000000001_0020000000.phased.vcf --start 1 --end 20000000\n--window 500000 --prefix chunk_1_0000000001_0020000000 --cpus 1 --chr 20 --noPhoneHome\n--format GT,DS,GP --allTypedSites --meta --minRatio 0.00001\n
If a map file is available (currently TOPMed only), the following cmd is executed:

./Minimac4 --refHaps HRC.r1-1.GRCh38.chr1.shapeit3.mac5.aa.genotypes.m3vcf.gz\n--haps chunk_1_0000000001_0020000000.phased.vcf --start 1 --end 20000000\n--window 500000 --prefix chunk_1_0000000001_0020000000 --cpus 1 --chr 20 --noPhoneHome\n--format GT,DS,GP --allTypedSites --meta --minRatio 0.00001 --referenceEstimates --map B38_MAP_FILE.map\n
"},{"location":"pipeline/#hla-imputation-pipeline","title":"HLA Imputation Pipeline","text":"

In addition to intergenic SNPs, HLA imputation outputs five different types of markers: (1) binary marker for classical HLA alleles; (2) binary marker for the presence/absence of a specific amino acid residue; (3) HLA intragenic SNPs, and (4) binary markers for insertion/deletions, as described in the typical output below. The goal is to minimize prior assumption on which types of variations will be causal and test all types of variations simultaneously in an unbiased fashion. However, the users are always free to restrict analyses to specific marker subsets.

Note

For binary encodings, A = Absent, T = Present.

Type Format Example Classical HLA alleles HLA_[GENE]*[ALLELE] HLA_A*01:02 (two-field allele) HLA_A*02 (one-field allele) HLA amino acids AA_[GENE]_[AMINO ACID POSITION]_[GENOMIC POSITION]_[EXON]_[RESIDUE] AA_B_97_31324201_exon3_V (amino acid position 97 in HLA-B, genomic position 31324201 (GrCh37) in exon 3, residue = V (Val) ) HLA intragenic SNPs SNPS_[GENE]_[GENE POSITION]_[GENOMIC POSITION]_[EXON/INTRON] SNPS_C_2666_31237183_intron6 (SNP at position 2666 of the gene body, genomic position 31237183 in intron 6) Insertions/deletions INDEL_[TYPE]_[GENE]_[POSITION] INDEL_AA_C_300x301_31237792 Indel between amino acids 300 and 301 in HLA-C, at genomic position 31237792)

We note that our current implementation of the reference panel is limited to the G-group resolution (DNA sequences that determine the exons 2 and 3 for class I and exon 2 for class II genes), and amino acid positions outside the binding groove were taken as its best approximation. When converting G-group alleles to the two-field resolution, we first approximated G-group alleles to their corresponding allele at the four-field resolution based on the ordered allele list in the distributed IPD-IMGT/HLA database (version 3.32.0). We explicitly include exonic information in the HLA-TAPAS output.

For more information about HLA imputation and help, please visit https://github.com/immunogenomics/HLA-TAPAS.

"},{"location":"pipeline/#compression-and-encryption","title":"Compression and Encryption","text":"
  • Merge all chunks of one chromosome into one single vcf.gz
  • Encrypt data with one-time password
"},{"location":"pipeline/#chromosome-x-pipeline","title":"Chromosome X Pipeline","text":"

Additionally to the standard QC, the following per-sample checks are executed for chrX:

  • Ploidy Check: Verifies if all variants in the nonPAR region are either haploid or diploid.
  • Mixed Genotypes Check: Verifies if the amount of mixed genotypes (e.g. 1/.) is < 10 %.

For phasing and imputation, chrX is split into three independent chunks (PAR1, nonPAR, PAR2). These splits are then automatically merged by Michigan Imputation Server and are returned as one complete chromosome X file. Only Eagle is supported.

"},{"location":"prepare-your-data/","title":"Data preparation","text":"

Michigan Imputation Server accepts VCF files compressed with bgzip. Please make sure the following requirements are met:

  • Create a separate vcf.gz file for each chromosome.
  • Variations must be sorted by genomic position.
  • GRCh37 or GRCh38 coordinates are required.

Note

Several *.vcf.gz files can be uploaded at once.

"},{"location":"prepare-your-data/#quality-control-for-hrc-1000g-and-caapa-imputation","title":"Quality Control for HRC, 1000G and CAAPA imputation","text":"

Will Rayner provides a great toolbox to prepare data: HRC or 1000G Pre-imputation Checks.

The main steps for HRC are:

"},{"location":"prepare-your-data/#download-tool-and-sites","title":"Download tool and sites","text":"
wget http://www.well.ox.ac.uk/~wrayner/tools/HRC-1000G-check-bim-v4.2.7.zip\nwget ftp://ngs.sanger.ac.uk/production/hrc/HRC.r1-1/HRC.r1-1.GRCh37.wgs.mac5.sites.tab.gz\n
"},{"location":"prepare-your-data/#convert-pedmap-to-bed","title":"Convert ped/map to bed","text":"
plink --file <input-file> --make-bed --out <output-file>\n
"},{"location":"prepare-your-data/#create-a-frequency-file","title":"Create a frequency file","text":"
plink --freq --bfile <input> --out <freq-file>\n
"},{"location":"prepare-your-data/#execute-script","title":"Execute script","text":"
perl HRC-1000G-check-bim.pl -b <bim file> -f <freq-file> -r HRC.r1-1.GRCh37.wgs.mac5.sites.tab -h\nsh Run-plink.sh\n
"},{"location":"prepare-your-data/#create-vcf-using-vcfcooker","title":"Create vcf using VcfCooker","text":"
vcfCooker --in-bfile <bim file> --ref <reference.fasta>  --out <output-vcf> --write-vcf\nbgzip <output-vcf>\n
"},{"location":"prepare-your-data/#additional-tools","title":"Additional Tools","text":""},{"location":"prepare-your-data/#convert-pedmap-files-to-vcf-files","title":"Convert ped/map files to VCF files","text":"

Several tools are available: plink2, BCFtools or VcfCooker.

plink --ped study_chr1.ped --map study_chr1.map --recode vcf --out study_chr1\n

Create a sorted vcf.gz file using BCFtools:

bcftools sort study_chr1.vcf -Oz -o study_chr1.vcf.gz\n
"},{"location":"prepare-your-data/#checkvcf","title":"CheckVCF","text":"

Use checkVCF to ensure that the VCF files are valid. checkVCF proposes \"Action Items\" (e.g. upload to sftp server), which can be ignored. Only the validity should be checked with this command.

checkVCF.py -r human_g1k_v37.fasta -o out mystudy_chr1.vcf.gz\n
"},{"location":"reference-panels/","title":"Reference Panels","text":"

Our server offers imputation from the following reference panels:

"},{"location":"reference-panels/#hrc-version-r11-2016","title":"HRC (Version r1.1 2016)","text":"

The HRC panel consists of 64,940 haplotypes of predominantly European ancestry.

Number of Samples 32,470 Sites (chr1-22) 39,635,008 Chromosomes 1-22, X Website http://www.haplotype-reference-consortium.org; HRC r1.1 Release Note"},{"location":"reference-panels/#1000-genomes-phase-3-version-5","title":"1000 Genomes Phase 3 (Version 5)","text":"

Phase 3 of the 1000 Genomes Project consists of 5,008 haplotypes from 26 populations across the world.

Number of Samples 2,504 Sites (chr1-22) 49,143,605 Chromosomes 1-22, X Website http://www.internationalgenome.org"},{"location":"reference-panels/#genome-asia-pilot-gasp","title":"Genome Asia Pilot - GAsP","text":"Number of Samples 1,654 Sites (chr1-22) 21,494,814 Chromosomes 1-22 Publication https://www.nature.com/articles/s41586-019-1793-z"},{"location":"reference-panels/#genome-asia-v2-gasp","title":"Genome Asia v2 - GAsP","text":"Number of Samples 6,461 Sites (chr1-22) - Chromosomes 1-22 Publication https://www.nature.com/articles/s41586-019-1793-z"},{"location":"reference-panels/#four-digit-multi-ethnic-hla-v1-2021","title":"Four-digit Multi-ethnic HLA v1 (2021)","text":"

The multi-ethnic HLA panel consists of 36,586 haplotypes of five global populations. We have released the panel at both two-field (four-digit) and G-group resolution.

Number of Samples 18,293 Sites (chr6) 56,310 (1,781 HLA alleles; 4,513 HLA amino acids; 10,924 SNPs within HLA; 39,092 scaffold SNPs) Chromosomes 6:28,000,000-34,000,000 Website https://github.com/immunogenomics/HLA-TAPAS/

Please cite this manuscript if you would like to include imputed results from the panel in your work:

Luo, Y., Kanai, M., Choi, W., Li, X., Yamamoto, K., Ogawa, K., Gutierrez-Arcelus, M., Gregersen, P. K., Stuart, P. E., Elder, J. T., Fellay, J., Carrington, M., Haas, D. W., Guo, X., Palmer, N. D., Chen, Y.-D. I., Rotter, J. I., Taylor, K. D., Rich, S., \u2026 Raychaudhuri, S. (2020). A high-resolution HLA reference panel capturing global population diversity enables multi-ethnic fine-mapping in HIV host response. https://doi.org/10.1101/2020.07.16.20155606

"},{"location":"reference-panels/#four-digit-multi-ethnic-hla-v2-2022","title":"Four-digit Multi-ethnic HLA v2 (2022)","text":"Number of Samples 20,349 Sites (chr6) 22,733 (570 HLA alleles; 3,449 HLA amino acids; 4,023 SNPs within HLA; 14,691 scaffold SNPs) Chromosomes 6:27,970,031-33,965,553 Website https://github.com/immunogenomics/HLA-TAPAS/"},{"location":"reference-panels/#multi-ethnic-hla-v2-details","title":"Multi-ethnic HLA v2 Details","text":"

Samples:

  • We added Japanese samples with HLA alleles called with deep target sequencing (n = 723; Hirata et al. Nat Genet. 2019).
  • Add Estonian biobank samples with IRB approval (n = 2,233; Mitt et al. Eur J Hum Genet. 2017).

HLA alleles:

  • We used gold-standard HLA allele calls (instead of inferred calls from whole genome sequencing) when possible.
  • We updated and recalled HLA alleles using HLA-LA (Dilthey et al. Bioinformatics. 2019) in Jackson Heart Study (n = 3,026).
  • We updated and recalled HLA alleles using HLA-LA in Estonian Biobank (n = 2,233).

Scaffold variants:

  • We added population-specific SNP variants which are common in one population but rare in the other populations when they are in 1KG and pass QC, by cross-cohort SNP imputation within the reference panel.
  • We removed all SNP variants that are not included in the commonly-used genotyping arrays.

Minimac4 options:

  • We optimized --probThreshold, --diffThreshold, --topThreshold parameters in minimac4. Optimized parameters are now used for all HLA panels.

Imputation results:

  • We output 2-digit and 4-digit-resolution HLA alleles. We do not output higher resolution HLA alleles in this version.
"},{"location":"reference-panels/#caapa-african-american-panel","title":"CAAPA - African American Panel","text":"

Whole genome sequences were available on 883 individuals from 19 case-control studies of asthma included in the Consortium on Asthma among African-ancestry Populations in the Americas (CAAPA) and were used to summarize the genomic contributions to individuals of African ancestry.

Number of Samples 883 Sites (chr1-22) 31,163,897 Chromosomes 1-22 Website http://www.caapa-project.org/. Further details can also be found here"},{"location":"reference-panels/#hrc-version-r1-2015","title":"HRC (Version r1 2015)","text":"

This HRC panel consists of 64,976 haplotypes of predominantly European ancestry.

Number of Samples 32,488 Sites (chr1-22) 39,741,659 Chromosomes 1-22, X Website http://www.haplotype-reference-consortium.org; HRC r1 Release Note"},{"location":"reference-panels/#1000-genomes-phase-1-version-3","title":"1000 Genomes Phase 1 (Version 3)","text":"Number of Samples 1,092 Sites (chr1-22) 28,975,367 Chromosomes 1-22, X Website http://www.internationalgenome.org"},{"location":"reference-panels/#hapmap-2","title":"HapMap 2","text":"Number of Samples 60 Sites (chr1-22) 2,542,916 Chromosomes 1-22 Website: http://www.hapmap.org"},{"location":"resources/","title":"Resources","text":""},{"location":"resources/#polygenic-risk-score-calculation","title":"Polygenic Risk Score calculation","text":"

Learn in this tutorial how to use the Imputation Server to calculate over 3,000 polygenic risk scores on the fly.

Learn more

"},{"location":"resources/#automate-job-submission-using-imputationbot","title":"Automate job submission using Imputationbot","text":"

Imputation Bot provides an automate way to submit new jobs and to download results.

Learn more

"},{"location":"resources/#automate-job-sumission-using-the-rest-api","title":"Automate job sumission using the REST API","text":"

The REST APIs provide programmatic ways to submit new jobs and to download data from Michigan Imputation Server. It identifies users using authentication tokens, responses are provided in JSON format.

Learn more

"},{"location":"resources/#build-your-own-imputationserver","title":"Build your own Imputationserver","text":"

All the core is open source. If you have interest to build and host your own Imputationserver, please follow the instrocution of the Imputationserver2 pipeline here.

"},{"location":"resources/#workshops","title":"Workshops","text":"
  • ASHG 2023
  • ASHG 2022
  • ASHG 2020
"},{"location":"pgs/faq/","title":"Frequently Asked Questions","text":""},{"location":"pgs/faq/#can-i-use-the-polygenic-score-calculation-extension-without-an-email-address","title":"Can I use the Polygenic Score Calculation extension without an email address?","text":"

Yes, the extension can also be used with a username without an email. However, without an email, notifications are not sent, and access to genotyped data may be limited.

"},{"location":"pgs/faq/#extending-expiration-date-or-reset-download-counter","title":"Extending expiration date or reset download counter","text":"

Your data is available for 7 days. In case you need an extension, please let us know.

"},{"location":"pgs/faq/#how-can-i-improve-the-download-speed","title":"How can I improve the download speed?","text":"

aria2 tries to utilize your maximum download bandwidth. Please keep in mind to raise the k parameter significantly (-k, --min-split-size=SIZE). You will otherwise hit the Michigan Imputation Server download limit for each file (thanks to Anthony Marcketta for point this out).

"},{"location":"pgs/faq/#can-i-download-all-results-at-once","title":"Can I download all results at once?","text":"

We provide wget command for all results. Please open the results tab. The last column in each row includes direct links to all files.

"},{"location":"pgs/faq/#can-i-perform-pgs-calculation-locally","title":"Can I perform PGS calculation locally?","text":"

Imputationserveris using a standalone tool called pgs-calc. It reads the imputed dosages from VCF files and uses them to calculate scores. It supports imputed genotypes from Michigan Imputation Server or TOPMed Imputation Server out of the box and score files from PGS Catalog or PRSWeb instances. In addition, own created score files containing chromosomal positions, both alleles and the effect size can be used easily. pgs-calc uses the chromosomal positions and alleles to find the corresponding dosages in genotype files, but provides also tools to resolve rsIDs in score files using dbSNP. Therefore, it can be applied to genotype files with variants that were not annotated with rsIDs. Moreover, the standalone version provides options to improve the coverage by using the provided proxy mapping file for Europeans or a custom population specific mapping file. pgs-calc is available at https://github.com/lukfor/pgs-calc.

"},{"location":"pgs/getting-started/","title":"Polygenic Score Calculation","text":"

We provide an easy to use and user-friendly web interface to apply thousands of published polygenic risk scores to imputed genotypes in an efficient way. By extending the popular Michigan Imputation Server the module integrates it seamless into the existing imputation workflow and enables users without knowledge in that field to take advantage of this method. The graphical report includes all meta-data about the scores in a single place and helps users to understand and screen thousands of scores in an easy and intuitive way.

An extensive quality control pipeline is executed automatically to detect and fix possible strand-flips and to filter out missing SNPs to prevent systematic errors (e.g. lower scores for individuals with missing or wrong aligned genetic data).

When incorporating the Polygenic Score Calculation extension in your research, please cite the following papers:

Forer L, Taliun D, LeFaive J, Smith AV, Boughton AP, Coassin S, Lamina C, Kronenberg F, Fuchsberger C, Sch\u00f6nherr S. Imputation Server PGS: an automated approach to calculate polygenic risk scores on imputation servers. Nucleic Acids Res. 2024 Jul 5;52(W1):W70-W77. doi: 10.1093/nar/gkae331. PMID: 38709879; PMCID: PMC11223871.

Samuel A. Lambert, Laurent Gil, Simon Jupp, Scott C. Ritchie, Yu Xu, Annalisa Buniello, Aoife McMahon, Gad Abraham, Michael Chapman, Helen Parkinson, John Danesh, Jacqueline A. L. MacArthur and Michael Inouye. The Polygenic Score Catalog as an open database for reproducibility and systematic evaluation. Nature Genetics. doi: 10.1038/s41588-021-00783-5 (2021).

"},{"location":"pgs/getting-started/#getting-started","title":"Getting started","text":"

To utilize the Polygenic Score Calculation extension on ImputationServer, you must first register for an account. An activation email will be sent to the provided address. Once your email address is verified, you can access the service at no cost.

Please note that the extension can also be used with a username without an email. However, without an email, notifications are not sent, and access to genotyped data may be limited.

No dataset at hand? No problem, download our example dataset to test the PGS extension: 50-samples.zip.

"},{"location":"pgs/getting-started/#setting-up-your-first-polygenic-score-calculation-job","title":"Setting up your first Polygenic Score Calculation job","text":"
  1. Log in with your credentials and navigate to the Run tab to initiate a new Polygenic Score Calculation job.
  2. Please click on \"Polygenic Score Calculation\" and the submission dialog appears.
  3. The submission dialog allows you to specify job properties.

The following options are available:

"},{"location":"pgs/getting-started/#reference-panel","title":"Reference Panel","text":"

Our PGS extension offers genotype imputation from different reference panels. The most accurate and largest panel is HRC (Version r1.1 2016). Please select one that fulfills your needs and supports the population of your input data:

  • HRC (Version r1.1 2016)
  • 1000 Genomes Phase 3 (Version 5)
  • 1000 Genomes Phase 1 (Version 3)
  • HapMap 2

More details about all available reference panels can be found here. If you are unsure which reference panel to use, the \"1000 Genomes Phase 3 (Version 5)\" reference panel is multi-ancestry and has high coverage with available scores. However, if your uploaded data is European only, the HRC reference panel could be the better choice, as it enables the imputation of rare European-specific variants.

"},{"location":"pgs/getting-started/#upload-vcf-files-from-your-computer","title":"Upload VCF files from your computer","text":"

When using the file upload, data is uploaded from your local file system to Michigan Imputation Server. By clicking on Select Files an open dialog appears where you can select your VCF files:

Multiple files can be selected using the ctrl, cmd or shift keys, depending on your operating system. After you have confirmed your choice, all selected files are listed in the submission dialog:

Please make sure that all files fulfill the requirements.

Important

Since version 1.7.2 URL-based uploads (sftp and http) are no longer supported. Please use direct file uploads instead.

"},{"location":"pgs/getting-started/#rsq-filter","title":"rsq Filter","text":"

The filter ensures that only variants with an imputation quality (rsq) greater than the specified value are included in the polygenic risk score calculation. Setting the value to 0 disables the filter. Default value: 0.3.

"},{"location":"pgs/getting-started/#build","title":"Build","text":"

Please select the build of your data. Currently the options hg19 and hg38 are supported. Michigan Imputation Server automatically updates the genome positions (liftOver) of your data. All reference panels are based on hg19 coordinates.

"},{"location":"pgs/getting-started/#scores-and-trait-category","title":"Scores and Trait Category","text":"

Choose the precomputed Polygenic Score repository relevant to your study from the available options. Based on the selected repository, different trait categories appear and can be selected (e.g. Cancer scores):

More details about all available PGS repositories can be found here.

"},{"location":"pgs/getting-started/#ancestry-estimation","title":"Ancestry Estimation","text":"

You can enable ancestry estimation by selecting a reference population used to classify your uploaded samples. Currently, we support a worldwide panel based on HGDP.

"},{"location":"pgs/getting-started/#start-polygenic-score-calculation","title":"Start Polygenic Score Calculation","text":"

After agreeing to the Terms of Service, initiate the calculation by clicking on Submit job. The system will perform Input Validation and Quality Control immediately. If your data passes these steps, the job is added to the queue for processing.

"},{"location":"pgs/getting-started/#monitoring-and-retrieving-results","title":"Monitoring and Retrieving Results","text":"
  • Input Validation: Verify the validity of your uploaded files and review basic statistics.
  • Quality Control: Examine the QC report and download statistics after the system filters variants based on various criteria.
  • Polygenic Score Calculation: Monitor the progress of the imputation and polygenic scores calculation in real time for each chromosome.
"},{"location":"pgs/getting-started/#downloading-results","title":"Downloading Results","text":"

Upon completion, you will be notified by email if you enter your address on registration. A zip archive containing results can be downloaded directly from the server.

Click on the filename to download results directly via a web-browser. For command line downloads, use the share symbol to obtain private links.

Important: All data is automatically deleted after 7 days. Download needed data within this timeframe. A reminder is sent 48 hours before data deletion.

"},{"location":"pgs/output-files/","title":"Output Files","text":"

The Polygenic Score Calculation Results CSV file provides Polygenic Score (PGS) values for different samples and associated identifiers. Users can leverage this CSV file to analyze and compare Polygenic Score values across different samples. The data facilitates the investigation of genetic associations and their impact on specific traits or conditions.

"},{"location":"pgs/output-files/#csv-format","title":"CSV Format","text":"

The CSV file consists of a header row and data rows:

"},{"location":"pgs/output-files/#header-row","title":"Header Row","text":"
  • sample: Represents the identifier for each sample.
  • PGS000001, PGS000002, PGS000003, ...: Columns representing different Polygenic Score values associated with the respective identifiers.
"},{"location":"pgs/output-files/#data-rows","title":"Data Rows","text":"
  • Each row corresponds to a sample and provides the following information:
    • sample: Identifier for the sample.
    • PGS000001, PGS000002, PGS000003, ...: Polygenic Score values associated with the respective identifiers for the given sample.
"},{"location":"pgs/output-files/#example","title":"Example","text":"

Here's an example row:

sample, PGS000001, PGS000002, PGS000003, ...\nsample1, -4.485780284301654, 4.119604924228042, 0.0, -4.485780284301654\n
  • sample1: Sample identifier.
    • -4.485780284301654: Polygenic Score value for PGS000001.
    • 4.119604924228042: Polygenic Score value for PGS000002.
    • 0.0: Polygenic Score value for PGS000003.

Note:

  • Polygenic Score values are provided as floating-point numbers.
  • The absence of values (e.g., 0.0) indicates a lack of Polygenic Score information for a particular identifier in a given sample.
"},{"location":"pgs/pipeline/","title":"Pipeline","text":""},{"location":"pgs/pipeline/#ancestry-estimation","title":"Ancestry estimation","text":"

We use LASER to perform principal components analysis (PCA) based on the genotypes of each sample and to place them into a reference PCA space which was constructed using a set of reference individuals [14]. We built reference coordinates based on 938 samples from the Human Genome Diversity Project (HGDP) [15] and labeled them by the ancestry categories proposed by the GWASCatalog [16] which are also used in PGS Catalog.

"},{"location":"pgs/reference-panels/","title":"Reference Panels for PGS Calculation","text":"

Our server offers PGS calculation from the following reference panels:

"},{"location":"pgs/reference-panels/#hrc-version-r11-2016","title":"HRC (Version r1.1 2016)","text":"

The HRC panel consists of 64,940 haplotypes of predominantly European ancestry.

Number of Samples 32,470 Sites (chr1-22) 39,635,008 Chromosomes 1-22, X Website http://www.haplotype-reference-consortium.org; HRC r1.1 Release Note"},{"location":"pgs/reference-panels/#1000-genomes-phase-3-version-5","title":"1000 Genomes Phase 3 (Version 5)","text":"

Phase 3 of the 1000 Genomes Project consists of 5,008 haplotypes from 26 populations across the world.

Number of Samples 2,504 Sites (chr1-22) 49,143,605 Chromosomes 1-22, X Website http://www.internationalgenome.org"},{"location":"pgs/reference-panels/#1000-genomes-phase-1-version-3","title":"1000 Genomes Phase 1 (Version 3)","text":"Number of Samples 1,092 Sites (chr1-22) 28,975,367 Chromosomes 1-22, X Website http://www.internationalgenome.org"},{"location":"pgs/reference-panels/#hapmap-2","title":"HapMap 2","text":"Number of Samples 60 Sites (chr1-22) 2,542,916 Chromosomes 1-22 Website: http://www.hapmap.org"},{"location":"pgs/report/","title":"Interactive Report","text":"

The created report contains a list of all scores, where each score has a different color based on its coverage. The color green indicates that the coverage is very high and nearly all SNPs from the score were also found in the imputed dataset. The color red indicates that very few SNPs were found and the coverage is therefore low.

In addition, the report includes detailed metadata for each score such as the number of variants, the number of well-imputed genotypes and the population used to construct the score. A direct link to PGS Catalog, Cancer PRSWeb or ExPRSWeb is also available for further investigation (e.g. for getting information about the method that was used to construct the score). Further, the report displays the distribution of the scores of all uploaded samples and can be interactively explored. This allows users to detect samples with either a high or low risk immediately.

Moreover, the report gives an overview of all estimated ancestries from the uploaded genotypes and compares them with the populations of the GWAS that was used to create the score.

If an uploaded sample with an unsupported population is detected, a warning message is provided and the sample is excluded from the summary statistics.

"},{"location":"pgs/scores/","title":"Scores","text":"

We support currently the following PGS repositories out of the box:

"},{"location":"pgs/scores/#pgs-catalog","title":"PGS-Catalog","text":"

We use PGS Catalog as the source of scores for PGS Server (version 19. Jan 2023). the PGS Catalog is an online database that collects and annotates published scores and currently provides access to over 3,900 scores encompassing more than 580 traits.

Samuel A. Lambert, Laurent Gil, Simon Jupp, Scott C. Ritchie, Yu Xu, Annalisa Buniello, Aoife McMahon, Gad Abraham, Michael Chapman, Helen Parkinson, John Danesh, Jacqueline A. L. MacArthur and Michael Inouye. The Polygenic Score Catalog as an open database for reproducibility and systematic evaluation. Nature Genetics. doi: 10.1038/s41588-021-00783-5 (2021).

"},{"location":"pgs/scores/#cancer-prsweb","title":"Cancer-PRSweb","text":"

Collection of scores for major cancer traits.

Fritsche LG, Patil S, Beesley LJ, VandeHaar P, Salvatore M, Ma Y, Peng RB, Taliun D, Zhou X, Mukherjee B: Cancer PRSweb: An Online Repository with Polygenic Risk Scores for Major Cancer Traits and Their Evaluation in Two Independent Biobanks. Am J Hum Genet 2020, 107(5):815-836.

"},{"location":"pgs/scores/#exprsweb","title":"ExPRSweb","text":"

Collection of scores for common health-related exposures like body mass index or alcohol consumption.

Ma Y, Patil S, Zhou X, Mukherjee B, Fritsche LG: ExPRSweb: An online repository with polygenic risk scores for common health-related exposures. Am J Hum Genet 2022, 109(10):1742-1760.

"},{"location":"pgs/tutorial/","title":"Testing Imputationserver PGS: Step by Step","text":"

To test Imputationserver PGS, please execute the following steps:

0. Signup and create a login:

Imputationserver PGS requires a login to access the Polygenic Risk Score (PGS) calculation service. This login is crucial to maintain the security and privacy of any uploaded human genotype data.

Users have the flexibility to create this login either with or without providing an email address. Please visit the signup page and proceed to create a login.

1. Download the Example Dataset: Start by downloading the example dataset provided for testing the PGS extension. You can obtain the dataset by clicking on the following link: 50-samples.zip.

2. Unpack the Data: After downloading the zip file, unzip or extract its contents to a location of your choice on your computer.

3. Access Polygenic Risk Score Application: Navigate to the \"Run\" menu and select \"Polygenic Risk Score\" from the options.

4. Choose 1000 Genomes Phase 3 Panel: In the Polygenic Risk Score application, select the \"1000 Genomes Phase 3\" panel as the reference dataset for imputation.

5. Specify PGS Catalog and Trait: Identify and specify the Polygenic Score (PGS) Catalog you want to use for scoring. Choose a relevant trait for the analysis, such as \"Cancer\".

6. Optional Ancestry Estimation: Optionally, you can choose to include ancestry estimation in your analysis. This step may enhance the precision and interpreation of the results.

7. Agree to Terms of Service: Before proceeding, make sure to read and agree to the Terms of Service provided by Imputationserver. It is essential to comply with the platform's terms and conditions.

8. Submit the Job: After configuring all the necessary parameters, click on the \"Submit\" button to initiate the PGS calculation.

9. Monitor Progress: Depending on the server load, the calculation may take a certain amount of time (about 30 minutes). Allow the process to complete.

10. Download Results: Once the calculation is finished, you can view the results provided by Imputationserver PGS and download a report and all calcuated scores.

Congratulations! You have successfully tested Imputationserver PGS using the provided example dataset and configuration settings. Now you are ready to use the service with yout own dataset!

"},{"location":"tutorials/api/","title":"API Reference","text":"

The REST APIs provide programmatic ways to submit new jobs and to download data from Michigan Imputation Server. It identifies users using authentication tokens, responses are provided in JSON format.

"},{"location":"tutorials/api/#authentication","title":"Authentication","text":"

Michigan Imputation Server uses a token-based authentication. The token is required for all future interaction with the server. The token can be created and downloaded from your user profile (username -> Profile):

For security reasons, Api Tokens are valid for 30 days. You can check the status in the web interface.

"},{"location":"tutorials/api/#job-submission-for-whole-genome-imputation","title":"Job Submission for Whole Genome Imputation","text":"

The API allows to submit imputation jobs and to set several parameters. For HLA imputation, please see below.

"},{"location":"tutorials/api/#post-jobssubmitminimac4","title":"POST /jobs/submit/minimac4","text":"

The following parameters can be set:

Parameter Values Default Value Required files /path/to/file x mode qconly phasing imputation imputation password user-defined password auto generated and send by mail refpanel hrc-r1.1 1000g-phase-3-v5 gasp-v2 genome-asia-panel 1000g-phase-1 cappa hapmap-2 - x phasing eagle no_phasing eagle population eur afr asn amr sas eas AA mixed all - x build hg19 hg38 hg19 r2Filter 0 0.001 0.1 0.2 0.3 0"},{"location":"tutorials/api/#job-submission-for-hla-imputation","title":"Job Submission for HLA Imputation","text":"

The API also allows to submit imputation jobs using the HLA application. Please note, that the population parameter can be skipped here.

"},{"location":"tutorials/api/#post-jobssubmitimputationserver-hla","title":"POST /jobs/submit/imputationserver-hla","text":"

The following parameters can be set:

Parameter Values Default Value Required files /path/to/file x mode qconly phasing imputation imputation password user-defined password auto generated and send by mail refpanel multiethnic-hla-panel-Ggroup multiethnic-hla-panel-4digit - x phasing eagle no_phasing eagle build hg19 hg38 hg19 r2Filter 0 0.001 0.1 0.2 0.3 0"},{"location":"tutorials/api/#examples-curl","title":"Examples: curl","text":""},{"location":"tutorials/api/#submit-a-single-file","title":"Submit a single file","text":"

To submit a job please change /path-to/file.vcf.gz to a valid vcf file and update TOKEN with your API Token:

Command:

TOKEN=\"YOUR-API-TOKEN\";\n\ncurl https://imputationserver.sph.umich.edu/api/v2/jobs/submit/minimac4 \\\n  -H \"X-Auth-Token: $TOKEN\" \\\n  -F \"files=@/path-to/file.vcf.gz\" \\\n  -F \"refpanel=1000g-phase-3-v5\" \\\n  -F \"population=eur\"\n

Response:

{\n  \"id\":\"job-20160504-161420\",\n  \"message\":\"Your job was successfully added to the job queue.\",\n  \"success\":true\n}\n
"},{"location":"tutorials/api/#submit-multiple-files","title":"Submit multiple files","text":"

Submits multiple vcf files and impute against 1000 Genomes Phase 3 reference panel.

Command:

TOKEN=\"YOUR-API-TOKEN\";\n\ncurl https://imputationserver.sph.umich.edu/api/v2/jobs/submit/minimac4 \\\n  -H \"X-Auth-Token: $TOKEN\" \\\n  -F \"files=@/path-to/file1.vcf.gz\" \\\n  -F \"files=@/path-to/file2.vcf.gz\" \\\n  -F \"refpanel=1000g-phase-3-v5\" \\\n  -F \"population=eur\"\n

Response:

{\n  \"id\":\"job-20120504-155023\",\n  \"message\":\"Your job was successfully added to the job queue.\",\n  \"success\":true\n}\n
"},{"location":"tutorials/api/#submit-file-from-a-https","title":"Submit file from a HTTP(S)","text":"

Submits files from https with HRC reference panel and quality control.

Command:

TOKEN=\"YOUR-API-TOKEN\";\n\ncurl  https://imputationserver.sph.umich.edu/api/v2/jobs/submit/minimac4 \\\n  -H \"X-Auth-Token: $TOKEN\" \\\n  -F \"files=https://imputationserver.sph.umich.edu/static/downloads/hapmap300.chr1.recode.vcf.gz\" \\\n  -F \"files-source=http\" \\\n  -F \"refpanel=hrc-r1.1\" \\\n  -F \"population=eur\" \\\n  -F \"mode=qconly\"\n

Response:

{\n  \"id\":\"job-20120504-155023\",\n  \"message\":\"Your job was successfully added to the job queue.\",\n  \"success\":true\n}\n
"},{"location":"tutorials/api/#examples-python","title":"Examples: Python","text":""},{"location":"tutorials/api/#submit-single-vcf-file","title":"Submit single vcf file","text":"
import requests\nimport json\n\n# imputation server url\nurl = 'https://imputationserver.sph.umich.edu/api/v2'\ntoken = 'YOUR-API-TOKEN';\n\n# add token to header (see Authentication)\nheaders = {'X-Auth-Token' : token }\ndata = {\n  'refpanel': '1000g-phase-3-v5',\n  'population': 'eur'\n}\n\n# submit new job\nvcf = '/path/to/genome.vcf.gz';\nfiles = {'files' : open(vcf, 'rb')}\nr = requests.post(url + \"/jobs/submit/minimac4\", files=files, data=data, headers=headers)\nif r.status_code != 200:\n  print(r.json()['message'])\n  raise Exception('POST /jobs/submit/minimac4 {}'.format(r.status_code))\n\n# print response and job id\nprint(r.json()['message'])\nprint(r.json()['id'])\n
"},{"location":"tutorials/api/#submit-multiple-vcf-files","title":"Submit multiple vcf files","text":"
import requests\nimport json\n\n# imputation server url\nurl = 'https://imputationserver.sph.umich.edu/api/v2'\ntoken = 'YOUR-API-TOKEN';\n\n# add token to header (see Authentication)\nheaders = {'X-Auth-Token' : token }\ndata = {\n  'refpanel': '1000g-phase-3-v5',\n  'population': 'eur'\n}\n\n# submit new job\nvcf = '/path/to/file1.vcf.gz';\nvcf1 = '/path/to/file2.vcf.gz';\nfiles = [('files', open(vcf, 'rb')), ('files', open(vcf1, 'rb'))]\nr = requests.post(url + \"/jobs/submit/minimac4\", files=files, data=data, headers=headers)\nif r.status_code != 200:\n  print(r.json()['message'])\n  raise Exception('POST /jobs/submit/minimac4 {}'.format(r.status_code))\n\n# print message\nprint(r.json()['message'])\nprint(r.json()['id'])\n
"},{"location":"tutorials/api/#list-all-jobs","title":"List all jobs","text":"

All running jobs can be returned as JSON objects at once.

"},{"location":"tutorials/api/#get-jobs","title":"GET /jobs","text":""},{"location":"tutorials/api/#examples-curl_1","title":"Examples: curl","text":"

Command:

TOKEN=\"YOUR-API-TOKEN\";\n\ncurl -H \"X-Auth-Token: $TOKEN\" https://imputationserver.sph.umich.edu/api/v2/jobs\n

Response:

[\n  {\n    \"applicationId\":\"minimac\",\n    \"executionTime\":0,\n    \"id\":\"job-20160504-155023\",\n    \"name\":\"job-20160504-155023\",\n    \"positionInQueue\":0,\n    \"running\":false,\n    \"state\":5\n  },{\n    \"applicationId\":\"minimac\",\n    \"executionTime\":0,\n    \"id\":\"job-20160420-145809\",\n    \"name\":\"job-20160420-145809\",\n    \"positionInQueue\":0,\n    \"running\":false,\n    \"state\":5\n  },{\n    \"applicationId\":\"minimac\",\n    \"executionTime\":0,\n    \"id\":\"job-20160420-145756\",\n    \"name\":\"job-20160420-145756\",\n    \"positionInQueue\":0,\n    \"running\":false,\n    \"state\":5\n  }\n]\n
"},{"location":"tutorials/api/#example-python","title":"Example: Python","text":"
import requests\nimport json\n\n# imputation server url\nurl = 'https://imputationserver.sph.umich.edu/api/v2'\ntoken = 'YOUR-API-TOKEN';\n\n# add token to header (see authentication)\nheaders = {'X-Auth-Token' : token }\n\n# get all jobs\nr = requests.get(url + \"/jobs\", headers=headers)\nif r.status_code != 200:\n    raise Exception('GET /jobs/ {}'.format(r.status_code))\n\n# print all jobs\nfor job in r.json():\n    print('{} [{}]'.format(job['id'], job['state']))\n
"},{"location":"tutorials/api/#monitor-job-status","title":"Monitor Job Status","text":""},{"location":"tutorials/api/#jobsidstatus","title":"/jobs/{id}/status","text":""},{"location":"tutorials/api/#example-curl","title":"Example: curl","text":"

Command:

TOKEN=\"YOUR-API-TOKEN\";\n\ncurl -H \"X-Auth-Token: $TOKEN\" https://imputationserver.sph.umich.edu/api/v2/jobs/job-20160504-155023/status\n

Response:

{\n  \"application\":\"Michigan Imputation Server (Minimac4) 1.5.8\",\n  \"applicationId\":\"minimac4\",\n  \"deletedOn\":-1,\n  \"endTime\":1462369824173,\n  \"executionTime\":0,\n  \"id\":\"job-20160504-155023\",\n  \"logs\":\"\",\n  \"name\":\"job-20160504-155023\",\n  \"outputParams\":[],\n  \"positionInQueue\":0,\n  \"running\":false,\n  \"startTime\":1462369824173,\n  \"state\":5\n  ,\"steps\":[]\n}\n
"},{"location":"tutorials/api/#monitor-job-details","title":"Monitor Job Details","text":""},{"location":"tutorials/api/#jobsid","title":"/jobs/{id}","text":""},{"location":"tutorials/api/#example-curl_1","title":"Example: curl","text":"
TOKEN=\"YOUR-API-TOKEN\";\n\ncurl -H \"X-Auth-Token: $TOKEN\" https://imputationserver.sph.umich.edu/api/v2/jobs/job-20160504-155023/\n
"},{"location":"tutorials/imputationbot/","title":"Imputation Bot Tutorial","text":""},{"location":"tutorials/imputationbot/#requirements","title":"Requirements","text":"

You will need the following things properly installed on your computer.

  • Java 8 or higher
"},{"location":"tutorials/imputationbot/#download-and-install","title":"Download and Install","text":"

Download and install the latest version from our download page using the following commands:

curl -sL imputationbot.now.sh | bash\n

Test the installation with the following command:

imputationbot version\n

The documentation is available at http://imputationbot.readthedocs.io.

"},{"location":"tutorials/imputationbot/#get-your-api-token","title":"Get your API Token","text":"

Enable API access from your Profile page.

  1. Login and click on your username and then profile:

  1. Click on Create API Token

  1. Copy your API Token and paste it when imputationbot add-instance ask for it.

Api Tokens are valid for 30 days. You can check the status in the web interface or with imputationbot instances

  1. Next, configure imputationbot with the following command:
imputationbot add-instance\n
Imputation Bot 0.8.3 \ud83e\udd16\nhttps://imputationserver.sph.umich.edu\n(c) 2019-2020 Lukas Forer, Sebastian Schoenherr and Christian Fuchsberger\nBuilt by lukas on 2020-09-01T11:31:10Z\n\nImputationserver Url [https://imputationserver.sph.umich.edu]:\nAPI Token [None]: eyJjdHkiOiJ0ZXh0XC9wbGFpbiIsImFsZyI6IkhTMjU2In0.eyJtYWlsIjoibHVrYXMuZm9yZXJAaS1tZWQuYWMuYXQiLCJleHBpcmUiOjE1NzMyMjkwNTY3NTEsIm5hbWUiOiJMdWthcyBGb3JlciIsImFwaSI6dHJ1ZSwidXNlcm5hbWUiOiJsdWtmb3IifQ.qY7iEM6ul-gJ0EuHmEUHRnoS5hZs7kD1HC95NFaxE9w\n
"},{"location":"tutorials/imputationbot/#run-imputation","title":"Run imputation","text":"

You can use the impute command to submit a job:

  • The --files parameter defines the location of our VCF file. If we plan to impute more than one file we can enter the path to a folder or separate multiple filenames by ,.
  • We can use the --refpanel parameter to specify the reference panel. For the 1000 Geneoms Phase 3 panel we use 1000g-phase-3-v5. If we are not sure what panels are provided by the server, we can use imputationbot refpanels to get a list of all reference panels and their supported populations.
  • For --population we use eur which stands for European

The complete command looks like this:

imputationbot impute --files /path/to/your.vcf.gz --refpanel 1000g-phase-3-v5 --population eur\n

After submission we get the URL where we can monitor the progress of our job.

"},{"location":"tutorials/imputationbot/#monitor-jobs","title":"Monitor Jobs","text":"

However, we can also use Imputation Bot to get a list all our jobs and their status:

imputationbot jobs\n

To get more details about our job, we can use the jobs command followed by the job ID:

imputationbot jobs job-XXXXXXXX-XXXXXX-XXX\n
"},{"location":"tutorials/imputationbot/#download-all-results","title":"Download all Results","text":"

We can use the download command to download all imputed genotypes and the QC report at once:

imputationbot download job-XXXXXXXX-XXXXXX-XXX\n

If the job is still running, Imputation Bot waits until the job is finished and starts automatically with the download.

You can provide Imputation Bot the password we sent you via email and it decrypts all files for you:

imputationbot download job-XXXXXXXX-XXXXXX-XXX --password MYPASSWORD\n
"},{"location":"tutorials/imputationbot/#documentation","title":"Documentation","text":"

The documentation is available at http://imputationbot.readthedocs.io.

"},{"location":"tutorials/imputationbot/#contact","title":"Contact","text":"

Feel free to contact us in case of any problems.

"},{"location":"workshops/ASHG2020/","title":"ASHG2020","text":"

Workshop ASHG2020

"},{"location":"workshops/ASHG2020/#the-michigan-imputation-server","title":"The Michigan Imputation Server","text":"

Data Preparation, Genotype Imputation, and Data Analysis

"},{"location":"workshops/ASHG2020/#for-questions","title":"For questions:","text":"
  • Please email us: mis-ashg2020@umich.edu
  • Slack channel: Slack sign-up
"},{"location":"workshops/ASHG2020/#workshop-facilitators","title":"Workshop facilitator(s)","text":"
  • Christian Fuchsberger, christian.fuchsberger@eurac.edu (Eurac Research)
  • Lukas Forer, lukas.forer@i-med.ac.at (Medical University of Innsbruck)
  • Sarah Hanks, schanks@umich.edu (University of Michigan)
  • Sebastian Schoenherr, sebastian.schoenherr@i-med.ac.at (Medical University of Innsbruck)
  • Albert Smith, albertvs@umich.edu (University of Michigan)
  • Cassie Spracklen, cspracklen@umass.edu (University of Massachusetts-Amherst)
"},{"location":"workshops/ASHG2020/#workshop-description-from-the-program","title":"Workshop description (from the program)","text":"

Genotype imputation is a key component of modern genetic studies. This interactive workshop is intended for anyone interested in learning how to use the Michigan Imputation Server (MIS; https://imputationserver.sph.umich.edu) to impute genotypes and how to use the imputed genotypes, with a special focus on up-coming reference panels, including the multi-ancestry panel from the TOPMed program. A brief overview of imputation and the server will be followed by demonstrations and exercises, including:

  1. quality control and preparation of genetic data for use on the MIS with a special focus on diverse ancestries and chromosome X
  2. tracking runs and use of the application program interface for larger jobs
  3. downloading data from the MIS and preparing data for genetic analysis
  4. performing a GWAS using imputed data and interpreting results, taking into account imputation quality

We encourage participants to ask specific questions about their own projects. Workshop materials, including slides and example data sets, will be made available before the workshop and will remain online at the MIS website. We expect that this workshop will enable participants to generate high-quality imputed data sets and to properly analyze them. Attendees are expected to follow materials on their personal laptops.

"},{"location":"workshops/ASHG2020/#intended-audience","title":"Intended Audience","text":"

Attendees interested in learning how to perform genotype imputation and use imputed genotypes in their research, especially trainees. Prior experience with the analysis of genome-wide association studies (GWAS) and the unix command line are recommended for the workshop.

"},{"location":"workshops/ASHG2022/","title":"ASHG2022","text":"

Workshop ASHG2022 - Genetics and Genomics Digital Forum

"},{"location":"workshops/ASHG2022/#the-michigan-imputation-server","title":"The Michigan Imputation Server","text":"

Data Preparation, Genotype Imputation, and Data Analysis

Workshop Website

"},{"location":"workshops/ASHG2022/#workshop-slides","title":"Workshop Slides","text":"

You can download the slides of all workshop sessions here. Please also have a look at the individual sessions below for additional training material.

"},{"location":"workshops/ASHG2022/#workshop-facilitators","title":"Workshop Facilitator(s)","text":"
  • Christian Fuchsberger, christian.fuchsberger@eurac.edu (Eurac Research)
  • Sebastian Sch\u00f6nherr, sebastian.schoenherr@i-med.ac.at (Medical University of Innsbruck)
  • Lukas Forer, lukas.forer@i-med.ac.at (Medical University of Innsbruck)
  • Xueling Sim, ephsx@nus.edu.sg (National University of Singapore)
  • Saori Sakaue, ssakaue@broadinstitute.org (Broad Institute)
  • Albert Smith, albertvs@umich.edu (University of Michigan)
"},{"location":"workshops/ASHG2022/#workshop-description-from-the-program","title":"Workshop Description (from the program)","text":"

Genotype imputation is a key component of modern genetic association studies. The Michigan Imputation Server has thus far helped > 9,600 researchers from around the world to impute > 95 human genomes. This interactive workshop is intended for anyone interested in learning how to impute genotypes and to use the imputed genotypes, highlighting recent reference panels, including the multi-ancestry panel from the TOPMed program and a specialized HLA panel.

A brief overview of imputation and the server will be followed by demonstrations and exercises, including:

  1. quality control and preparation of genetic data for use on the MIS with a special focus on diverse ancestries, chromosome X, and the HLA region;

  2. tracking runs and use of the application program interface for larger jobs;

  3. downloading data from the MIS and preparing data for genetic analysis;

  4. performing a GWAS using imputed data and interpreting results, taking into account imputation quality;

  5. using the additional features, such as the polygenic risk score calculation.

We encourage participants to ask specific questions about their own projects. Workshop materials, including slides and example data sets, will be made available before the workshop and will remain online at the MIS website. We expect that this workshop will enable participants to generate high-quality imputed data sets and to effectively analyze them.

"},{"location":"workshops/ASHG2023/","title":"ASHG2023","text":"

Workshop ASHG2023

"},{"location":"workshops/ASHG2023/#welcome-to-the-michigan-imputation-server-workshop","title":"Welcome to the Michigan Imputation Server Workshop!","text":""},{"location":"workshops/ASHG2023/#workshop-title","title":"Workshop Title","text":"

The Michigan Imputation Server: Data Preparation, Genotype Imputation, and Data Analysis

"},{"location":"workshops/ASHG2023/#topic","title":"Topic","text":"

Statistical Genetics and Genetic Epidemiology

"},{"location":"workshops/ASHG2023/#target-audience","title":"Target Audience","text":"

Attendees interested in learning how to perform genotype imputation and use imputed genotypes in their research, especially trainees. There are no prerequisites for this workshop. Attendees are expected to follow materials on their personal laptops.

"},{"location":"workshops/ASHG2023/#workshop-slides","title":"Workshop Slides","text":"

You can download the slides of all workshop sessions here. Please also have a look at the individual sessions below for additional training material.

"},{"location":"workshops/ASHG2023/#links","title":"Links","text":"
  • Interactive Poll
  • Workshop Website
"},{"location":"workshops/ASHG2023/#workshop-facilitators","title":"Workshop Facilitator(s)","text":"
  • Christian Fuchsberger, christian.fuchsberger@eurac.edu (Eurac Research)
  • Sebastian Sch\u00f6nherr, sebastian.schoenherr@i-med.ac.at (Medical University of Innsbruck)
  • Lukas Forer, lukas.forer@i-med.ac.at (Medical University of Innsbruck)
  • Xueling Sim, ephsx@nus.edu.sg (National University of Singapore)
  • Saori Sakaue, ssakaue@broadinstitute.org (Broad Institute)
  • Albert Smith, albertvs@umich.edu (University of Michigan)
"},{"location":"workshops/ASHG2020/Session1/","title":"Session1","text":"

Workshop ASHG2020 > Session 1: Imputation and the Server

"},{"location":"workshops/ASHG2020/Session1/#slides","title":"Slides","text":"

Download (pdf)

"},{"location":"workshops/ASHG2020/Session1/#links","title":"Links","text":"

Michigan Imputation Server

TOPMed Imputation Server

"},{"location":"workshops/ASHG2020/Session1/#selected-literature","title":"Selected Literature","text":"

Das S, Forer L, Sch\u00f6nherr S, Sidore C, Locke AE, Kwong A, Vrieze SI, Chew EY, Levy S, McGue M, Schlessinger D, Stambolian D, Loh PR, Iacono WG, Swaroop A, Scott LJ, Cucca F, Kronenberg F, Boehnke M, Abecasis GR, Fuchsberger C. Next-generation genotype imputation service and methods. Nat Genet. 2016 Oct;48(10):1284-1287. doi: 10.1038/ng.3656.

Das S, Abecasis GR, Browning BL. Genotype Imputation from Large Reference Panels. Annu Rev Genomics Hum Genet. 2018 Aug 31;19:73-96. doi: 10.1146/annurev-genom-083117-021602.

Fuchsberger C, Abecasis GR, Hinds DA. minimac2: faster genotype imputation. Bioinformatics. 2015 Mar 1;31(5):782-4. doi: 10.1093/bioinformatics/btu704. Epub 2014 Oct 22. PMID: 25338720; PMCID: PMC4341061.

Howie B, Fuchsberger C, Stephens M, Marchini J, Abecasis GR. Fast and accurate genotype imputation in genome-wide association studies through pre-phasing. Nat Genet. 2012 Jul 22;44(8):955-9. doi: 10.1038/ng.2354. PMID: 22820512; PMCID: PMC3696580.

"},{"location":"workshops/ASHG2020/Session2/","title":"Session2","text":"

Workshop ASHG2020 > Session 2: Run a job, Quality Control and Data Preparation

"},{"location":"workshops/ASHG2020/Session2/#welcome","title":"Welcome","text":"

Welcome to Session 2! In this session you will learn how to submit a job on Michigan Imputation Server (MIS) and how to prepare your input data that they are passing the QC step.

"},{"location":"workshops/ASHG2020/Session2/#download-slides","title":"Download Slides","text":"

If you want to access the slides from our workshop please click here: Session 2 Slides (pdf)

"},{"location":"workshops/ASHG2020/Session2/#tutorial","title":"Tutorial","text":""},{"location":"workshops/ASHG2020/Session2/#getting-started-video-demo","title":"Getting Started Video Demo","text":"

As a quick start, the following video includes all required steps to submit and monitor a job using the graphical web interface.

"},{"location":"workshops/ASHG2020/Session2/#run-a-job-on-your-own","title":"Run a job on your own","text":"

After you registered successfully, the following URL will bring you directly to the job submission page: https://imputationserver.sph.umich.edu/index.html#!run/minimac4

"},{"location":"workshops/ASHG2020/Session2/#submission-page-select-parameters","title":"Submission Page - Select parameters","text":"

The UI includes several parameters which need to be specified. Our Getting Started guide describes all required parameters to do so.

"},{"location":"workshops/ASHG2020/Session2/#submission-page-upload-data","title":"Submission Page - Upload data","text":"

We are providing two data datasets that can be downloaded from below. In case the unphased dataset is selected, an additional phasing step using Eagle is automatically performed. For this demo, we recommend seleting the HapMap 2 panel (Input parameter 'Reference panel') to get your results as quick as possible. Please also have a look at our supported reference panels when using MIS in a production setup.

Tip

You can also copy/paste the URL from below and change \"File Upload\" to \"URLs (HTTP)\" load the data from a remote server (GitHub in this case).

  • Phased dataset chr20 hg19
  • Unphased dataset chr20 hg19
"},{"location":"workshops/ASHG2020/Session2/#submission-page-submit","title":"Submission Page - Submit","text":"

After all parameters have been selected and you click 'submit', the job will be added to our Input Validation and QC queue. Please have a look at our Data Preparation Guide to learn how to prepare your dataset using a pre-imputation tool.

"},{"location":"workshops/ASHG2020/Session2/#monitor-jobs-download-data","title":"Monitor Jobs, Download Data","text":"

If the job passes the QC step, it will be added to our long-time queue. As soon as your job is finished, you will receive an email with the password to download and encrypt your data. Also checkout our Pipeline Overview Guide to learn more about the different internal parameters. The complete source code can also be found on GitHub.

"},{"location":"workshops/ASHG2020/Session2/#contact","title":"Contact","text":"

If you have any questions please write me an email or contact me on Twitter.

"},{"location":"workshops/ASHG2020/Session3/","title":"Session3","text":"

Workshop ASHG2020 > Session 3: Tracking runs and downloading data

"},{"location":"workshops/ASHG2020/Session3/#slides","title":"Slides","text":"

Learn how to monitor jobs and their progress, how to download imputation results and how to decrypt results using standard software.

Download (pdf)

"},{"location":"workshops/ASHG2020/Session4/","title":"Session4","text":"

Workshop ASHG2020 > Session 4: Performing GWAS using imputed data

"},{"location":"workshops/ASHG2020/Session4/#slides","title":"Slides","text":"

Download (pdf)

"},{"location":"workshops/ASHG2020/Session5/","title":"Session5","text":"

Workshop ASHG2020 > Session 5: Imputation Bot

"},{"location":"workshops/ASHG2020/Session5/#slides","title":"Slides","text":"

Learn how to use Imputation bot to automate job submission and interactions with imputation servers.

Download (pdf)

"},{"location":"workshops/ASHG2020/Session5/#tutorial","title":"Tutorial","text":""},{"location":"workshops/ASHG2020/Session5/#requirements","title":"Requirements","text":"

You will need the following things properly installed on your computer.

  • Java 8 or higher
"},{"location":"workshops/ASHG2020/Session5/#download-and-install","title":"Download and Install","text":"

Download and install the latest version from our download page using the following commands:

curl -sL imputationbot.now.sh | bash\n

Test the installation with the following command:

imputationbot version\n

The documentation is available at http://imputationbot.readthedocs.io.

"},{"location":"workshops/ASHG2020/Session5/#get-your-api-token","title":"Get your API Token","text":"

Enable API access from your Profile page.

  1. Login and click on your username and then profile:

  1. Click on Create API Token

  1. Copy your API Token and paste it when imputationbot add-instance ask for it.

Api Tokens are valid for 30 days. You can check the status in the web interface or with imputationbot instances

  1. Next, configure imputationbot with the following command:
imputationbot add-instance\n
Imputation Bot 0.8.3 \ud83e\udd16\nhttps://imputationserver.sph.umich.edu\n(c) 2019-2020 Lukas Forer, Sebastian Schoenherr and Christian Fuchsberger\nBuilt by lukas on 2020-09-01T11:31:10Z\n\nImputationserver Url [https://imputationserver.sph.umich.edu]:\nAPI Token [None]: eyJjdHkiOiJ0ZXh0XC9wbGFpbiIsImFsZyI6IkhTMjU2In0.eyJtYWlsIjoibHVrYXMuZm9yZXJAaS1tZWQuYWMuYXQiLCJleHBpcmUiOjE1NzMyMjkwNTY3NTEsIm5hbWUiOiJMdWthcyBGb3JlciIsImFwaSI6dHJ1ZSwidXNlcm5hbWUiOiJsdWtmb3IifQ.qY7iEM6ul-gJ0EuHmEUHRnoS5hZs7kD1HC95NFaxE9w\n
"},{"location":"workshops/ASHG2020/Session5/#run-imputation","title":"Run imputation","text":"

You can use the impute command to submit a job:

  • The --files parameter defines the location of our VCF file. If we plan to impute more than one file we can enter the path to a folder or separate multiple filenames by ,.
  • We can use the --refpanel parameter to specify the reference panel. For the 1000 Geneoms Phase 3 panel we use 1000g-phase-3-v5. If we are not sure what panels are provided by the server, we can use imputationbot refpanels to get a list of all reference panels and their supported populations.
  • For --population we use eur which stands for European

The complete command looks like this:

imputationbot impute --files /path/to/your.vcf.gz --refpanel 1000g-phase-3-v5 --population eur\n

After submission we get the URL where we can monitor the progress of our job.

"},{"location":"workshops/ASHG2020/Session5/#monitor-jobs","title":"Monitor Jobs","text":"

However, we can also use Imputation Bot to get a list all our jobs and their status:

imputationbot jobs\n

To get more details about our job, we can use the jobs command followed by the job ID:

imputationbot jobs job-XXXXXXXX-XXXXXX-XXX\n
"},{"location":"workshops/ASHG2020/Session5/#download-all-results","title":"Download all Results","text":"

We can use the download command to download all imputed genotypes and the QC report at once:

imputationbot download job-XXXXXXXX-XXXXXX-XXX\n

If the job is still running, Imputation Bot waits until the job is finished and starts automatically with the download.

You can provide Imputation Bot the password we sent you via email and it decrypts all files for you:

imputationbot download job-XXXXXXXX-XXXXXX-XXX --password MYPASSWORD\n
"},{"location":"workshops/ASHG2020/Session5/#documentation","title":"Documentation","text":"

The documentation is available at http://imputationbot.readthedocs.io.

"},{"location":"workshops/ASHG2020/Session5/#contact","title":"Contact","text":"

Feel free to contact us in case of any problems.

"},{"location":"workshops/ASHG2020/Session6/","title":"Session6","text":"

Workshop ASHG2020 > Session 6: The TOPMed Imputation Server

"},{"location":"workshops/ASHG2020/Session6/#slides","title":"Slides","text":"

Download (pdf)

"},{"location":"workshops/ASHG2020/Session7/","title":"Session7","text":"

Workshop ASHG2020 > Session 6: Session 7: Imputation panels

"},{"location":"workshops/ASHG2020/Session7/#slides","title":"Slides","text":"

Download (pdf)

"},{"location":"workshops/ASHG2022/Session1/","title":"Session1","text":"

Workshop ASHG2022 > Session 1: Imputation and the Server

"},{"location":"workshops/ASHG2022/Session1/#slides","title":"Slides","text":"

Download (pdf)

"},{"location":"workshops/ASHG2022/Session1/#server-links","title":"Server Links","text":"

Michigan Imputation Server

TOPMed Imputation Server

"},{"location":"workshops/ASHG2022/Session1/#selected-literature","title":"Selected Literature","text":"

Das S, Forer L, Sch\u00f6nherr S, Sidore C, Locke AE, Kwong A, Vrieze SI, Chew EY, Levy S, McGue M, Schlessinger D, Stambolian D, Loh PR, Iacono WG, Swaroop A, Scott LJ, Cucca F, Kronenberg F, Boehnke M, Abecasis GR, Fuchsberger C. Next-generation genotype imputation service and methods. Nat Genet. 2016 Oct;48(10):1284-1287. doi: 10.1038/ng.3656.

Das S, Abecasis GR, Browning BL. Genotype Imputation from Large Reference Panels. Annu Rev Genomics Hum Genet. 2018 Aug 31;19:73-96. doi: 10.1146/annurev-genom-083117-021602.

Fuchsberger C, Abecasis GR, Hinds DA. minimac2: faster genotype imputation. Bioinformatics. 2015 Mar 1;31(5):782-4. doi: 10.1093/bioinformatics/btu704. Epub 2014 Oct 22. PMID: 25338720; PMCID: PMC4341061.

Howie B, Fuchsberger C, Stephens M, Marchini J, Abecasis GR. Fast and accurate genotype imputation in genome-wide association studies through pre-phasing. Nat Genet. 2012 Jul 22;44(8):955-9. doi: 10.1038/ng.2354. PMID: 22820512; PMCID: PMC3696580.

"},{"location":"workshops/ASHG2022/Session2/","title":"Session2","text":"

Workshop ASHG2022 > Session 2: Run a job, Data Preparation and Data Download

"},{"location":"workshops/ASHG2022/Session2/#welcome","title":"Welcome","text":"

Welcome to Session 2! In this session you will learn how to submit a job on Michigan Imputation Server (MIS) and how to prepare your input data that they are passing the QC step.

"},{"location":"workshops/ASHG2022/Session2/#download-slides","title":"Download Slides","text":"

Download (pdf)

"},{"location":"workshops/ASHG2022/Session2/#tutorial","title":"Tutorial","text":""},{"location":"workshops/ASHG2022/Session2/#getting-started","title":"Getting Started","text":"

As a quick start, the following video includes all required steps to submit and monitor a job using the graphical web interface.

"},{"location":"workshops/ASHG2022/Session2/#run-a-job-on-your-own","title":"Run a job on your own","text":"

After you registered successfully, the following URL will bring you directly to the job submission page: https://imputationserver.sph.umich.edu/index.html#!run/minimac4

"},{"location":"workshops/ASHG2022/Session2/#submission-page-select-parameters","title":"Submission Page - Select parameters","text":"

The UI includes several parameters which need to be specified. Our Getting Started guide describes all required parameters to do so.

"},{"location":"workshops/ASHG2022/Session2/#submission-page-upload-data","title":"Submission Page - Upload data","text":"

We are providing two data datasets that can be downloaded from below. In case the unphased dataset is selected, an additional phasing step using Eagle is automatically performed. For this demo, we recommend selecting the HapMap 2 panel (Input parameter 'Reference panel') to get your results as quick as possible. Please also have a look at our supported reference panels when using MIS in a production setup.

Tip

You can also copy/paste the URL from below and change \"File Upload\" to \"URLs (HTTP)\" load the data from a remote server (GitHub in this case).

  • Phased dataset chr20 hg19
  • Unphased dataset chr20 hg19
"},{"location":"workshops/ASHG2022/Session2/#submission-page-submit","title":"Submission Page - Submit","text":"

After all parameters have been selected and you click 'submit', the job will be added to our Input Validation and QC queue. Please have a look at our Data Preparation Guide to learn how to prepare your dataset using a pre-imputation tool.

"},{"location":"workshops/ASHG2022/Session2/#monitor-jobs-download-data","title":"Monitor Jobs, Download Data","text":"

If the job passes the QC step, it will be added to our long-time queue. As soon as your job is finished, you will receive an email with the password to download and encrypt your data. Also checkout our Pipeline Overview Guide to learn more about the different internal parameters. The complete source code can also be found on GitHub.

"},{"location":"workshops/ASHG2022/Session2/#contact","title":"Contact","text":"

If you have any questions please write me an email or contact me on Twitter.

"},{"location":"workshops/ASHG2022/Session3/","title":"Session3","text":"

Workshop ASHG2022 > Session 3: Performing GWAS using imputed data

"},{"location":"workshops/ASHG2022/Session3/#slides","title":"Slides","text":"

Download (pdf)

"},{"location":"workshops/ASHG2022/Session4/","title":"Session4","text":"

Workshop ASHG2022 > Session 4: Imputation Bot and PGS Server

"},{"location":"workshops/ASHG2022/Session4/#slides","title":"Slides","text":"

Download (pdf)

"},{"location":"workshops/ASHG2022/Session4/#imputation-bot-tutorial","title":"Imputation Bot Tutorial","text":""},{"location":"workshops/ASHG2022/Session4/#requirements","title":"Requirements","text":"

You will need the following things properly installed on your computer.

  • Java 8 or higher
"},{"location":"workshops/ASHG2022/Session4/#download-and-install","title":"Download and Install","text":"

Download and install the latest version from our download page using the following commands:

curl -sL imputationbot.now.sh | bash\n

Test the installation with the following command:

imputationbot version\n

The documentation is available at http://imputationbot.readthedocs.io.

"},{"location":"workshops/ASHG2022/Session4/#get-your-api-token","title":"Get your API Token","text":"

Enable API access from your Profile page.

  1. Login and click on your username and then profile:

  1. Click on Create API Token

  1. Copy your API Token and paste it when imputationbot add-instance ask for it.

Api Tokens are valid for 30 days. You can check the status in the web interface or with imputationbot instances

  1. Next, configure imputationbot with the following command:
imputationbot add-instance\n
Imputation Bot 0.8.3 \ud83e\udd16\nhttps://imputationserver.sph.umich.edu\n(c) 2019-2020 Lukas Forer, Sebastian Schoenherr and Christian Fuchsberger\nBuilt by lukas on 2020-09-01T11:31:10Z\n\nImputationserver Url [https://imputationserver.sph.umich.edu]:\nAPI Token [None]: eyJjdHkiOiJ0ZXh0XC9wbGFpbiIsImFsZyI6IkhTMjU2In0.eyJtYWlsIjoibHVrYXMuZm9yZXJAaS1tZWQuYWMuYXQiLCJleHBpcmUiOjE1NzMyMjkwNTY3NTEsIm5hbWUiOiJMdWthcyBGb3JlciIsImFwaSI6dHJ1ZSwidXNlcm5hbWUiOiJsdWtmb3IifQ.qY7iEM6ul-gJ0EuHmEUHRnoS5hZs7kD1HC95NFaxE9w\n
"},{"location":"workshops/ASHG2022/Session4/#run-imputation","title":"Run imputation","text":"

You can use the impute command to submit a job:

  • The --files parameter defines the location of our VCF file. If we plan to impute more than one file we can enter the path to a folder or separate multiple filenames by ,.
  • We can use the --refpanel parameter to specify the reference panel. For the 1000 Geneoms Phase 3 panel we use 1000g-phase-3-v5. If we are not sure what panels are provided by the server, we can use imputationbot refpanels to get a list of all reference panels and their supported populations.
  • For --population we use eur which stands for European

The complete command looks like this:

imputationbot impute --files /path/to/your.vcf.gz --refpanel 1000g-phase-3-v5 --population eur\n

After submission we get the URL where we can monitor the progress of our job.

"},{"location":"workshops/ASHG2022/Session4/#monitor-jobs","title":"Monitor Jobs","text":"

However, we can also use Imputation Bot to get a list all our jobs and their status:

imputationbot jobs\n

To get more details about our job, we can use the jobs command followed by the job ID:

imputationbot jobs job-XXXXXXXX-XXXXXX-XXX\n
"},{"location":"workshops/ASHG2022/Session4/#download-all-results","title":"Download all Results","text":"

We can use the download command to download all imputed genotypes and the QC report at once:

imputationbot download job-XXXXXXXX-XXXXXX-XXX\n

If the job is still running, Imputation Bot waits until the job is finished and starts automatically with the download.

You can provide Imputation Bot the password we sent you via email and it decrypts all files for you:

imputationbot download job-XXXXXXXX-XXXXXX-XXX --password MYPASSWORD\n
"},{"location":"workshops/ASHG2022/Session4/#documentation","title":"Documentation","text":"

The documentation is available at http://imputationbot.readthedocs.io.

"},{"location":"workshops/ASHG2022/Session4/#contact","title":"Contact","text":"

Feel free to contact us in case of any problems.

"},{"location":"workshops/ASHG2022/Session5/","title":"Session5","text":"

Workshop ASHG2022 > Session 5: HLA Imputation

"},{"location":"workshops/ASHG2022/Session5/#slides","title":"Slides","text":"

Download (pdf)

"},{"location":"workshops/ASHG2022/Session6/","title":"Session6","text":"

Workshop ASHG2022 > Session 6: The TOPMed Imputation Server

"},{"location":"workshops/ASHG2022/Session6/#slides","title":"Slides","text":"

Download (pdf)

"},{"location":"workshops/ASHG2023/Session1/","title":"Session1","text":"

Workshop ASHG2023 > Session 1: Imputation and the Server

"},{"location":"workshops/ASHG2023/Session1/#server-links","title":"Server Links","text":"

Michigan Imputation Server

TOPMed Imputation Server

"},{"location":"workshops/ASHG2023/Session1/#selected-literature","title":"Selected Literature","text":"

Das S, Forer L, Sch\u00f6nherr S, Sidore C, Locke AE, Kwong A, Vrieze SI, Chew EY, Levy S, McGue M, Schlessinger D, Stambolian D, Loh PR, Iacono WG, Swaroop A, Scott LJ, Cucca F, Kronenberg F, Boehnke M, Abecasis GR, Fuchsberger C. Next-generation genotype imputation service and methods. Nat Genet. 2016 Oct;48(10):1284-1287. doi: 10.1038/ng.3656.

Das S, Abecasis GR, Browning BL. Genotype Imputation from Large Reference Panels. Annu Rev Genomics Hum Genet. 2018 Aug 31;19:73-96. doi: 10.1146/annurev-genom-083117-021602.

Fuchsberger C, Abecasis GR, Hinds DA. minimac2: faster genotype imputation. Bioinformatics. 2015 Mar 1;31(5):782-4. doi: 10.1093/bioinformatics/btu704. Epub 2014 Oct 22. PMID: 25338720; PMCID: PMC4341061.

Howie B, Fuchsberger C, Stephens M, Marchini J, Abecasis GR. Fast and accurate genotype imputation in genome-wide association studies through pre-phasing. Nat Genet. 2012 Jul 22;44(8):955-9. doi: 10.1038/ng.2354. PMID: 22820512; PMCID: PMC3696580.

"},{"location":"workshops/ASHG2023/Session2/","title":"Session2","text":"

Workshop ASHG2023 > Session 2: Run a job, Data Preparation and Data Download

"},{"location":"workshops/ASHG2023/Session2/#welcome","title":"Welcome","text":"

Welcome to Session 2! In this session you will learn how to submit a job on Michigan Imputation Server (MIS) and how to prepare your input data that they are passing the QC step.

"},{"location":"workshops/ASHG2023/Session2/#tutorial","title":"Tutorial","text":""},{"location":"workshops/ASHG2023/Session2/#getting-started","title":"Getting Started","text":"

As a quick start, the following video includes all required steps to submit and monitor a job using the graphical web interface.

"},{"location":"workshops/ASHG2023/Session2/#run-a-job-on-your-own","title":"Run a job on your own","text":"

After you registered successfully, the following URL will bring you directly to the job submission page: https://imputationserver.sph.umich.edu/index.html#!run/minimac4

"},{"location":"workshops/ASHG2023/Session2/#submission-page-select-parameters","title":"Submission Page - Select parameters","text":"

The UI includes several parameters which need to be specified. Our Getting Started guide describes all required parameters to do so.

"},{"location":"workshops/ASHG2023/Session2/#submission-page-upload-data","title":"Submission Page - Upload data","text":"

We are providing two data datasets that can be downloaded from below. In case the unphased dataset is selected, an additional phasing step using Eagle is automatically performed. For this demo, we recommend selecting the HapMap 2 panel (Input parameter 'Reference panel') to get your results as quick as possible. Please also have a look at our supported reference panels when using MIS in a production setup.

  • Phased dataset chr20 hg19
  • Unphased dataset chr20 hg19
"},{"location":"workshops/ASHG2023/Session2/#submission-page-submit","title":"Submission Page - Submit","text":"

After all parameters have been selected and you click 'submit', the job will be added to our Input Validation and QC queue. Please have a look at our Data Preparation Guide to learn how to prepare your dataset using a pre-imputation tool.

"},{"location":"workshops/ASHG2023/Session2/#monitor-jobs-download-data","title":"Monitor Jobs, Download Data","text":"

If the job passes the QC step, it will be added to our long-time queue. As soon as your job is finished, you will receive an email with the password to download and encrypt your data. Also checkout our Pipeline Overview Guide to learn more about the different internal parameters. The complete source code can also be found on GitHub.

"},{"location":"workshops/ASHG2023/Session2/#qc-results","title":"QC Results","text":"

A simple QC report including the frequency plot is available here.

"},{"location":"workshops/ASHG2023/Session2/#contact","title":"Contact","text":"

If you have any questions please write me an email or contact me on Twitter.

"},{"location":"workshops/ASHG2023/Session3/","title":"Session3","text":"

Workshop ASHG2023 > Session 3: Performing GWAS using imputed data

"},{"location":"workshops/ASHG2023/Session4/","title":"Session4","text":"

Workshop ASHG2023 > Session 4: nf-gwas, Imputation Bot and PGS Server

"},{"location":"workshops/ASHG2023/Session4/#nf-gwas-report","title":"nf-gwas Report","text":"

You can download a nf-gwas test report from here. Please unzip the file and open the index.html file.

"},{"location":"workshops/ASHG2023/Session4/#imputation-bot-tutorial","title":"Imputation Bot Tutorial","text":""},{"location":"workshops/ASHG2023/Session4/#requirements","title":"Requirements","text":"

You will need the following things properly installed on your computer.

  • Java 8 or higher
"},{"location":"workshops/ASHG2023/Session4/#download-and-install","title":"Download and Install","text":"

Download and install the latest version from our download page using the following commands:

curl -sL imputationbot.now.sh | bash\n

Test the installation with the following command:

imputationbot version\n

The documentation is available at http://imputationbot.readthedocs.io.

"},{"location":"workshops/ASHG2023/Session4/#get-your-api-token","title":"Get your API Token","text":"

Enable API access from your Profile page.

  1. Login and click on your username and then profile:

  1. Click on Create API Token

  1. Copy your API Token and paste it when imputationbot add-instance ask for it.

Api Tokens are valid for 30 days. You can check the status in the web interface or with imputationbot instances

  1. Next, configure imputationbot with the following command:
imputationbot add-instance\n
Imputation Bot 0.8.3 \ud83e\udd16\nhttps://imputationserver.sph.umich.edu\n(c) 2019-2020 Lukas Forer, Sebastian Schoenherr and Christian Fuchsberger\nBuilt by lukas on 2020-09-01T11:31:10Z\n\nImputationserver Url [https://imputationserver.sph.umich.edu]:\nAPI Token [None]: eyJjdHkiOiJ0ZXh0XC9wbGFpbiIsImFsZyI6IkhTMjU2In0.eyJtYWlsIjoibHVrYXMuZm9yZXJAaS1tZWQuYWMuYXQiLCJleHBpcmUiOjE1NzMyMjkwNTY3NTEsIm5hbWUiOiJMdWthcyBGb3JlciIsImFwaSI6dHJ1ZSwidXNlcm5hbWUiOiJsdWtmb3IifQ.qY7iEM6ul-gJ0EuHmEUHRnoS5hZs7kD1HC95NFaxE9w\n
"},{"location":"workshops/ASHG2023/Session4/#run-imputation","title":"Run imputation","text":"

You can use the impute command to submit a job:

  • The --files parameter defines the location of our VCF file. If we plan to impute more than one file we can enter the path to a folder or separate multiple filenames by ,.
  • We can use the --refpanel parameter to specify the reference panel. For the 1000 Geneoms Phase 3 panel we use 1000g-phase-3-v5. If we are not sure what panels are provided by the server, we can use imputationbot refpanels to get a list of all reference panels and their supported populations.
  • For --population we use eur which stands for European

The complete command looks like this:

imputationbot impute --files /path/to/your.vcf.gz --refpanel 1000g-phase-3-v5 --population eur\n

After submission we get the URL where we can monitor the progress of our job.

"},{"location":"workshops/ASHG2023/Session4/#monitor-jobs","title":"Monitor Jobs","text":"

However, we can also use Imputation Bot to get a list all our jobs and their status:

imputationbot jobs\n

To get more details about our job, we can use the jobs command followed by the job ID:

imputationbot jobs job-XXXXXXXX-XXXXXX-XXX\n
"},{"location":"workshops/ASHG2023/Session4/#download-all-results","title":"Download all Results","text":"

We can use the download command to download all imputed genotypes and the QC report at once:

imputationbot download job-XXXXXXXX-XXXXXX-XXX\n

If the job is still running, Imputation Bot waits until the job is finished and starts automatically with the download.

You can provide Imputation Bot the password we sent you via email and it decrypts all files for you:

imputationbot download job-XXXXXXXX-XXXXXX-XXX --password MYPASSWORD\n
"},{"location":"workshops/ASHG2023/Session4/#documentation","title":"Documentation","text":"

The documentation is available at http://imputationbot.readthedocs.io.

"},{"location":"workshops/ASHG2023/Session4/#contact","title":"Contact","text":"

Feel free to contact us in case of any problems.

"},{"location":"workshops/ASHG2023/Session5/","title":"Session5","text":"

Workshop ASHG2023 > Session 5: HLA Imputation

  • Example output of the HLA imputation VCF
"},{"location":"workshops/ASHG2023/Session6/","title":"Session6","text":"

Workshop ASHG2023 > Session 6: The TOPMed Imputation Server

"}]} \ No newline at end of file +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Home","text":""},{"location":"#michigan-imputation-serverfree-next-generation-genotype-imputation-platform","title":"Michigan Imputation ServerFree Next-Generation Genotype Imputation Platform","text":"

Michigan Imputation Server provides a free genotype imputation service using Minimac4. You can upload phased or unphased GWAS genotypes and receive phased and imputed genomes in return. Our server offers imputation from 1000 Genomes (Phase 1 and 3), CAAPA, HRC and the TOPMed reference panel. For all uploaded datasets an extensive QC is performed. The complete source code is hosted on GitHub.

Please cite this paper if you use Michigan Imputation Server in your publication:

Das S, Forer L, Sch\u00f6nherr S, Sidore C, Locke AE, Kwong A, Vrieze S, Chew EY, Levy S, McGue M, Schlessinger D, Stambolian D, Loh PR, Iacono WG, Swaroop A, Scott LJ, Cucca F, Kronenberg F, Boehnke M, Abecasis GR, Fuchsberger C. Next-generation genotype imputation service and methods. Nature Genetics 48, 1284\u20131287 (2016).

"},{"location":"#latest-news","title":"Latest News","text":"

21 May 2021 We have increased the max sample size to 110k.

15 April 2021 Update to new framework completed! Currently, max sample size will be limited to 25k, but we expect to lift this limitation in the next few weeks.

18 March 2020 Due to coronavirus-related impacts support may be slower than usual. If you haven't heard back from us after a week or so, feel free to e-mail again to check on the status of things. Take care!

07 November 2019 Updated MIS to v1.2.4! Major improvements: Minimac4 for imputation, improved chrX support, QC check right after upload, better documentation. Checkout out our GitHub repository for further information.

17 October 2019 Michigan Imputation Server at ASHG19. All information is available here.

27 November 2018 Redesigned user interface to improve user experience.

27 June 2017 Updated pipeline to v1.0.2. Release notes can be found here.

29 Aug 2016 Imputation server paper is out now: Das et al., Nature Genetics 2016

19 April 2016 Updated HRC Panel (r1.1) available.

12 January 2016 New Reference Panel (CAAPA) available.

24 April 2015 HRC release 1 (64,976 haplotypes at 39,235,157 SNPs) is now ready for use for HRC consortium members.

"},{"location":"contact/","title":"Contact","text":"

The complete Imputation Server 2 source code is available on GitHub and has been developed by Lukas Forer and Sebastian Sch\u00f6nherr from the Institute of Genetic Epidemiology, Medical University of Innsbruck.

Feel free to create issues and pull requests. Before contacting us, please have a look at the FAQ page first.

"},{"location":"contact/#michigan-imputation-server-team","title":"Michigan Imputation Server Team","text":"

Michigan Imputation Server provides a free genotype imputation service using Minimac4. You can upload phased or unphased GWAS genotypes and receive phased and imputed genomes in return. For all uploaded data sets an extensive QC is performed.

  • Christian Fuchsberger
  • Lukas Forer
  • Sebastian Sch\u00f6nherr
  • Sayantan Das
  • Gon\u00e7alo Abecasis

Please contact Christian Fuchsberger in case of other problems.

"},{"location":"contact/#topmed-imputation-server-team","title":"TOPMed Imputation Server Team","text":"

Michigan Imputation Server provides a free genotype imputation service using Minimac4. You can upload phased or unphased GWAS genotypes and receive phased and imputed genomes in return. For all uploaded data sets an extensive QC is performed.

  • Albert Smith
  • Andy Boughton

Please use this addrees for all inquiries.

"},{"location":"contact/#imputation-engine-minimac4","title":"Imputation engine: Minimac4","text":"

Minimac4 is a lower memory and more computationally efficient implementation of the genotype imputation algorithms in minimac/mininac2/minimac3.

  • Sayantan Das
  • Christian Fuchsberger
  • Gon\u00e7alo Abecasis
"},{"location":"contact/#cloud-framework-cloudgene","title":"Cloud framework: Cloudgene","text":"

Cloudgene is a framework to build Software As A Service (SaaS) platforms for data analysis pipelines. By connecting command-line programs, scripts or Hadoop applications to Cloudgene, a powerful web application can be created within minutes. Cloudgene supports the complete workflow including data transfer, program execution and data export. Cloudgene is developed at the Division of Genetic Epidemiology Innsbruck in cooperation with the Center for Statistical Genetics, University of Michigan.

  • Lukas Forer
  • Sebastian Sch\u00f6nherr
"},{"location":"contact/#phasing-engine-eagle2","title":"Phasing engine: Eagle2","text":"

For haplotype phasing Eagle2 is used. Eagle2 attains high accuracy across a broad range of cohort sizes by efficiently leveraging information from large external reference panels (such as the Haplotype Reference Consortium; HRC).

"},{"location":"data-sensitivity/","title":"Data Security","text":"

Since data is transfered to our server located in Michigan, a wide array of security measures are in force:

  • The complete interaction with the server is secured with HTTPS.
  • Input data is deleted from our servers as soon it is not needed anymore.
  • We only store the number of samples and markers analyzed, we don't ever \"look\" at your data in anyway.
  • All results are encrypted with a strong one-time password - thus, only you can read them.
  • After imputation is finished, the data uploader has 7 days to use an encrypted connection to get results back.
  • The complete source code is available in a public Github repository.
"},{"location":"data-sensitivity/#who-has-access","title":"Who has access?","text":"

To upload and download data, users must register with a unique e-mail address and strong password. Each user can only download imputation results for samples that they have themselves uploaded; no other imputation server users will be able to access your data.

"},{"location":"data-sensitivity/#cookies","title":"Cookies","text":"

We value your privacy and are committed to transparency regarding the use of cookies on our website. Below, we outline our cookie policy to provide you with clarity and assurance.

"},{"location":"data-sensitivity/#what-are-cookies","title":"What are cookies?","text":"

Cookies are small text files that are placed on your device when you visit a website. They serve various purposes, including enhancing user experience, facilitating website functionality, and analyzing website traffic.

"},{"location":"data-sensitivity/#how-do-we-use-cookies","title":"How do we use cookies?","text":"

We use cookies only for the purpose of facilitating login functionality. These cookies help us recognize your device and authenticate your access to our platform securely. We do not track any personal information or analyze user activities through cookies.

"},{"location":"data-sensitivity/#why-do-we-use-cookies","title":"Why do we use cookies?","text":"

Cookies are essential for providing seamless login experiences to our users. By storing authentication information, cookies enable you to access your account efficiently without the need for repetitive login procedures. We respect your privacy and limit cookie usage exclusively to login purposes.

"},{"location":"data-sensitivity/#what-security-or-firewalls-protect-access","title":"What security or firewalls protect access?","text":"

A wide array of security measures are in force on the imputation servers:

  • SSH login to the servers is restricted to only systems administrators.
  • Direct root login via SSH is not allowed from the public Internet.
  • The public-facing side of the servers sits behind the School of Public Health's Checkpoint virtual firewall instance where a default-deny policy is used on inbound traffic; only explicitly allowed TCP ports are passed.
  • The School of Public Health also makes use of NIDS technologies such as Snort and Peakflow on its network links for traffic analysis and threat detection.
  • On imputation server itself, updates are run regularly by systems administrators who follow several zero-day computer security announcement lists; the OSSEC HIDS is used for log analysis and anomaly detection; and Denyhosts is used to thwart brute-force SSH login attacks.
"},{"location":"data-sensitivity/#what-encryption-of-the-data-is-used-while-the-data-are-present","title":"What encryption of the data is used while the data are present?","text":"

Imputation results are encrypted with a one-time password generated by the system. The password consists of lower characters, upper characters, special characters and numbers with max. 3 duplicates.

"},{"location":"faq/","title":"Frequently Asked Questions","text":""},{"location":"faq/#i-did-not-receive-a-password-for-my-imputation-job","title":"I did not receive a password for my imputation job","text":"

Michigan Imputation Server creates a random password for each imputation job. This password is not stored on server-side at any time. If you didn't receive a password, please check your Mail SPAM folder. Please note that we are not able to re-send you the password.

"},{"location":"faq/#unzip-command-is-not-working","title":"Unzip command is not working","text":"

Please check the following points: (1) When selecting AES256 encryption, please use 7z to unzip your files (Debian: sudo apt-get install p7zip-full). For our default encryption all common programs should work. (2) If your password includes special characters (e.g. \\), please put single or double quotes around the password when extracting it from the command line (e.g. 7z x -p\"PASSWORD\" chr_22.zip).

"},{"location":"faq/#extending-expiration-date-or-reset-download-counter","title":"Extending expiration date or reset download counter","text":"

Your data is available for 7 days. In case you need an extension, please let us know.

"},{"location":"faq/#how-can-i-improve-the-download-speed","title":"How can I improve the download speed?","text":"

aria2 tries to utilize your maximum download bandwidth. Please keep in mind to raise the k parameter significantly (-k, --min-split-size=SIZE). You will otherwise hit the Michigan Imputation Server download limit for each file (thanks to Anthony Marcketta for point this out).

"},{"location":"faq/#can-i-download-all-results-at-once","title":"Can I download all results at once?","text":"

We provide wget command for all results. Please open the results tab. The last column in each row includes direct links to all files.

"},{"location":"faq/#can-i-set-up-michigan-imputation-server-locally","title":"Can I set up Michigan Imputation Server locally?","text":"

We are providing a single-node Docker image that can be used to impute from Hapmap2 and 1000G Phase3 locally. Click here to give it a try. For usage in production, we highly recommend setting up a Hadoop cluster.

"},{"location":"faq/#your-web-service-looks-great-can-i-set-up-my-own-web-service-as-well","title":"Your web service looks great. Can I set up my own web service as well?","text":"

All web service functionality is provided by Cloudgene. Please contact us, in case you want to set up your own service.

"},{"location":"getting-started/","title":"Getting started","text":"

To use Michigan Imputation Server, a registration is required. We send an activation mail to the provided address. Please follow the instructions in the email to activate your account. If it doesn't arrive, ensure you have entered the correct email address and check your spam folder.

After the email address has been verified, the service can be used without any costs.

Please cite this paper if you use Michigan Imputation Server in your GWAS study:

Das S, Forer L, Sch\u00f6nherr S, Sidore C, Locke AE, Kwong A, Vrieze S, Chew EY, Levy S, McGue M, Schlessinger D, Stambolian D, Loh PR, Iacono WG, Swaroop A, Scott LJ, Cucca F, Kronenberg F, Boehnke M, Abecasis GR, Fuchsberger C. Next-generation genotype imputation service and methods. Nature Genetics 48, 1284\u20131287 (2016).

"},{"location":"getting-started/#setup-your-first-imputation-job","title":"Setup your first imputation job","text":"

Please login with your credentials and click on the Run tab to start a new imputation job. The submission dialog allows you to specify the properties of your imputation job.

The following options are available:

"},{"location":"getting-started/#reference-panel","title":"Reference Panel","text":"

Our server offers genotype imputation from different reference panels. The most accurate and largest panel is HRC (Version r1.1 2016). Please select one that fulfills your needs and supports the population of your input data:

  • HRC (Version r1.1 2016)
  • HLA Imputation Panel: two-field (four-digit) and G-group resolution
  • HRC (Version r1 2015)
  • 1000 Genomes Phase 3 (Version 5)
  • 1000 Genomes Phase 1 (Version 3)
  • CAAPA - African American Panel
  • HapMap 2

More details about all available reference panels can be found here.

"},{"location":"getting-started/#upload-vcf-files-from-your-computer","title":"Upload VCF files from your computer","text":"

When using the file upload, data is uploaded from your local file system to Michigan Imputation Server. By clicking on Select Files an open dialog appears where you can select your VCF files:

Multiple files can be selected using the ctrl, cmd or shift keys, depending on your operating system. After you have confirmed your choice, all selected files are listed in the submission dialog:

Please make sure that all files fulfill the requirements.

Important

Since version 1.7.2 URL-based uploads (sftp and http) are no longer supported. Please use direct file uploads instead.

"},{"location":"getting-started/#build","title":"Build","text":"

Please select the build of your data. Currently the options hg19 and hg38 are supported. Michigan Imputation Server automatically updates the genome positions (liftOver) of your data. All reference panels except TOPMed are based on hg19 coordinates.

"},{"location":"getting-started/#rsq-filter","title":"rsq Filter","text":"

To minimize the file size, Michigan Imputation Server includes a r2 filter option, excluding all imputed SNPs with a r2-value (= imputation quality) smaller then the specified value.

"},{"location":"getting-started/#phasing","title":"Phasing","text":"

If your uploaded data is unphased, Eagle v2.4 will be used for phasing. In case your uploaded VCF file already contains phased genotypes, please select the \"No phasing\" option.

Algorithm Description Eagle v2.4 The Eagle algorithm estimates haplotype phase using the HRC reference panel. This method is also suitable for single sample imputation. After phasing or imputation you will receive phased genotypes in your VCF files."},{"location":"getting-started/#population","title":"Population","text":"

Please select the population of your uploaded samples. This information is used to compare the allele frequencies between your data and the reference panel. Please note that not every reference panel supports all sub-populations.

Population Supported Reference Panels AFR all AMR all EUR all Mixed all AA CAAPA ASN 1000 Genomes Phase 1 (Version 3) EAS 1000 Genomes Phase 3 (Version 5) SAS 1000 Genomes Phase 3 (Version 5)

In case your population is not listed or your samples are from different populations, please select Mixed to skip the allele frequency check. For mixed populations, no QC-Report will be created.

"},{"location":"getting-started/#mode","title":"Mode","text":"

Please select if you want to run Quality Control & Imputation, Quality Control & Phasing Only or Quality Control Only.

"},{"location":"getting-started/#aes-256-encryption","title":"AES 256 encryption","text":"

All Imputation Server results are encrypted by default. Please tick this checkbox if you want to use AES 256 encryption instead of the default encryption method. Please note that AES encryption does not work with standard unzip programs. We recommend to use 7z instead.

"},{"location":"getting-started/#start-your-imputation-job","title":"Start your imputation job","text":"

After confirming our Terms of Service, the imputation process can be started immediately by clicking on Start Imputation. Input Validation and Quality Control are executed immediately to give you feedback about the data-format and its quality. If your data passed this steps, your job is added to our imputation queue and will be processed as soon as possible. You can check the position in the queue on the job summary page.

We notify you by email as soon as the job is finished or your data don't pass the Quality Control steps.

"},{"location":"getting-started/#input-validation","title":"Input Validation","text":"

In a first step we check if your uploaded files are valid and we calculate some basic statistics such as amount of samples, chromosomes and SNPs.

After Input Validation has finished, basic statistics can be viewed directly in the web interface.

If you encounter problems with your data please read this tutorial about Data Preparation to ensure your data is in the correct format.

"},{"location":"getting-started/#quality-control","title":"Quality Control","text":"

In this step we check each variant and exclude it in case of:

  1. contains invalid alleles
  2. duplicates
  3. indels
  4. monomorphic sites
  5. allele mismatch between reference panel and uploaded data
  6. SNP call rate < 90%

All filtered variants are listed in a file called statistics.txt which can be downloaded by clicking on the provided link. More informations about our QC pipeline can be found here.

If you selected a population, we compare the allele frequencies of the uploaded data with those from the reference panel. The result of this check is available in the QC report and can be downloaded by clicking on qcreport.html.

"},{"location":"getting-started/#pre-phasing-and-imputation","title":"Pre-phasing and Imputation","text":"

Imputation is achieved with Minimac4. The progress of all uploaded chromosomes is updated in real time and visualized with different colors.

"},{"location":"getting-started/#data-compression-and-encryption","title":"Data Compression and Encryption","text":"

If imputation was successful, we compress and encrypt your data and send you a random password via mail.

This password is not stored on our server at any time. Therefore, if you lost the password, there is no way to resend it to you.

"},{"location":"getting-started/#download-results","title":"Download results","text":"

The user is notified by email, as soon as the imputation job has finished. A zip archive including the results can be downloaded directly from the server. To decrypt the results, a one-time password is generated by the server and included in the email. The QC report and filter statistics can be displayed and downloaded as well.

All data is deleted automatically after 7 days

Be sure to download all needed data in this time period. We send you a reminder 48 hours before we delete your data. Once your job hast the state retired, we are not able to recover your data!

"},{"location":"getting-started/#download-via-a-web-browser","title":"Download via a web browser","text":"

All results can be downloaded directly via your browser by clicking on the filename.

In order to download results via the commandline using wgetor aria2 you need to click on the share symbol (located right to the file size) to get the needed private links.

A new dialog appears which provides you the private link. Click on the tab wget command to get a copy & paste ready command that can be used on Linux or MacOS to download the file in you terminal:

"},{"location":"getting-started/#download-all-results-at-once","title":"Download all results at once","text":"

To download all files of a folder (for example folder Imputation Results) you can click on the share symbol of the folder:

A new dialog appears which provides you all private links at once. Click on the tab wget commands to get copy & paste ready commands that can be used on Linux or MacOS to download all files.

"},{"location":"pipeline/","title":"Pipeline Overview","text":"

Our pipeline performs the following steps:

"},{"location":"pipeline/#quality-control","title":"Quality Control","text":"
  • Create chunks with a size of 20 Mb
  • For each 20Mb chunk we perform the following checks:

    On Chunk level:

    • Determine amount of valid variants: A variant is valid iff it is included in the reference panel. At least 3 variants must be included.
    • Determine amount of variants found in the reference panel: At least 50 % of the variants must be be included in the reference panel.
    • Determine sample call rate: At least 50 % of the variants must be called for each sample.

    Chunk exclusion: if (#variants < 3 || overlap < 50% || sampleCallRate < 50%)

    On Variant level:

    • Check alleles: Only A,C,G,T are allowed
    • Calculate alternative allele frequency (AF): Mark all with a AF > 0.5.
    • Calculate SNP call rate
    • Calculate chi square for each variant (reference panel vs. study data)
    • Determine allele switches: Compare ref and alt of reference panel with study data (A/T and C/G variants are ignored).
    • Determine strand flips: After eliminating possible allele switches, flip and compare ref/alt from reference panel with study data.
    • Determine allele switches in combination with strand flips: Combine the two rules from above.

    Variant exclusion: Variants are excluded in case of: [a] invalid alleles occur (!(A,C,G,T)), [b] duplicates (DUP filter or (pos - 1 == pos)), [c] indels, [d] monomorphic sites, [e] allele mismatch between reference panel and study, [f] SNP call rate < 90%.

    On Sample level:

    • For chr1-22, a chunk is excluded if one sample has a call rate < 50 %. Only complete chunks are excluded, not samples (see \"On Chunk level\" above)
  • Perform a liftOver step, if build of input data and reference panel does not match (b37 vs b38).

"},{"location":"pipeline/#phasing","title":"Phasing","text":"
  • Execute for each chunk one of the following phasing algorithms (we use an overlap of 5 Mb). For example, chr20:1-20000000 and reference population EUR:

Eagle2

./eagle --vcfRef HRC.r1-1.GRCh37.chr20.shapeit3.mac5.aa.genotypes.bcf\n--vcfTarget chunk_20_0000000001_0020000000.vcf.gz  --geneticMapFile genetic_map_chr20_combined_b37.txt\n--outPrefix chunk_20_0000000001_0020000000.phased --bpStart 1 --bpEnd 25000000 --allowRefAltSwap\n--vcfOutFormat z\n

Please note: Target-only sites for unphased data are not included in the final output.

"},{"location":"pipeline/#imputation","title":"Imputation","text":""},{"location":"pipeline/#_1","title":"Pipeline Overview","text":"
  • Execute for each chunk minimac in order to impute the phased data (we use a window of 500 kb):

./Minimac4 --refHaps HRC.r1-1.GRCh37.chr1.shapeit3.mac5.aa.genotypes.m3vcf.gz\n--haps chunk_1_0000000001_0020000000.phased.vcf --start 1 --end 20000000\n--window 500000 --prefix chunk_1_0000000001_0020000000 --cpus 1 --chr 20 --noPhoneHome\n--format GT,DS,GP --allTypedSites --meta --minRatio 0.00001\n
If a map file is available (currently TOPMed only), the following cmd is executed:

./Minimac4 --refHaps HRC.r1-1.GRCh38.chr1.shapeit3.mac5.aa.genotypes.m3vcf.gz\n--haps chunk_1_0000000001_0020000000.phased.vcf --start 1 --end 20000000\n--window 500000 --prefix chunk_1_0000000001_0020000000 --cpus 1 --chr 20 --noPhoneHome\n--format GT,DS,GP --allTypedSites --meta --minRatio 0.00001 --referenceEstimates --map B38_MAP_FILE.map\n
"},{"location":"pipeline/#hla-imputation-pipeline","title":"HLA Imputation Pipeline","text":"

In addition to intergenic SNPs, HLA imputation outputs five different types of markers: (1) binary marker for classical HLA alleles; (2) binary marker for the presence/absence of a specific amino acid residue; (3) HLA intragenic SNPs, and (4) binary markers for insertion/deletions, as described in the typical output below. The goal is to minimize prior assumption on which types of variations will be causal and test all types of variations simultaneously in an unbiased fashion. However, the users are always free to restrict analyses to specific marker subsets.

Note

For binary encodings, A = Absent, T = Present.

Type Format Example Classical HLA alleles HLA_[GENE]*[ALLELE] HLA_A*01:02 (two-field allele) HLA_A*02 (one-field allele) HLA amino acids AA_[GENE]_[AMINO ACID POSITION]_[GENOMIC POSITION]_[EXON]_[RESIDUE] AA_B_97_31324201_exon3_V (amino acid position 97 in HLA-B, genomic position 31324201 (GrCh37) in exon 3, residue = V (Val) ) HLA intragenic SNPs SNPS_[GENE]_[GENE POSITION]_[GENOMIC POSITION]_[EXON/INTRON] SNPS_C_2666_31237183_intron6 (SNP at position 2666 of the gene body, genomic position 31237183 in intron 6) Insertions/deletions INDEL_[TYPE]_[GENE]_[POSITION] INDEL_AA_C_300x301_31237792 Indel between amino acids 300 and 301 in HLA-C, at genomic position 31237792)

We note that our current implementation of the reference panel is limited to the G-group resolution (DNA sequences that determine the exons 2 and 3 for class I and exon 2 for class II genes), and amino acid positions outside the binding groove were taken as its best approximation. When converting G-group alleles to the two-field resolution, we first approximated G-group alleles to their corresponding allele at the four-field resolution based on the ordered allele list in the distributed IPD-IMGT/HLA database (version 3.32.0). We explicitly include exonic information in the HLA-TAPAS output.

For more information about HLA imputation and help, please visit https://github.com/immunogenomics/HLA-TAPAS.

"},{"location":"pipeline/#compression-and-encryption","title":"Compression and Encryption","text":"
  • Merge all chunks of one chromosome into one single vcf.gz
  • Encrypt data with one-time password
"},{"location":"pipeline/#chromosome-x-pipeline","title":"Chromosome X Pipeline","text":"

Additionally to the standard QC, the following per-sample checks are executed for chrX:

  • Ploidy Check: Verifies if all variants in the nonPAR region are either haploid or diploid.
  • Mixed Genotypes Check: Verifies if the amount of mixed genotypes (e.g. 1/.) is < 10 %.

For phasing and imputation, chrX is split into three independent chunks (PAR1, nonPAR, PAR2). These splits are then automatically merged by Michigan Imputation Server and are returned as one complete chromosome X file. Only Eagle is supported.

"},{"location":"prepare-your-data/","title":"Data preparation","text":"

Michigan Imputation Server accepts VCF files compressed with bgzip. Please make sure the following requirements are met:

  • Create a separate vcf.gz file for each chromosome.
  • Variations must be sorted by genomic position.
  • GRCh37 or GRCh38 coordinates are required.

Note

Several *.vcf.gz files can be uploaded at once.

"},{"location":"prepare-your-data/#quality-control-for-hrc-1000g-and-caapa-imputation","title":"Quality Control for HRC, 1000G and CAAPA imputation","text":"

Will Rayner provides a great toolbox to prepare data: HRC or 1000G Pre-imputation Checks.

The main steps for HRC are:

"},{"location":"prepare-your-data/#download-tool-and-sites","title":"Download tool and sites","text":"
wget http://www.well.ox.ac.uk/~wrayner/tools/HRC-1000G-check-bim-v4.2.7.zip\nwget ftp://ngs.sanger.ac.uk/production/hrc/HRC.r1-1/HRC.r1-1.GRCh37.wgs.mac5.sites.tab.gz\n
"},{"location":"prepare-your-data/#convert-pedmap-to-bed","title":"Convert ped/map to bed","text":"
plink --file <input-file> --make-bed --out <output-file>\n
"},{"location":"prepare-your-data/#create-a-frequency-file","title":"Create a frequency file","text":"
plink --freq --bfile <input> --out <freq-file>\n
"},{"location":"prepare-your-data/#execute-script","title":"Execute script","text":"
perl HRC-1000G-check-bim.pl -b <bim file> -f <freq-file> -r HRC.r1-1.GRCh37.wgs.mac5.sites.tab -h\nsh Run-plink.sh\n
"},{"location":"prepare-your-data/#create-vcf-using-vcfcooker","title":"Create vcf using VcfCooker","text":"
vcfCooker --in-bfile <bim file> --ref <reference.fasta>  --out <output-vcf> --write-vcf\nbgzip <output-vcf>\n
"},{"location":"prepare-your-data/#additional-tools","title":"Additional Tools","text":""},{"location":"prepare-your-data/#convert-pedmap-files-to-vcf-files","title":"Convert ped/map files to VCF files","text":"

Several tools are available: plink2, BCFtools or VcfCooker.

plink --ped study_chr1.ped --map study_chr1.map --recode vcf --out study_chr1\n

Create a sorted vcf.gz file using BCFtools:

bcftools sort study_chr1.vcf -Oz -o study_chr1.vcf.gz\n
"},{"location":"prepare-your-data/#checkvcf","title":"CheckVCF","text":"

Use checkVCF to ensure that the VCF files are valid. checkVCF proposes \"Action Items\" (e.g. upload to sftp server), which can be ignored. Only the validity should be checked with this command.

checkVCF.py -r human_g1k_v37.fasta -o out mystudy_chr1.vcf.gz\n
"},{"location":"reference-panels/","title":"Reference Panels","text":"

Our server offers imputation from the following reference panels:

"},{"location":"reference-panels/#hrc-version-r11-2016","title":"HRC (Version r1.1 2016)","text":"

The HRC panel consists of 64,940 haplotypes of predominantly European ancestry.

Number of Samples 32,470 Sites (chr1-22) 39,635,008 Chromosomes 1-22, X Website http://www.haplotype-reference-consortium.org; HRC r1.1 Release Note"},{"location":"reference-panels/#1000-genomes-phase-3-version-5","title":"1000 Genomes Phase 3 (Version 5)","text":"

Phase 3 of the 1000 Genomes Project consists of 5,008 haplotypes from 26 populations across the world.

Number of Samples 2,504 Sites (chr1-22) 49,143,605 Chromosomes 1-22, X Website http://www.internationalgenome.org"},{"location":"reference-panels/#genome-asia-pilot-gasp","title":"Genome Asia Pilot - GAsP","text":"Number of Samples 1,654 Sites (chr1-22) 21,494,814 Chromosomes 1-22 Publication https://www.nature.com/articles/s41586-019-1793-z"},{"location":"reference-panels/#genome-asia-v2-gasp","title":"Genome Asia v2 - GAsP","text":"Number of Samples 6,461 Sites (chr1-22) - Chromosomes 1-22 Publication https://www.nature.com/articles/s41586-019-1793-z"},{"location":"reference-panels/#four-digit-multi-ethnic-hla-v1-2021","title":"Four-digit Multi-ethnic HLA v1 (2021)","text":"

The multi-ethnic HLA panel consists of 36,586 haplotypes of five global populations. We have released the panel at both two-field (four-digit) and G-group resolution.

Number of Samples 18,293 Sites (chr6) 56,310 (1,781 HLA alleles; 4,513 HLA amino acids; 10,924 SNPs within HLA; 39,092 scaffold SNPs) Chromosomes 6:28,000,000-34,000,000 Website https://github.com/immunogenomics/HLA-TAPAS/

Please cite this manuscript if you would like to include imputed results from the panel in your work:

Luo, Y., Kanai, M., Choi, W., Li, X., Yamamoto, K., Ogawa, K., Gutierrez-Arcelus, M., Gregersen, P. K., Stuart, P. E., Elder, J. T., Fellay, J., Carrington, M., Haas, D. W., Guo, X., Palmer, N. D., Chen, Y.-D. I., Rotter, J. I., Taylor, K. D., Rich, S., \u2026 Raychaudhuri, S. (2020). A high-resolution HLA reference panel capturing global population diversity enables multi-ethnic fine-mapping in HIV host response. https://doi.org/10.1101/2020.07.16.20155606

"},{"location":"reference-panels/#four-digit-multi-ethnic-hla-v2-2022","title":"Four-digit Multi-ethnic HLA v2 (2022)","text":"Number of Samples 20,349 Sites (chr6) 22,733 (570 HLA alleles; 3,449 HLA amino acids; 4,023 SNPs within HLA; 14,691 scaffold SNPs) Chromosomes 6:27,970,031-33,965,553 Website https://github.com/immunogenomics/HLA-TAPAS/"},{"location":"reference-panels/#multi-ethnic-hla-v2-details","title":"Multi-ethnic HLA v2 Details","text":"

Samples:

  • We added Japanese samples with HLA alleles called with deep target sequencing (n = 723; Hirata et al. Nat Genet. 2019).
  • Add Estonian biobank samples with IRB approval (n = 2,233; Mitt et al. Eur J Hum Genet. 2017).

HLA alleles:

  • We used gold-standard HLA allele calls (instead of inferred calls from whole genome sequencing) when possible.
  • We updated and recalled HLA alleles using HLA-LA (Dilthey et al. Bioinformatics. 2019) in Jackson Heart Study (n = 3,026).
  • We updated and recalled HLA alleles using HLA-LA in Estonian Biobank (n = 2,233).

Scaffold variants:

  • We added population-specific SNP variants which are common in one population but rare in the other populations when they are in 1KG and pass QC, by cross-cohort SNP imputation within the reference panel.
  • We removed all SNP variants that are not included in the commonly-used genotyping arrays.

Minimac4 options:

  • We optimized --probThreshold, --diffThreshold, --topThreshold parameters in minimac4. Optimized parameters are now used for all HLA panels.

Imputation results:

  • We output 2-digit and 4-digit-resolution HLA alleles. We do not output higher resolution HLA alleles in this version.
"},{"location":"reference-panels/#caapa-african-american-panel","title":"CAAPA - African American Panel","text":"

Whole genome sequences were available on 883 individuals from 19 case-control studies of asthma included in the Consortium on Asthma among African-ancestry Populations in the Americas (CAAPA) and were used to summarize the genomic contributions to individuals of African ancestry.

Number of Samples 883 Sites (chr1-22) 31,163,897 Chromosomes 1-22 Website http://www.caapa-project.org/. Further details can also be found here"},{"location":"reference-panels/#hrc-version-r1-2015","title":"HRC (Version r1 2015)","text":"

This HRC panel consists of 64,976 haplotypes of predominantly European ancestry.

Number of Samples 32,488 Sites (chr1-22) 39,741,659 Chromosomes 1-22, X Website http://www.haplotype-reference-consortium.org; HRC r1 Release Note"},{"location":"reference-panels/#1000-genomes-phase-1-version-3","title":"1000 Genomes Phase 1 (Version 3)","text":"Number of Samples 1,092 Sites (chr1-22) 28,975,367 Chromosomes 1-22, X Website http://www.internationalgenome.org"},{"location":"reference-panels/#hapmap-2","title":"HapMap 2","text":"Number of Samples 60 Sites (chr1-22) 2,542,916 Chromosomes 1-22 Website: http://www.hapmap.org"},{"location":"resources/","title":"Resources","text":""},{"location":"resources/#polygenic-risk-score-calculation","title":"Polygenic Risk Score calculation","text":"

Learn in this tutorial how to use the Imputation Server to calculate over 3,000 polygenic risk scores on the fly.

Learn more

"},{"location":"resources/#automate-job-submission-using-imputationbot","title":"Automate job submission using Imputationbot","text":"

Imputation Bot provides an automate way to submit new jobs and to download results.

Learn more

"},{"location":"resources/#automate-job-sumission-using-the-rest-api","title":"Automate job sumission using the REST API","text":"

The REST APIs provide programmatic ways to submit new jobs and to download data from Michigan Imputation Server. It identifies users using authentication tokens, responses are provided in JSON format.

Learn more

"},{"location":"resources/#build-your-own-imputationserver","title":"Build your own Imputationserver","text":"

All the core is open source. If you have interest to build and host your own Imputationserver, please follow the instrocution of the Imputationserver2 pipeline here.

"},{"location":"resources/#workshops","title":"Workshops","text":"
  • ASHG 2023
  • ASHG 2022
  • ASHG 2020
"},{"location":"pgs/faq/","title":"Frequently Asked Questions","text":""},{"location":"pgs/faq/#can-i-use-the-polygenic-score-calculation-extension-without-an-email-address","title":"Can I use the Polygenic Score Calculation extension without an email address?","text":"

Yes, the extension can also be used with a username without an email. However, without an email, notifications are not sent, and access to genotyped data may be limited.

"},{"location":"pgs/faq/#extending-expiration-date-or-reset-download-counter","title":"Extending expiration date or reset download counter","text":"

Your data is available for 7 days. In case you need an extension, please let us know.

"},{"location":"pgs/faq/#how-can-i-improve-the-download-speed","title":"How can I improve the download speed?","text":"

aria2 tries to utilize your maximum download bandwidth. Please keep in mind to raise the k parameter significantly (-k, --min-split-size=SIZE). You will otherwise hit the Michigan Imputation Server download limit for each file (thanks to Anthony Marcketta for point this out).

"},{"location":"pgs/faq/#can-i-download-all-results-at-once","title":"Can I download all results at once?","text":"

We provide wget command for all results. Please open the results tab. The last column in each row includes direct links to all files.

"},{"location":"pgs/faq/#can-i-perform-pgs-calculation-locally","title":"Can I perform PGS calculation locally?","text":"

Imputationserveris using a standalone tool called pgs-calc. It reads the imputed dosages from VCF files and uses them to calculate scores. It supports imputed genotypes from Michigan Imputation Server or TOPMed Imputation Server out of the box and score files from PGS Catalog or PRSWeb instances. In addition, own created score files containing chromosomal positions, both alleles and the effect size can be used easily. pgs-calc uses the chromosomal positions and alleles to find the corresponding dosages in genotype files, but provides also tools to resolve rsIDs in score files using dbSNP. Therefore, it can be applied to genotype files with variants that were not annotated with rsIDs. Moreover, the standalone version provides options to improve the coverage by using the provided proxy mapping file for Europeans or a custom population specific mapping file. pgs-calc is available at https://github.com/lukfor/pgs-calc.

"},{"location":"pgs/getting-started/","title":"Polygenic Score Calculation","text":"

We provide an easy to use and user-friendly web interface to apply thousands of published polygenic risk scores to imputed genotypes in an efficient way. By extending the popular Michigan Imputation Server the module integrates it seamless into the existing imputation workflow and enables users without knowledge in that field to take advantage of this method. The graphical report includes all meta-data about the scores in a single place and helps users to understand and screen thousands of scores in an easy and intuitive way.

An extensive quality control pipeline is executed automatically to detect and fix possible strand-flips and to filter out missing SNPs to prevent systematic errors (e.g. lower scores for individuals with missing or wrong aligned genetic data).

When incorporating the Polygenic Score Calculation extension in your research, please cite the following papers:

Forer L, Taliun D, LeFaive J, Smith AV, Boughton AP, Coassin S, Lamina C, Kronenberg F, Fuchsberger C, Sch\u00f6nherr S. Imputation Server PGS: an automated approach to calculate polygenic risk scores on imputation servers. Nucleic Acids Res. 2024 Jul 5;52(W1):W70-W77. doi: 10.1093/nar/gkae331. PMID: 38709879; PMCID: PMC11223871.

Samuel A. Lambert, Laurent Gil, Simon Jupp, Scott C. Ritchie, Yu Xu, Annalisa Buniello, Aoife McMahon, Gad Abraham, Michael Chapman, Helen Parkinson, John Danesh, Jacqueline A. L. MacArthur and Michael Inouye. The Polygenic Score Catalog as an open database for reproducibility and systematic evaluation. Nature Genetics. doi: 10.1038/s41588-021-00783-5 (2021).

"},{"location":"pgs/getting-started/#getting-started","title":"Getting started","text":"

To utilize the Polygenic Score Calculation extension on ImputationServer, you must first register for an account. An activation email will be sent to the provided address. Once your email address is verified, you can access the service at no cost.

Please note that the extension can also be used with a username without an email. However, without an email, notifications are not sent, and access to genotyped data may be limited.

No dataset at hand? No problem, download our example dataset to test the PGS extension: 50-samples.zip.

"},{"location":"pgs/getting-started/#setting-up-your-first-polygenic-score-calculation-job","title":"Setting up your first Polygenic Score Calculation job","text":"
  1. Log in with your credentials and navigate to the Run tab to initiate a new Polygenic Score Calculation job.
  2. Please click on \"Polygenic Score Calculation\" and the submission dialog appears.
  3. The submission dialog allows you to specify job properties.

The following options are available:

"},{"location":"pgs/getting-started/#reference-panel","title":"Reference Panel","text":"

Our PGS extension offers genotype imputation from different reference panels. The most accurate and largest panel is HRC (Version r1.1 2016). Please select one that fulfills your needs and supports the population of your input data:

  • HRC (Version r1.1 2016)
  • 1000 Genomes Phase 3 (Version 5)
  • 1000 Genomes Phase 1 (Version 3)
  • HapMap 2

More details about all available reference panels can be found here. If you are unsure which reference panel to use, the \"1000 Genomes Phase 3 (Version 5)\" reference panel is multi-ancestry and has high coverage with available scores. However, if your uploaded data is European only, the HRC reference panel could be the better choice, as it enables the imputation of rare European-specific variants.

"},{"location":"pgs/getting-started/#upload-vcf-files-from-your-computer","title":"Upload VCF files from your computer","text":"

When using the file upload, data is uploaded from your local file system to Michigan Imputation Server. By clicking on Select Files an open dialog appears where you can select your VCF files:

Multiple files can be selected using the ctrl, cmd or shift keys, depending on your operating system. After you have confirmed your choice, all selected files are listed in the submission dialog:

Please make sure that all files fulfill the requirements.

Important

Since version 1.7.2 URL-based uploads (sftp and http) are no longer supported. Please use direct file uploads instead.

"},{"location":"pgs/getting-started/#rsq-filter","title":"rsq Filter","text":"

The filter ensures that only variants with an imputation quality (rsq) greater than the specified value are included in the polygenic risk score calculation. Setting the value to 0 disables the filter. Default value: 0.3.

"},{"location":"pgs/getting-started/#build","title":"Build","text":"

Please select the build of your data. Currently the options hg19 and hg38 are supported. Michigan Imputation Server automatically updates the genome positions (liftOver) of your data. All reference panels are based on hg19 coordinates.

"},{"location":"pgs/getting-started/#scores-and-trait-category","title":"Scores and Trait Category","text":"

Choose the precomputed Polygenic Score repository relevant to your study from the available options. Based on the selected repository, different trait categories appear and can be selected (e.g. Cancer scores):

More details about all available PGS repositories can be found here.

"},{"location":"pgs/getting-started/#ancestry-estimation","title":"Ancestry Estimation","text":"

You can enable ancestry estimation by selecting a reference population used to classify your uploaded samples. Currently, we support a worldwide panel based on HGDP.

"},{"location":"pgs/getting-started/#start-polygenic-score-calculation","title":"Start Polygenic Score Calculation","text":"

After agreeing to the Terms of Service, initiate the calculation by clicking on Submit job. The system will perform Input Validation and Quality Control immediately. If your data passes these steps, the job is added to the queue for processing.

"},{"location":"pgs/getting-started/#monitoring-and-retrieving-results","title":"Monitoring and Retrieving Results","text":"
  • Input Validation: Verify the validity of your uploaded files and review basic statistics.
  • Quality Control: Examine the QC report and download statistics after the system filters variants based on various criteria.
  • Polygenic Score Calculation: Monitor the progress of the imputation and polygenic scores calculation in real time for each chromosome.
"},{"location":"pgs/getting-started/#downloading-results","title":"Downloading Results","text":"

Upon completion, you will be notified by email if you enter your address on registration. A zip archive containing results can be downloaded directly from the server.

Click on the filename to download results directly via a web-browser. For command line downloads, use the share symbol to obtain private links.

Important: All data is automatically deleted after 7 days. Download needed data within this timeframe. A reminder is sent 48 hours before data deletion.

"},{"location":"pgs/output-files/","title":"Output Files","text":"

The Polygenic Score Calculation Results CSV file provides Polygenic Score (PGS) values for different samples and associated identifiers. Users can leverage this CSV file to analyze and compare Polygenic Score values across different samples. The data facilitates the investigation of genetic associations and their impact on specific traits or conditions.

"},{"location":"pgs/output-files/#csv-format","title":"CSV Format","text":"

The CSV file consists of a header row and data rows:

"},{"location":"pgs/output-files/#header-row","title":"Header Row","text":"
  • sample: Represents the identifier for each sample.
  • PGS000001, PGS000002, PGS000003, ...: Columns representing different Polygenic Score values associated with the respective identifiers.
"},{"location":"pgs/output-files/#data-rows","title":"Data Rows","text":"
  • Each row corresponds to a sample and provides the following information:
    • sample: Identifier for the sample.
    • PGS000001, PGS000002, PGS000003, ...: Polygenic Score values associated with the respective identifiers for the given sample.
"},{"location":"pgs/output-files/#example","title":"Example","text":"

Here's an example row:

sample, PGS000001, PGS000002, PGS000003, ...\nsample1, -4.485780284301654, 4.119604924228042, 0.0, -4.485780284301654\n
  • sample1: Sample identifier.
    • -4.485780284301654: Polygenic Score value for PGS000001.
    • 4.119604924228042: Polygenic Score value for PGS000002.
    • 0.0: Polygenic Score value for PGS000003.

Note:

  • Polygenic Score values are provided as floating-point numbers.
  • The absence of values (e.g., 0.0) indicates a lack of Polygenic Score information for a particular identifier in a given sample.
"},{"location":"pgs/pipeline/","title":"Pipeline","text":""},{"location":"pgs/pipeline/#ancestry-estimation","title":"Ancestry estimation","text":"

We use LASER to perform principal components analysis (PCA) based on the genotypes of each sample and to place them into a reference PCA space which was constructed using a set of reference individuals [14]. We built reference coordinates based on 938 samples from the Human Genome Diversity Project (HGDP) [15] and labeled them by the ancestry categories proposed by the GWASCatalog [16] which are also used in PGS Catalog.

"},{"location":"pgs/reference-panels/","title":"Reference Panels for PGS Calculation","text":"

Our server offers PGS calculation from the following reference panels:

"},{"location":"pgs/reference-panels/#hrc-version-r11-2016","title":"HRC (Version r1.1 2016)","text":"

The HRC panel consists of 64,940 haplotypes of predominantly European ancestry.

Number of Samples 32,470 Sites (chr1-22) 39,635,008 Chromosomes 1-22, X Website http://www.haplotype-reference-consortium.org; HRC r1.1 Release Note"},{"location":"pgs/reference-panels/#1000-genomes-phase-3-version-5","title":"1000 Genomes Phase 3 (Version 5)","text":"

Phase 3 of the 1000 Genomes Project consists of 5,008 haplotypes from 26 populations across the world.

Number of Samples 2,504 Sites (chr1-22) 49,143,605 Chromosomes 1-22, X Website http://www.internationalgenome.org"},{"location":"pgs/reference-panels/#1000-genomes-phase-1-version-3","title":"1000 Genomes Phase 1 (Version 3)","text":"Number of Samples 1,092 Sites (chr1-22) 28,975,367 Chromosomes 1-22, X Website http://www.internationalgenome.org"},{"location":"pgs/reference-panels/#hapmap-2","title":"HapMap 2","text":"Number of Samples 60 Sites (chr1-22) 2,542,916 Chromosomes 1-22 Website: http://www.hapmap.org"},{"location":"pgs/report/","title":"Interactive Report","text":"

The created report contains a list of all scores, where each score has a different color based on its coverage. The color green indicates that the coverage is very high and nearly all SNPs from the score were also found in the imputed dataset. The color red indicates that very few SNPs were found and the coverage is therefore low.

In addition, the report includes detailed metadata for each score such as the number of variants, the number of well-imputed genotypes and the population used to construct the score. A direct link to PGS Catalog, Cancer PRSWeb or ExPRSWeb is also available for further investigation (e.g. for getting information about the method that was used to construct the score). Further, the report displays the distribution of the scores of all uploaded samples and can be interactively explored. This allows users to detect samples with either a high or low risk immediately.

Moreover, the report gives an overview of all estimated ancestries from the uploaded genotypes and compares them with the populations of the GWAS that was used to create the score.

If an uploaded sample with an unsupported population is detected, a warning message is provided and the sample is excluded from the summary statistics.

"},{"location":"pgs/scores/","title":"Scores","text":"

We support currently the following PGS repositories out of the box:

"},{"location":"pgs/scores/#pgs-catalog","title":"PGS-Catalog","text":"

We use PGS Catalog as the source of scores for PGS Server (version 19. Jan 2023). the PGS Catalog is an online database that collects and annotates published scores and currently provides access to over 3,900 scores encompassing more than 580 traits.

Samuel A. Lambert, Laurent Gil, Simon Jupp, Scott C. Ritchie, Yu Xu, Annalisa Buniello, Aoife McMahon, Gad Abraham, Michael Chapman, Helen Parkinson, John Danesh, Jacqueline A. L. MacArthur and Michael Inouye. The Polygenic Score Catalog as an open database for reproducibility and systematic evaluation. Nature Genetics. doi: 10.1038/s41588-021-00783-5 (2021).

"},{"location":"pgs/scores/#cancer-prsweb","title":"Cancer-PRSweb","text":"

Collection of scores for major cancer traits.

Fritsche LG, Patil S, Beesley LJ, VandeHaar P, Salvatore M, Ma Y, Peng RB, Taliun D, Zhou X, Mukherjee B: Cancer PRSweb: An Online Repository with Polygenic Risk Scores for Major Cancer Traits and Their Evaluation in Two Independent Biobanks. Am J Hum Genet 2020, 107(5):815-836.

"},{"location":"pgs/scores/#exprsweb","title":"ExPRSweb","text":"

Collection of scores for common health-related exposures like body mass index or alcohol consumption.

Ma Y, Patil S, Zhou X, Mukherjee B, Fritsche LG: ExPRSweb: An online repository with polygenic risk scores for common health-related exposures. Am J Hum Genet 2022, 109(10):1742-1760.

"},{"location":"pgs/tutorial/","title":"Testing Imputationserver PGS: Step by Step","text":"

To test Imputationserver PGS, please execute the following steps:

0. Signup and create a login:

Imputationserver PGS requires a login to access the Polygenic Risk Score (PGS) calculation service. This login is crucial to maintain the security and privacy of any uploaded human genotype data.

Users have the flexibility to create this login either with or without providing an email address. Please visit the signup page and proceed to create a login.

1. Download the Example Dataset: Start by downloading the example dataset provided for testing the PGS extension. You can obtain the dataset by clicking on the following link: 50-samples.zip.

2. Unpack the Data: After downloading the zip file, unzip or extract its contents to a location of your choice on your computer.

3. Access Polygenic Risk Score Application: Navigate to the \"Run\" menu and select \"Polygenic Risk Score\" from the options.

4. Choose 1000 Genomes Phase 3 Panel: In the Polygenic Risk Score application, select the \"1000 Genomes Phase 3\" panel as the reference dataset for imputation.

5. Specify PGS Catalog and Trait: Identify and specify the Polygenic Score (PGS) Catalog you want to use for scoring. Choose a relevant trait for the analysis, such as \"Cancer\".

6. Optional Ancestry Estimation: Optionally, you can choose to include ancestry estimation in your analysis. This step may enhance the precision and interpreation of the results.

7. Agree to Terms of Service: Before proceeding, make sure to read and agree to the Terms of Service provided by Imputationserver. It is essential to comply with the platform's terms and conditions.

8. Submit the Job: After configuring all the necessary parameters, click on the \"Submit\" button to initiate the PGS calculation.

9. Monitor Progress: Depending on the server load, the calculation may take a certain amount of time (about 30 minutes). Allow the process to complete.

10. Download Results: Once the calculation is finished, you can view the results provided by Imputationserver PGS and download a report and all calcuated scores.

Congratulations! You have successfully tested Imputationserver PGS using the provided example dataset and configuration settings. Now you are ready to use the service with yout own dataset!

"},{"location":"tutorials/api/","title":"API Reference","text":"

The REST APIs provide programmatic ways to submit new jobs and to download data from Michigan Imputation Server. It identifies users using authentication tokens, responses are provided in JSON format.

"},{"location":"tutorials/api/#authentication","title":"Authentication","text":"

Michigan Imputation Server uses a token-based authentication. The token is required for all future interaction with the server. The token can be created and downloaded from your user profile (username -> Profile):

For security reasons, Api Tokens are valid for 30 days. You can check the status in the web interface.

"},{"location":"tutorials/api/#job-submission-for-whole-genome-imputation","title":"Job Submission for Whole Genome Imputation","text":"

The API allows to submit imputation jobs and to set several parameters. For HLA imputation, please see below.

"},{"location":"tutorials/api/#post-jobssubmitminimac4","title":"POST /jobs/submit/minimac4","text":"

The following parameters can be set:

Parameter Values Default Value Required files /path/to/file x mode qconly phasing imputation imputation password user-defined password auto generated and send by mail refpanel hrc-r1.1 1000g-phase-3-v5 gasp-v2 genome-asia-panel 1000g-phase-1 cappa hapmap-2 - x phasing eagle no_phasing eagle population eur afr asn amr sas eas AA mixed all - x build hg19 hg38 hg19 r2Filter 0 0.001 0.1 0.2 0.3 0"},{"location":"tutorials/api/#job-submission-for-hla-imputation","title":"Job Submission for HLA Imputation","text":"

The API also allows to submit imputation jobs using the HLA application. Please note, that the population parameter can be skipped here.

"},{"location":"tutorials/api/#post-jobssubmitimputationserver-hla","title":"POST /jobs/submit/imputationserver-hla","text":"

The following parameters can be set:

Parameter Values Default Value Required files /path/to/file x mode qconly phasing imputation imputation password user-defined password auto generated and send by mail refpanel multiethnic-hla-panel-Ggroup multiethnic-hla-panel-4digit - x phasing eagle no_phasing eagle build hg19 hg38 hg19 r2Filter 0 0.001 0.1 0.2 0.3 0"},{"location":"tutorials/api/#examples-curl","title":"Examples: curl","text":""},{"location":"tutorials/api/#submit-a-single-file","title":"Submit a single file","text":"

To submit a job please change /path-to/file.vcf.gz to a valid vcf file and update TOKEN with your API Token:

Command:

TOKEN=\"YOUR-API-TOKEN\";\n\ncurl https://imputationserver.sph.umich.edu/api/v2/jobs/submit/minimac4 \\\n  -H \"X-Auth-Token: $TOKEN\" \\\n  -F \"files=@/path-to/file.vcf.gz\" \\\n  -F \"refpanel=1000g-phase-3-v5\" \\\n  -F \"population=eur\"\n

Response:

{\n  \"id\":\"job-20160504-161420\",\n  \"message\":\"Your job was successfully added to the job queue.\",\n  \"success\":true\n}\n
"},{"location":"tutorials/api/#submit-multiple-files","title":"Submit multiple files","text":"

Submits multiple vcf files and impute against 1000 Genomes Phase 3 reference panel.

Command:

TOKEN=\"YOUR-API-TOKEN\";\n\ncurl https://imputationserver.sph.umich.edu/api/v2/jobs/submit/minimac4 \\\n  -H \"X-Auth-Token: $TOKEN\" \\\n  -F \"files=@/path-to/file1.vcf.gz\" \\\n  -F \"files=@/path-to/file2.vcf.gz\" \\\n  -F \"refpanel=1000g-phase-3-v5\" \\\n  -F \"population=eur\"\n

Response:

{\n  \"id\":\"job-20120504-155023\",\n  \"message\":\"Your job was successfully added to the job queue.\",\n  \"success\":true\n}\n
"},{"location":"tutorials/api/#submit-file-from-a-https","title":"Submit file from a HTTP(S)","text":"

Submits files from https with HRC reference panel and quality control.

Command:

TOKEN=\"YOUR-API-TOKEN\";\n\ncurl  https://imputationserver.sph.umich.edu/api/v2/jobs/submit/minimac4 \\\n  -H \"X-Auth-Token: $TOKEN\" \\\n  -F \"files=https://imputationserver.sph.umich.edu/static/downloads/hapmap300.chr1.recode.vcf.gz\" \\\n  -F \"files-source=http\" \\\n  -F \"refpanel=hrc-r1.1\" \\\n  -F \"population=eur\" \\\n  -F \"mode=qconly\"\n

Response:

{\n  \"id\":\"job-20120504-155023\",\n  \"message\":\"Your job was successfully added to the job queue.\",\n  \"success\":true\n}\n
"},{"location":"tutorials/api/#examples-python","title":"Examples: Python","text":""},{"location":"tutorials/api/#submit-single-vcf-file","title":"Submit single vcf file","text":"
import requests\nimport json\n\n# imputation server url\nurl = 'https://imputationserver.sph.umich.edu/api/v2'\ntoken = 'YOUR-API-TOKEN';\n\n# add token to header (see Authentication)\nheaders = {'X-Auth-Token' : token }\ndata = {\n  'refpanel': '1000g-phase-3-v5',\n  'population': 'eur'\n}\n\n# submit new job\nvcf = '/path/to/genome.vcf.gz';\nfiles = {'files' : open(vcf, 'rb')}\nr = requests.post(url + \"/jobs/submit/minimac4\", files=files, data=data, headers=headers)\nif r.status_code != 200:\n  print(r.json()['message'])\n  raise Exception('POST /jobs/submit/minimac4 {}'.format(r.status_code))\n\n# print response and job id\nprint(r.json()['message'])\nprint(r.json()['id'])\n
"},{"location":"tutorials/api/#submit-multiple-vcf-files","title":"Submit multiple vcf files","text":"
import requests\nimport json\n\n# imputation server url\nurl = 'https://imputationserver.sph.umich.edu/api/v2'\ntoken = 'YOUR-API-TOKEN';\n\n# add token to header (see Authentication)\nheaders = {'X-Auth-Token' : token }\ndata = {\n  'refpanel': '1000g-phase-3-v5',\n  'population': 'eur'\n}\n\n# submit new job\nvcf = '/path/to/file1.vcf.gz';\nvcf1 = '/path/to/file2.vcf.gz';\nfiles = [('files', open(vcf, 'rb')), ('files', open(vcf1, 'rb'))]\nr = requests.post(url + \"/jobs/submit/minimac4\", files=files, data=data, headers=headers)\nif r.status_code != 200:\n  print(r.json()['message'])\n  raise Exception('POST /jobs/submit/minimac4 {}'.format(r.status_code))\n\n# print message\nprint(r.json()['message'])\nprint(r.json()['id'])\n
"},{"location":"tutorials/api/#list-all-jobs","title":"List all jobs","text":"

All running jobs can be returned as JSON objects at once.

"},{"location":"tutorials/api/#get-jobs","title":"GET /jobs","text":""},{"location":"tutorials/api/#examples-curl_1","title":"Examples: curl","text":"

Command:

TOKEN=\"YOUR-API-TOKEN\";\n\ncurl -H \"X-Auth-Token: $TOKEN\" https://imputationserver.sph.umich.edu/api/v2/jobs\n

Response:

[\n  {\n    \"applicationId\":\"minimac\",\n    \"executionTime\":0,\n    \"id\":\"job-20160504-155023\",\n    \"name\":\"job-20160504-155023\",\n    \"positionInQueue\":0,\n    \"running\":false,\n    \"state\":5\n  },{\n    \"applicationId\":\"minimac\",\n    \"executionTime\":0,\n    \"id\":\"job-20160420-145809\",\n    \"name\":\"job-20160420-145809\",\n    \"positionInQueue\":0,\n    \"running\":false,\n    \"state\":5\n  },{\n    \"applicationId\":\"minimac\",\n    \"executionTime\":0,\n    \"id\":\"job-20160420-145756\",\n    \"name\":\"job-20160420-145756\",\n    \"positionInQueue\":0,\n    \"running\":false,\n    \"state\":5\n  }\n]\n
"},{"location":"tutorials/api/#example-python","title":"Example: Python","text":"
import requests\nimport json\n\n# imputation server url\nurl = 'https://imputationserver.sph.umich.edu/api/v2'\ntoken = 'YOUR-API-TOKEN';\n\n# add token to header (see authentication)\nheaders = {'X-Auth-Token' : token }\n\n# get all jobs\nr = requests.get(url + \"/jobs\", headers=headers)\nif r.status_code != 200:\n    raise Exception('GET /jobs/ {}'.format(r.status_code))\n\n# print all jobs\nfor job in r.json():\n    print('{} [{}]'.format(job['id'], job['state']))\n
"},{"location":"tutorials/api/#monitor-job-status","title":"Monitor Job Status","text":""},{"location":"tutorials/api/#jobsidstatus","title":"/jobs/{id}/status","text":""},{"location":"tutorials/api/#example-curl","title":"Example: curl","text":"

Command:

TOKEN=\"YOUR-API-TOKEN\";\n\ncurl -H \"X-Auth-Token: $TOKEN\" https://imputationserver.sph.umich.edu/api/v2/jobs/job-20160504-155023/status\n

Response:

{\n  \"application\":\"Michigan Imputation Server (Minimac4) 1.5.8\",\n  \"applicationId\":\"minimac4\",\n  \"deletedOn\":-1,\n  \"endTime\":1462369824173,\n  \"executionTime\":0,\n  \"id\":\"job-20160504-155023\",\n  \"logs\":\"\",\n  \"name\":\"job-20160504-155023\",\n  \"outputParams\":[],\n  \"positionInQueue\":0,\n  \"running\":false,\n  \"startTime\":1462369824173,\n  \"state\":5\n  ,\"steps\":[]\n}\n
"},{"location":"tutorials/api/#monitor-job-details","title":"Monitor Job Details","text":""},{"location":"tutorials/api/#jobsid","title":"/jobs/{id}","text":""},{"location":"tutorials/api/#example-curl_1","title":"Example: curl","text":"
TOKEN=\"YOUR-API-TOKEN\";\n\ncurl -H \"X-Auth-Token: $TOKEN\" https://imputationserver.sph.umich.edu/api/v2/jobs/job-20160504-155023/\n
"},{"location":"tutorials/imputationbot/","title":"Imputation Bot Tutorial","text":""},{"location":"tutorials/imputationbot/#requirements","title":"Requirements","text":"

You will need the following things properly installed on your computer.

  • Java 8 or higher
"},{"location":"tutorials/imputationbot/#download-and-install","title":"Download and Install","text":"

Download and install the latest version from our download page using the following commands:

curl -sL imputationbot.now.sh | bash\n

Test the installation with the following command:

imputationbot version\n

The documentation is available at http://imputationbot.readthedocs.io.

"},{"location":"tutorials/imputationbot/#get-your-api-token","title":"Get your API Token","text":"

Enable API access from your Profile page.

  1. Login and click on your username and then profile:

  1. Click on Create API Token

  1. Copy your API Token and paste it when imputationbot add-instance ask for it.

Api Tokens are valid for 30 days. You can check the status in the web interface or with imputationbot instances

  1. Next, configure imputationbot with the following command:
imputationbot add-instance\n
Imputation Bot 0.8.3 \ud83e\udd16\nhttps://imputationserver.sph.umich.edu\n(c) 2019-2020 Lukas Forer, Sebastian Schoenherr and Christian Fuchsberger\nBuilt by lukas on 2020-09-01T11:31:10Z\n\nImputationserver Url [https://imputationserver.sph.umich.edu]:\nAPI Token [None]: eyJjdHkiOiJ0ZXh0XC9wbGFpbiIsImFsZyI6IkhTMjU2In0.eyJtYWlsIjoibHVrYXMuZm9yZXJAaS1tZWQuYWMuYXQiLCJleHBpcmUiOjE1NzMyMjkwNTY3NTEsIm5hbWUiOiJMdWthcyBGb3JlciIsImFwaSI6dHJ1ZSwidXNlcm5hbWUiOiJsdWtmb3IifQ.qY7iEM6ul-gJ0EuHmEUHRnoS5hZs7kD1HC95NFaxE9w\n
"},{"location":"tutorials/imputationbot/#run-imputation","title":"Run imputation","text":"

You can use the impute command to submit a job:

  • The --files parameter defines the location of our VCF file. If we plan to impute more than one file we can enter the path to a folder or separate multiple filenames by ,.
  • We can use the --refpanel parameter to specify the reference panel. For the 1000 Geneoms Phase 3 panel we use 1000g-phase-3-v5. If we are not sure what panels are provided by the server, we can use imputationbot refpanels to get a list of all reference panels and their supported populations.
  • For --population we use eur which stands for European

The complete command looks like this:

imputationbot impute --files /path/to/your.vcf.gz --refpanel 1000g-phase-3-v5 --population eur\n

After submission we get the URL where we can monitor the progress of our job.

"},{"location":"tutorials/imputationbot/#monitor-jobs","title":"Monitor Jobs","text":"

However, we can also use Imputation Bot to get a list all our jobs and their status:

imputationbot jobs\n

To get more details about our job, we can use the jobs command followed by the job ID:

imputationbot jobs job-XXXXXXXX-XXXXXX-XXX\n
"},{"location":"tutorials/imputationbot/#download-all-results","title":"Download all Results","text":"

We can use the download command to download all imputed genotypes and the QC report at once:

imputationbot download job-XXXXXXXX-XXXXXX-XXX\n

If the job is still running, Imputation Bot waits until the job is finished and starts automatically with the download.

You can provide Imputation Bot the password we sent you via email and it decrypts all files for you:

imputationbot download job-XXXXXXXX-XXXXXX-XXX --password MYPASSWORD\n
"},{"location":"tutorials/imputationbot/#documentation","title":"Documentation","text":"

The documentation is available at http://imputationbot.readthedocs.io.

"},{"location":"tutorials/imputationbot/#contact","title":"Contact","text":"

Feel free to contact us in case of any problems.

"},{"location":"workshops/ASHG2020/","title":"ASHG2020","text":"

Workshop ASHG2020

"},{"location":"workshops/ASHG2020/#the-michigan-imputation-server","title":"The Michigan Imputation Server","text":"

Data Preparation, Genotype Imputation, and Data Analysis

"},{"location":"workshops/ASHG2020/#for-questions","title":"For questions:","text":"
  • Please email us: mis-ashg2020@umich.edu
  • Slack channel: Slack sign-up
"},{"location":"workshops/ASHG2020/#workshop-facilitators","title":"Workshop facilitator(s)","text":"
  • Christian Fuchsberger, christian.fuchsberger@eurac.edu (Eurac Research)
  • Lukas Forer, lukas.forer@i-med.ac.at (Medical University of Innsbruck)
  • Sarah Hanks, schanks@umich.edu (University of Michigan)
  • Sebastian Schoenherr, sebastian.schoenherr@i-med.ac.at (Medical University of Innsbruck)
  • Albert Smith, albertvs@umich.edu (University of Michigan)
  • Cassie Spracklen, cspracklen@umass.edu (University of Massachusetts-Amherst)
"},{"location":"workshops/ASHG2020/#workshop-description-from-the-program","title":"Workshop description (from the program)","text":"

Genotype imputation is a key component of modern genetic studies. This interactive workshop is intended for anyone interested in learning how to use the Michigan Imputation Server (MIS; https://imputationserver.sph.umich.edu) to impute genotypes and how to use the imputed genotypes, with a special focus on up-coming reference panels, including the multi-ancestry panel from the TOPMed program. A brief overview of imputation and the server will be followed by demonstrations and exercises, including:

  1. quality control and preparation of genetic data for use on the MIS with a special focus on diverse ancestries and chromosome X
  2. tracking runs and use of the application program interface for larger jobs
  3. downloading data from the MIS and preparing data for genetic analysis
  4. performing a GWAS using imputed data and interpreting results, taking into account imputation quality

We encourage participants to ask specific questions about their own projects. Workshop materials, including slides and example data sets, will be made available before the workshop and will remain online at the MIS website. We expect that this workshop will enable participants to generate high-quality imputed data sets and to properly analyze them. Attendees are expected to follow materials on their personal laptops.

"},{"location":"workshops/ASHG2020/#intended-audience","title":"Intended Audience","text":"

Attendees interested in learning how to perform genotype imputation and use imputed genotypes in their research, especially trainees. Prior experience with the analysis of genome-wide association studies (GWAS) and the unix command line are recommended for the workshop.

"},{"location":"workshops/ASHG2022/","title":"ASHG2022","text":"

Workshop ASHG2022 - Genetics and Genomics Digital Forum

"},{"location":"workshops/ASHG2022/#the-michigan-imputation-server","title":"The Michigan Imputation Server","text":"

Data Preparation, Genotype Imputation, and Data Analysis

Workshop Website

"},{"location":"workshops/ASHG2022/#workshop-slides","title":"Workshop Slides","text":"

You can download the slides of all workshop sessions here. Please also have a look at the individual sessions below for additional training material.

"},{"location":"workshops/ASHG2022/#workshop-facilitators","title":"Workshop Facilitator(s)","text":"
  • Christian Fuchsberger, christian.fuchsberger@eurac.edu (Eurac Research)
  • Sebastian Sch\u00f6nherr, sebastian.schoenherr@i-med.ac.at (Medical University of Innsbruck)
  • Lukas Forer, lukas.forer@i-med.ac.at (Medical University of Innsbruck)
  • Xueling Sim, ephsx@nus.edu.sg (National University of Singapore)
  • Saori Sakaue, ssakaue@broadinstitute.org (Broad Institute)
  • Albert Smith, albertvs@umich.edu (University of Michigan)
"},{"location":"workshops/ASHG2022/#workshop-description-from-the-program","title":"Workshop Description (from the program)","text":"

Genotype imputation is a key component of modern genetic association studies. The Michigan Imputation Server has thus far helped > 9,600 researchers from around the world to impute > 95 human genomes. This interactive workshop is intended for anyone interested in learning how to impute genotypes and to use the imputed genotypes, highlighting recent reference panels, including the multi-ancestry panel from the TOPMed program and a specialized HLA panel.

A brief overview of imputation and the server will be followed by demonstrations and exercises, including:

  1. quality control and preparation of genetic data for use on the MIS with a special focus on diverse ancestries, chromosome X, and the HLA region;

  2. tracking runs and use of the application program interface for larger jobs;

  3. downloading data from the MIS and preparing data for genetic analysis;

  4. performing a GWAS using imputed data and interpreting results, taking into account imputation quality;

  5. using the additional features, such as the polygenic risk score calculation.

We encourage participants to ask specific questions about their own projects. Workshop materials, including slides and example data sets, will be made available before the workshop and will remain online at the MIS website. We expect that this workshop will enable participants to generate high-quality imputed data sets and to effectively analyze them.

"},{"location":"workshops/ASHG2023/","title":"ASHG2023","text":"

Workshop ASHG2023

"},{"location":"workshops/ASHG2023/#welcome-to-the-michigan-imputation-server-workshop","title":"Welcome to the Michigan Imputation Server Workshop!","text":""},{"location":"workshops/ASHG2023/#workshop-title","title":"Workshop Title","text":"

The Michigan Imputation Server: Data Preparation, Genotype Imputation, and Data Analysis

"},{"location":"workshops/ASHG2023/#topic","title":"Topic","text":"

Statistical Genetics and Genetic Epidemiology

"},{"location":"workshops/ASHG2023/#target-audience","title":"Target Audience","text":"

Attendees interested in learning how to perform genotype imputation and use imputed genotypes in their research, especially trainees. There are no prerequisites for this workshop. Attendees are expected to follow materials on their personal laptops.

"},{"location":"workshops/ASHG2023/#workshop-slides","title":"Workshop Slides","text":"

You can download the slides of all workshop sessions here. Please also have a look at the individual sessions below for additional training material.

"},{"location":"workshops/ASHG2023/#links","title":"Links","text":"
  • Interactive Poll
  • Workshop Website
"},{"location":"workshops/ASHG2023/#workshop-facilitators","title":"Workshop Facilitator(s)","text":"
  • Christian Fuchsberger, christian.fuchsberger@eurac.edu (Eurac Research)
  • Sebastian Sch\u00f6nherr, sebastian.schoenherr@i-med.ac.at (Medical University of Innsbruck)
  • Lukas Forer, lukas.forer@i-med.ac.at (Medical University of Innsbruck)
  • Xueling Sim, ephsx@nus.edu.sg (National University of Singapore)
  • Saori Sakaue, ssakaue@broadinstitute.org (Broad Institute)
  • Albert Smith, albertvs@umich.edu (University of Michigan)
"},{"location":"workshops/ASHG2020/Session1/","title":"Session1","text":"

Workshop ASHG2020 > Session 1: Imputation and the Server

"},{"location":"workshops/ASHG2020/Session1/#slides","title":"Slides","text":"

Download (pdf)

"},{"location":"workshops/ASHG2020/Session1/#links","title":"Links","text":"

Michigan Imputation Server

TOPMed Imputation Server

"},{"location":"workshops/ASHG2020/Session1/#selected-literature","title":"Selected Literature","text":"

Das S, Forer L, Sch\u00f6nherr S, Sidore C, Locke AE, Kwong A, Vrieze SI, Chew EY, Levy S, McGue M, Schlessinger D, Stambolian D, Loh PR, Iacono WG, Swaroop A, Scott LJ, Cucca F, Kronenberg F, Boehnke M, Abecasis GR, Fuchsberger C. Next-generation genotype imputation service and methods. Nat Genet. 2016 Oct;48(10):1284-1287. doi: 10.1038/ng.3656.

Das S, Abecasis GR, Browning BL. Genotype Imputation from Large Reference Panels. Annu Rev Genomics Hum Genet. 2018 Aug 31;19:73-96. doi: 10.1146/annurev-genom-083117-021602.

Fuchsberger C, Abecasis GR, Hinds DA. minimac2: faster genotype imputation. Bioinformatics. 2015 Mar 1;31(5):782-4. doi: 10.1093/bioinformatics/btu704. Epub 2014 Oct 22. PMID: 25338720; PMCID: PMC4341061.

Howie B, Fuchsberger C, Stephens M, Marchini J, Abecasis GR. Fast and accurate genotype imputation in genome-wide association studies through pre-phasing. Nat Genet. 2012 Jul 22;44(8):955-9. doi: 10.1038/ng.2354. PMID: 22820512; PMCID: PMC3696580.

"},{"location":"workshops/ASHG2020/Session2/","title":"Session2","text":"

Workshop ASHG2020 > Session 2: Run a job, Quality Control and Data Preparation

"},{"location":"workshops/ASHG2020/Session2/#welcome","title":"Welcome","text":"

Welcome to Session 2! In this session you will learn how to submit a job on Michigan Imputation Server (MIS) and how to prepare your input data that they are passing the QC step.

"},{"location":"workshops/ASHG2020/Session2/#download-slides","title":"Download Slides","text":"

If you want to access the slides from our workshop please click here: Session 2 Slides (pdf)

"},{"location":"workshops/ASHG2020/Session2/#tutorial","title":"Tutorial","text":""},{"location":"workshops/ASHG2020/Session2/#getting-started-video-demo","title":"Getting Started Video Demo","text":"

As a quick start, the following video includes all required steps to submit and monitor a job using the graphical web interface.

"},{"location":"workshops/ASHG2020/Session2/#run-a-job-on-your-own","title":"Run a job on your own","text":"

After you registered successfully, the following URL will bring you directly to the job submission page: https://imputationserver.sph.umich.edu/index.html#!run/minimac4

"},{"location":"workshops/ASHG2020/Session2/#submission-page-select-parameters","title":"Submission Page - Select parameters","text":"

The UI includes several parameters which need to be specified. Our Getting Started guide describes all required parameters to do so.

"},{"location":"workshops/ASHG2020/Session2/#submission-page-upload-data","title":"Submission Page - Upload data","text":"

We are providing two data datasets that can be downloaded from below. In case the unphased dataset is selected, an additional phasing step using Eagle is automatically performed. For this demo, we recommend seleting the HapMap 2 panel (Input parameter 'Reference panel') to get your results as quick as possible. Please also have a look at our supported reference panels when using MIS in a production setup.

Tip

You can also copy/paste the URL from below and change \"File Upload\" to \"URLs (HTTP)\" load the data from a remote server (GitHub in this case).

  • Phased dataset chr20 hg19
  • Unphased dataset chr20 hg19
"},{"location":"workshops/ASHG2020/Session2/#submission-page-submit","title":"Submission Page - Submit","text":"

After all parameters have been selected and you click 'submit', the job will be added to our Input Validation and QC queue. Please have a look at our Data Preparation Guide to learn how to prepare your dataset using a pre-imputation tool.

"},{"location":"workshops/ASHG2020/Session2/#monitor-jobs-download-data","title":"Monitor Jobs, Download Data","text":"

If the job passes the QC step, it will be added to our long-time queue. As soon as your job is finished, you will receive an email with the password to download and encrypt your data. Also checkout our Pipeline Overview Guide to learn more about the different internal parameters. The complete source code can also be found on GitHub.

"},{"location":"workshops/ASHG2020/Session2/#contact","title":"Contact","text":"

If you have any questions please write me an email or contact me on Twitter.

"},{"location":"workshops/ASHG2020/Session3/","title":"Session3","text":"

Workshop ASHG2020 > Session 3: Tracking runs and downloading data

"},{"location":"workshops/ASHG2020/Session3/#slides","title":"Slides","text":"

Learn how to monitor jobs and their progress, how to download imputation results and how to decrypt results using standard software.

Download (pdf)

"},{"location":"workshops/ASHG2020/Session4/","title":"Session4","text":"

Workshop ASHG2020 > Session 4: Performing GWAS using imputed data

"},{"location":"workshops/ASHG2020/Session4/#slides","title":"Slides","text":"

Download (pdf)

"},{"location":"workshops/ASHG2020/Session5/","title":"Session5","text":"

Workshop ASHG2020 > Session 5: Imputation Bot

"},{"location":"workshops/ASHG2020/Session5/#slides","title":"Slides","text":"

Learn how to use Imputation bot to automate job submission and interactions with imputation servers.

Download (pdf)

"},{"location":"workshops/ASHG2020/Session5/#tutorial","title":"Tutorial","text":""},{"location":"workshops/ASHG2020/Session5/#requirements","title":"Requirements","text":"

You will need the following things properly installed on your computer.

  • Java 8 or higher
"},{"location":"workshops/ASHG2020/Session5/#download-and-install","title":"Download and Install","text":"

Download and install the latest version from our download page using the following commands:

curl -sL imputationbot.now.sh | bash\n

Test the installation with the following command:

imputationbot version\n

The documentation is available at http://imputationbot.readthedocs.io.

"},{"location":"workshops/ASHG2020/Session5/#get-your-api-token","title":"Get your API Token","text":"

Enable API access from your Profile page.

  1. Login and click on your username and then profile:

  1. Click on Create API Token

  1. Copy your API Token and paste it when imputationbot add-instance ask for it.

Api Tokens are valid for 30 days. You can check the status in the web interface or with imputationbot instances

  1. Next, configure imputationbot with the following command:
imputationbot add-instance\n
Imputation Bot 0.8.3 \ud83e\udd16\nhttps://imputationserver.sph.umich.edu\n(c) 2019-2020 Lukas Forer, Sebastian Schoenherr and Christian Fuchsberger\nBuilt by lukas on 2020-09-01T11:31:10Z\n\nImputationserver Url [https://imputationserver.sph.umich.edu]:\nAPI Token [None]: eyJjdHkiOiJ0ZXh0XC9wbGFpbiIsImFsZyI6IkhTMjU2In0.eyJtYWlsIjoibHVrYXMuZm9yZXJAaS1tZWQuYWMuYXQiLCJleHBpcmUiOjE1NzMyMjkwNTY3NTEsIm5hbWUiOiJMdWthcyBGb3JlciIsImFwaSI6dHJ1ZSwidXNlcm5hbWUiOiJsdWtmb3IifQ.qY7iEM6ul-gJ0EuHmEUHRnoS5hZs7kD1HC95NFaxE9w\n
"},{"location":"workshops/ASHG2020/Session5/#run-imputation","title":"Run imputation","text":"

You can use the impute command to submit a job:

  • The --files parameter defines the location of our VCF file. If we plan to impute more than one file we can enter the path to a folder or separate multiple filenames by ,.
  • We can use the --refpanel parameter to specify the reference panel. For the 1000 Geneoms Phase 3 panel we use 1000g-phase-3-v5. If we are not sure what panels are provided by the server, we can use imputationbot refpanels to get a list of all reference panels and their supported populations.
  • For --population we use eur which stands for European

The complete command looks like this:

imputationbot impute --files /path/to/your.vcf.gz --refpanel 1000g-phase-3-v5 --population eur\n

After submission we get the URL where we can monitor the progress of our job.

"},{"location":"workshops/ASHG2020/Session5/#monitor-jobs","title":"Monitor Jobs","text":"

However, we can also use Imputation Bot to get a list all our jobs and their status:

imputationbot jobs\n

To get more details about our job, we can use the jobs command followed by the job ID:

imputationbot jobs job-XXXXXXXX-XXXXXX-XXX\n
"},{"location":"workshops/ASHG2020/Session5/#download-all-results","title":"Download all Results","text":"

We can use the download command to download all imputed genotypes and the QC report at once:

imputationbot download job-XXXXXXXX-XXXXXX-XXX\n

If the job is still running, Imputation Bot waits until the job is finished and starts automatically with the download.

You can provide Imputation Bot the password we sent you via email and it decrypts all files for you:

imputationbot download job-XXXXXXXX-XXXXXX-XXX --password MYPASSWORD\n
"},{"location":"workshops/ASHG2020/Session5/#documentation","title":"Documentation","text":"

The documentation is available at http://imputationbot.readthedocs.io.

"},{"location":"workshops/ASHG2020/Session5/#contact","title":"Contact","text":"

Feel free to contact us in case of any problems.

"},{"location":"workshops/ASHG2020/Session6/","title":"Session6","text":"

Workshop ASHG2020 > Session 6: The TOPMed Imputation Server

"},{"location":"workshops/ASHG2020/Session6/#slides","title":"Slides","text":"

Download (pdf)

"},{"location":"workshops/ASHG2020/Session7/","title":"Session7","text":"

Workshop ASHG2020 > Session 6: Session 7: Imputation panels

"},{"location":"workshops/ASHG2020/Session7/#slides","title":"Slides","text":"

Download (pdf)

"},{"location":"workshops/ASHG2022/Session1/","title":"Session1","text":"

Workshop ASHG2022 > Session 1: Imputation and the Server

"},{"location":"workshops/ASHG2022/Session1/#slides","title":"Slides","text":"

Download (pdf)

"},{"location":"workshops/ASHG2022/Session1/#server-links","title":"Server Links","text":"

Michigan Imputation Server

TOPMed Imputation Server

"},{"location":"workshops/ASHG2022/Session1/#selected-literature","title":"Selected Literature","text":"

Das S, Forer L, Sch\u00f6nherr S, Sidore C, Locke AE, Kwong A, Vrieze SI, Chew EY, Levy S, McGue M, Schlessinger D, Stambolian D, Loh PR, Iacono WG, Swaroop A, Scott LJ, Cucca F, Kronenberg F, Boehnke M, Abecasis GR, Fuchsberger C. Next-generation genotype imputation service and methods. Nat Genet. 2016 Oct;48(10):1284-1287. doi: 10.1038/ng.3656.

Das S, Abecasis GR, Browning BL. Genotype Imputation from Large Reference Panels. Annu Rev Genomics Hum Genet. 2018 Aug 31;19:73-96. doi: 10.1146/annurev-genom-083117-021602.

Fuchsberger C, Abecasis GR, Hinds DA. minimac2: faster genotype imputation. Bioinformatics. 2015 Mar 1;31(5):782-4. doi: 10.1093/bioinformatics/btu704. Epub 2014 Oct 22. PMID: 25338720; PMCID: PMC4341061.

Howie B, Fuchsberger C, Stephens M, Marchini J, Abecasis GR. Fast and accurate genotype imputation in genome-wide association studies through pre-phasing. Nat Genet. 2012 Jul 22;44(8):955-9. doi: 10.1038/ng.2354. PMID: 22820512; PMCID: PMC3696580.

"},{"location":"workshops/ASHG2022/Session2/","title":"Session2","text":"

Workshop ASHG2022 > Session 2: Run a job, Data Preparation and Data Download

"},{"location":"workshops/ASHG2022/Session2/#welcome","title":"Welcome","text":"

Welcome to Session 2! In this session you will learn how to submit a job on Michigan Imputation Server (MIS) and how to prepare your input data that they are passing the QC step.

"},{"location":"workshops/ASHG2022/Session2/#download-slides","title":"Download Slides","text":"

Download (pdf)

"},{"location":"workshops/ASHG2022/Session2/#tutorial","title":"Tutorial","text":""},{"location":"workshops/ASHG2022/Session2/#getting-started","title":"Getting Started","text":"

As a quick start, the following video includes all required steps to submit and monitor a job using the graphical web interface.

"},{"location":"workshops/ASHG2022/Session2/#run-a-job-on-your-own","title":"Run a job on your own","text":"

After you registered successfully, the following URL will bring you directly to the job submission page: https://imputationserver.sph.umich.edu/index.html#!run/minimac4

"},{"location":"workshops/ASHG2022/Session2/#submission-page-select-parameters","title":"Submission Page - Select parameters","text":"

The UI includes several parameters which need to be specified. Our Getting Started guide describes all required parameters to do so.

"},{"location":"workshops/ASHG2022/Session2/#submission-page-upload-data","title":"Submission Page - Upload data","text":"

We are providing two data datasets that can be downloaded from below. In case the unphased dataset is selected, an additional phasing step using Eagle is automatically performed. For this demo, we recommend selecting the HapMap 2 panel (Input parameter 'Reference panel') to get your results as quick as possible. Please also have a look at our supported reference panels when using MIS in a production setup.

Tip

You can also copy/paste the URL from below and change \"File Upload\" to \"URLs (HTTP)\" load the data from a remote server (GitHub in this case).

  • Phased dataset chr20 hg19
  • Unphased dataset chr20 hg19
"},{"location":"workshops/ASHG2022/Session2/#submission-page-submit","title":"Submission Page - Submit","text":"

After all parameters have been selected and you click 'submit', the job will be added to our Input Validation and QC queue. Please have a look at our Data Preparation Guide to learn how to prepare your dataset using a pre-imputation tool.

"},{"location":"workshops/ASHG2022/Session2/#monitor-jobs-download-data","title":"Monitor Jobs, Download Data","text":"

If the job passes the QC step, it will be added to our long-time queue. As soon as your job is finished, you will receive an email with the password to download and encrypt your data. Also checkout our Pipeline Overview Guide to learn more about the different internal parameters. The complete source code can also be found on GitHub.

"},{"location":"workshops/ASHG2022/Session2/#contact","title":"Contact","text":"

If you have any questions please write me an email or contact me on Twitter.

"},{"location":"workshops/ASHG2022/Session3/","title":"Session3","text":"

Workshop ASHG2022 > Session 3: Performing GWAS using imputed data

"},{"location":"workshops/ASHG2022/Session3/#slides","title":"Slides","text":"

Download (pdf)

"},{"location":"workshops/ASHG2022/Session4/","title":"Session4","text":"

Workshop ASHG2022 > Session 4: Imputation Bot and PGS Server

"},{"location":"workshops/ASHG2022/Session4/#slides","title":"Slides","text":"

Download (pdf)

"},{"location":"workshops/ASHG2022/Session4/#imputation-bot-tutorial","title":"Imputation Bot Tutorial","text":""},{"location":"workshops/ASHG2022/Session4/#requirements","title":"Requirements","text":"

You will need the following things properly installed on your computer.

  • Java 8 or higher
"},{"location":"workshops/ASHG2022/Session4/#download-and-install","title":"Download and Install","text":"

Download and install the latest version from our download page using the following commands:

curl -sL imputationbot.now.sh | bash\n

Test the installation with the following command:

imputationbot version\n

The documentation is available at http://imputationbot.readthedocs.io.

"},{"location":"workshops/ASHG2022/Session4/#get-your-api-token","title":"Get your API Token","text":"

Enable API access from your Profile page.

  1. Login and click on your username and then profile:

  1. Click on Create API Token

  1. Copy your API Token and paste it when imputationbot add-instance ask for it.

Api Tokens are valid for 30 days. You can check the status in the web interface or with imputationbot instances

  1. Next, configure imputationbot with the following command:
imputationbot add-instance\n
Imputation Bot 0.8.3 \ud83e\udd16\nhttps://imputationserver.sph.umich.edu\n(c) 2019-2020 Lukas Forer, Sebastian Schoenherr and Christian Fuchsberger\nBuilt by lukas on 2020-09-01T11:31:10Z\n\nImputationserver Url [https://imputationserver.sph.umich.edu]:\nAPI Token [None]: eyJjdHkiOiJ0ZXh0XC9wbGFpbiIsImFsZyI6IkhTMjU2In0.eyJtYWlsIjoibHVrYXMuZm9yZXJAaS1tZWQuYWMuYXQiLCJleHBpcmUiOjE1NzMyMjkwNTY3NTEsIm5hbWUiOiJMdWthcyBGb3JlciIsImFwaSI6dHJ1ZSwidXNlcm5hbWUiOiJsdWtmb3IifQ.qY7iEM6ul-gJ0EuHmEUHRnoS5hZs7kD1HC95NFaxE9w\n
"},{"location":"workshops/ASHG2022/Session4/#run-imputation","title":"Run imputation","text":"

You can use the impute command to submit a job:

  • The --files parameter defines the location of our VCF file. If we plan to impute more than one file we can enter the path to a folder or separate multiple filenames by ,.
  • We can use the --refpanel parameter to specify the reference panel. For the 1000 Geneoms Phase 3 panel we use 1000g-phase-3-v5. If we are not sure what panels are provided by the server, we can use imputationbot refpanels to get a list of all reference panels and their supported populations.
  • For --population we use eur which stands for European

The complete command looks like this:

imputationbot impute --files /path/to/your.vcf.gz --refpanel 1000g-phase-3-v5 --population eur\n

After submission we get the URL where we can monitor the progress of our job.

"},{"location":"workshops/ASHG2022/Session4/#monitor-jobs","title":"Monitor Jobs","text":"

However, we can also use Imputation Bot to get a list all our jobs and their status:

imputationbot jobs\n

To get more details about our job, we can use the jobs command followed by the job ID:

imputationbot jobs job-XXXXXXXX-XXXXXX-XXX\n
"},{"location":"workshops/ASHG2022/Session4/#download-all-results","title":"Download all Results","text":"

We can use the download command to download all imputed genotypes and the QC report at once:

imputationbot download job-XXXXXXXX-XXXXXX-XXX\n

If the job is still running, Imputation Bot waits until the job is finished and starts automatically with the download.

You can provide Imputation Bot the password we sent you via email and it decrypts all files for you:

imputationbot download job-XXXXXXXX-XXXXXX-XXX --password MYPASSWORD\n
"},{"location":"workshops/ASHG2022/Session4/#documentation","title":"Documentation","text":"

The documentation is available at http://imputationbot.readthedocs.io.

"},{"location":"workshops/ASHG2022/Session4/#contact","title":"Contact","text":"

Feel free to contact us in case of any problems.

"},{"location":"workshops/ASHG2022/Session5/","title":"Session5","text":"

Workshop ASHG2022 > Session 5: HLA Imputation

"},{"location":"workshops/ASHG2022/Session5/#slides","title":"Slides","text":"

Download (pdf)

"},{"location":"workshops/ASHG2022/Session6/","title":"Session6","text":"

Workshop ASHG2022 > Session 6: The TOPMed Imputation Server

"},{"location":"workshops/ASHG2022/Session6/#slides","title":"Slides","text":"

Download (pdf)

"},{"location":"workshops/ASHG2023/Session1/","title":"Session1","text":"

Workshop ASHG2023 > Session 1: Imputation and the Server

"},{"location":"workshops/ASHG2023/Session1/#server-links","title":"Server Links","text":"

Michigan Imputation Server

TOPMed Imputation Server

"},{"location":"workshops/ASHG2023/Session1/#selected-literature","title":"Selected Literature","text":"

Das S, Forer L, Sch\u00f6nherr S, Sidore C, Locke AE, Kwong A, Vrieze SI, Chew EY, Levy S, McGue M, Schlessinger D, Stambolian D, Loh PR, Iacono WG, Swaroop A, Scott LJ, Cucca F, Kronenberg F, Boehnke M, Abecasis GR, Fuchsberger C. Next-generation genotype imputation service and methods. Nat Genet. 2016 Oct;48(10):1284-1287. doi: 10.1038/ng.3656.

Das S, Abecasis GR, Browning BL. Genotype Imputation from Large Reference Panels. Annu Rev Genomics Hum Genet. 2018 Aug 31;19:73-96. doi: 10.1146/annurev-genom-083117-021602.

Fuchsberger C, Abecasis GR, Hinds DA. minimac2: faster genotype imputation. Bioinformatics. 2015 Mar 1;31(5):782-4. doi: 10.1093/bioinformatics/btu704. Epub 2014 Oct 22. PMID: 25338720; PMCID: PMC4341061.

Howie B, Fuchsberger C, Stephens M, Marchini J, Abecasis GR. Fast and accurate genotype imputation in genome-wide association studies through pre-phasing. Nat Genet. 2012 Jul 22;44(8):955-9. doi: 10.1038/ng.2354. PMID: 22820512; PMCID: PMC3696580.

"},{"location":"workshops/ASHG2023/Session2/","title":"Session2","text":"

Workshop ASHG2023 > Session 2: Run a job, Data Preparation and Data Download

"},{"location":"workshops/ASHG2023/Session2/#welcome","title":"Welcome","text":"

Welcome to Session 2! In this session you will learn how to submit a job on Michigan Imputation Server (MIS) and how to prepare your input data that they are passing the QC step.

"},{"location":"workshops/ASHG2023/Session2/#tutorial","title":"Tutorial","text":""},{"location":"workshops/ASHG2023/Session2/#getting-started","title":"Getting Started","text":"

As a quick start, the following video includes all required steps to submit and monitor a job using the graphical web interface.

"},{"location":"workshops/ASHG2023/Session2/#run-a-job-on-your-own","title":"Run a job on your own","text":"

After you registered successfully, the following URL will bring you directly to the job submission page: https://imputationserver.sph.umich.edu/index.html#!run/minimac4

"},{"location":"workshops/ASHG2023/Session2/#submission-page-select-parameters","title":"Submission Page - Select parameters","text":"

The UI includes several parameters which need to be specified. Our Getting Started guide describes all required parameters to do so.

"},{"location":"workshops/ASHG2023/Session2/#submission-page-upload-data","title":"Submission Page - Upload data","text":"

We are providing two data datasets that can be downloaded from below. In case the unphased dataset is selected, an additional phasing step using Eagle is automatically performed. For this demo, we recommend selecting the HapMap 2 panel (Input parameter 'Reference panel') to get your results as quick as possible. Please also have a look at our supported reference panels when using MIS in a production setup.

  • Phased dataset chr20 hg19
  • Unphased dataset chr20 hg19
"},{"location":"workshops/ASHG2023/Session2/#submission-page-submit","title":"Submission Page - Submit","text":"

After all parameters have been selected and you click 'submit', the job will be added to our Input Validation and QC queue. Please have a look at our Data Preparation Guide to learn how to prepare your dataset using a pre-imputation tool.

"},{"location":"workshops/ASHG2023/Session2/#monitor-jobs-download-data","title":"Monitor Jobs, Download Data","text":"

If the job passes the QC step, it will be added to our long-time queue. As soon as your job is finished, you will receive an email with the password to download and encrypt your data. Also checkout our Pipeline Overview Guide to learn more about the different internal parameters. The complete source code can also be found on GitHub.

"},{"location":"workshops/ASHG2023/Session2/#qc-results","title":"QC Results","text":"

A simple QC report including the frequency plot is available here.

"},{"location":"workshops/ASHG2023/Session2/#contact","title":"Contact","text":"

If you have any questions please write me an email or contact me on Twitter.

"},{"location":"workshops/ASHG2023/Session3/","title":"Session3","text":"

Workshop ASHG2023 > Session 3: Performing GWAS using imputed data

"},{"location":"workshops/ASHG2023/Session4/","title":"Session4","text":"

Workshop ASHG2023 > Session 4: nf-gwas, Imputation Bot and PGS Server

"},{"location":"workshops/ASHG2023/Session4/#nf-gwas-report","title":"nf-gwas Report","text":"

You can download a nf-gwas test report from here. Please unzip the file and open the index.html file.

"},{"location":"workshops/ASHG2023/Session4/#imputation-bot-tutorial","title":"Imputation Bot Tutorial","text":""},{"location":"workshops/ASHG2023/Session4/#requirements","title":"Requirements","text":"

You will need the following things properly installed on your computer.

  • Java 8 or higher
"},{"location":"workshops/ASHG2023/Session4/#download-and-install","title":"Download and Install","text":"

Download and install the latest version from our download page using the following commands:

curl -sL imputationbot.now.sh | bash\n

Test the installation with the following command:

imputationbot version\n

The documentation is available at http://imputationbot.readthedocs.io.

"},{"location":"workshops/ASHG2023/Session4/#get-your-api-token","title":"Get your API Token","text":"

Enable API access from your Profile page.

  1. Login and click on your username and then profile:

  1. Click on Create API Token

  1. Copy your API Token and paste it when imputationbot add-instance ask for it.

Api Tokens are valid for 30 days. You can check the status in the web interface or with imputationbot instances

  1. Next, configure imputationbot with the following command:
imputationbot add-instance\n
Imputation Bot 0.8.3 \ud83e\udd16\nhttps://imputationserver.sph.umich.edu\n(c) 2019-2020 Lukas Forer, Sebastian Schoenherr and Christian Fuchsberger\nBuilt by lukas on 2020-09-01T11:31:10Z\n\nImputationserver Url [https://imputationserver.sph.umich.edu]:\nAPI Token [None]: eyJjdHkiOiJ0ZXh0XC9wbGFpbiIsImFsZyI6IkhTMjU2In0.eyJtYWlsIjoibHVrYXMuZm9yZXJAaS1tZWQuYWMuYXQiLCJleHBpcmUiOjE1NzMyMjkwNTY3NTEsIm5hbWUiOiJMdWthcyBGb3JlciIsImFwaSI6dHJ1ZSwidXNlcm5hbWUiOiJsdWtmb3IifQ.qY7iEM6ul-gJ0EuHmEUHRnoS5hZs7kD1HC95NFaxE9w\n
"},{"location":"workshops/ASHG2023/Session4/#run-imputation","title":"Run imputation","text":"

You can use the impute command to submit a job:

  • The --files parameter defines the location of our VCF file. If we plan to impute more than one file we can enter the path to a folder or separate multiple filenames by ,.
  • We can use the --refpanel parameter to specify the reference panel. For the 1000 Geneoms Phase 3 panel we use 1000g-phase-3-v5. If we are not sure what panels are provided by the server, we can use imputationbot refpanels to get a list of all reference panels and their supported populations.
  • For --population we use eur which stands for European

The complete command looks like this:

imputationbot impute --files /path/to/your.vcf.gz --refpanel 1000g-phase-3-v5 --population eur\n

After submission we get the URL where we can monitor the progress of our job.

"},{"location":"workshops/ASHG2023/Session4/#monitor-jobs","title":"Monitor Jobs","text":"

However, we can also use Imputation Bot to get a list all our jobs and their status:

imputationbot jobs\n

To get more details about our job, we can use the jobs command followed by the job ID:

imputationbot jobs job-XXXXXXXX-XXXXXX-XXX\n
"},{"location":"workshops/ASHG2023/Session4/#download-all-results","title":"Download all Results","text":"

We can use the download command to download all imputed genotypes and the QC report at once:

imputationbot download job-XXXXXXXX-XXXXXX-XXX\n

If the job is still running, Imputation Bot waits until the job is finished and starts automatically with the download.

You can provide Imputation Bot the password we sent you via email and it decrypts all files for you:

imputationbot download job-XXXXXXXX-XXXXXX-XXX --password MYPASSWORD\n
"},{"location":"workshops/ASHG2023/Session4/#documentation","title":"Documentation","text":"

The documentation is available at http://imputationbot.readthedocs.io.

"},{"location":"workshops/ASHG2023/Session4/#contact","title":"Contact","text":"

Feel free to contact us in case of any problems.

"},{"location":"workshops/ASHG2023/Session5/","title":"Session5","text":"

Workshop ASHG2023 > Session 5: HLA Imputation

  • Example output of the HLA imputation VCF
"},{"location":"workshops/ASHG2023/Session6/","title":"Session6","text":"

Workshop ASHG2023 > Session 6: The TOPMed Imputation Server

"}]} \ No newline at end of file diff --git a/sitemap.xml.gz b/sitemap.xml.gz index ccb0c40b53da4f9b251f4bbb1da4da6c7891c180..e3a7e25e09b5d3b360ec95acd846dc2bae77eb89 100644 GIT binary patch delta 13 Ucmb=gXP58h;9!t=HIcmn02!+T(f|Me delta 13 Ucmb=gXP58h;AlAZVj_D503Znj{r~^~ diff --git a/stylesheets/extra.css b/stylesheets/extra.css index f320cad..043bb0c 100644 --- a/stylesheets/extra.css +++ b/stylesheets/extra.css @@ -2,4 +2,9 @@ --md-primary-fg-color: #4f5d73; --md-primary-fg-color--light: #ECB7B7; --md-primary-fg-color--dark: #90030C; - } \ No newline at end of file + } + + .right{ + float: right; + width: 30%; +} diff --git a/tutorials/api/index.html b/tutorials/api/index.html index 1e0949b..81894e1 100644 --- a/tutorials/api/index.html +++ b/tutorials/api/index.html @@ -12,7 +12,7 @@ - + @@ -1444,7 +1444,7 @@

Example: curl{"base": "../..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/tutorials/imputationbot/index.html b/tutorials/imputationbot/index.html index 108cc4c..d8fd236 100644 --- a/tutorials/imputationbot/index.html +++ b/tutorials/imputationbot/index.html @@ -12,7 +12,7 @@ - + @@ -1016,7 +1016,7 @@

Contact{"base": "../..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/workshops/ASHG2020/Session1/index.html b/workshops/ASHG2020/Session1/index.html index 05b0cd9..850cd93 100644 --- a/workshops/ASHG2020/Session1/index.html +++ b/workshops/ASHG2020/Session1/index.html @@ -12,7 +12,7 @@ - + @@ -874,7 +874,7 @@

Selected Literature{"base": "../../..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../../../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/workshops/ASHG2020/Session2/index.html b/workshops/ASHG2020/Session2/index.html index c4d4a88..3eb9bac 100644 --- a/workshops/ASHG2020/Session2/index.html +++ b/workshops/ASHG2020/Session2/index.html @@ -12,7 +12,7 @@ - + @@ -911,7 +911,7 @@

Contact{"base": "../../..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../../../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/workshops/ASHG2020/Session3/index.html b/workshops/ASHG2020/Session3/index.html index 46c395e..6534d36 100644 --- a/workshops/ASHG2020/Session3/index.html +++ b/workshops/ASHG2020/Session3/index.html @@ -12,7 +12,7 @@ - + @@ -868,7 +868,7 @@

Slides{"base": "../../..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../../../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/workshops/ASHG2020/Session4/index.html b/workshops/ASHG2020/Session4/index.html index 1574667..ff22089 100644 --- a/workshops/ASHG2020/Session4/index.html +++ b/workshops/ASHG2020/Session4/index.html @@ -12,7 +12,7 @@ - + @@ -866,7 +866,7 @@

Slides{"base": "../../..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../../../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/workshops/ASHG2020/Session5/index.html b/workshops/ASHG2020/Session5/index.html index 6bb459b..d236183 100644 --- a/workshops/ASHG2020/Session5/index.html +++ b/workshops/ASHG2020/Session5/index.html @@ -12,7 +12,7 @@ - + @@ -940,7 +940,7 @@

Contact{"base": "../../..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../../../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/workshops/ASHG2020/Session6/index.html b/workshops/ASHG2020/Session6/index.html index 7135863..80f2a8f 100644 --- a/workshops/ASHG2020/Session6/index.html +++ b/workshops/ASHG2020/Session6/index.html @@ -12,7 +12,7 @@ - + @@ -866,7 +866,7 @@

Slides{"base": "../../..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../../../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/workshops/ASHG2020/Session7/index.html b/workshops/ASHG2020/Session7/index.html index 4f89193..4163b66 100644 --- a/workshops/ASHG2020/Session7/index.html +++ b/workshops/ASHG2020/Session7/index.html @@ -12,7 +12,7 @@ - + @@ -866,7 +866,7 @@

Slides{"base": "../../..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../../../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/workshops/ASHG2020/index.html b/workshops/ASHG2020/index.html index 4871ebb..6620c0e 100644 --- a/workshops/ASHG2020/index.html +++ b/workshops/ASHG2020/index.html @@ -12,7 +12,7 @@ - + @@ -935,7 +935,7 @@

Intended Audience{"base": "../..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/workshops/ASHG2022/Session1/index.html b/workshops/ASHG2022/Session1/index.html index b4097a3..6b410b1 100644 --- a/workshops/ASHG2022/Session1/index.html +++ b/workshops/ASHG2022/Session1/index.html @@ -12,7 +12,7 @@ - + @@ -874,7 +874,7 @@

Selected Literature{"base": "../../..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../../../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/workshops/ASHG2022/Session2/index.html b/workshops/ASHG2022/Session2/index.html index fc569c8..a7add33 100644 --- a/workshops/ASHG2022/Session2/index.html +++ b/workshops/ASHG2022/Session2/index.html @@ -12,7 +12,7 @@ - + @@ -911,7 +911,7 @@

Contact{"base": "../../..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../../../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/workshops/ASHG2022/Session3/index.html b/workshops/ASHG2022/Session3/index.html index 2a8e412..ad481a2 100644 --- a/workshops/ASHG2022/Session3/index.html +++ b/workshops/ASHG2022/Session3/index.html @@ -12,7 +12,7 @@ - + @@ -866,7 +866,7 @@

Slides{"base": "../../..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../../../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/workshops/ASHG2022/Session4/index.html b/workshops/ASHG2022/Session4/index.html index 2f54c21..b077ac7 100644 --- a/workshops/ASHG2022/Session4/index.html +++ b/workshops/ASHG2022/Session4/index.html @@ -12,7 +12,7 @@ - + @@ -939,7 +939,7 @@

Contact{"base": "../../..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../../../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/workshops/ASHG2022/Session5/index.html b/workshops/ASHG2022/Session5/index.html index c156f18..3c5b716 100644 --- a/workshops/ASHG2022/Session5/index.html +++ b/workshops/ASHG2022/Session5/index.html @@ -12,7 +12,7 @@ - + @@ -866,7 +866,7 @@

Slides{"base": "../../..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../../../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/workshops/ASHG2022/Session6/index.html b/workshops/ASHG2022/Session6/index.html index 2bb6c84..28c2bac 100644 --- a/workshops/ASHG2022/Session6/index.html +++ b/workshops/ASHG2022/Session6/index.html @@ -12,7 +12,7 @@ - + @@ -866,7 +866,7 @@

Slides{"base": "../../..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../../../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/workshops/ASHG2022/index.html b/workshops/ASHG2022/index.html index 5ae2897..01b1bbb 100644 --- a/workshops/ASHG2022/index.html +++ b/workshops/ASHG2022/index.html @@ -12,7 +12,7 @@ - + @@ -934,7 +934,7 @@

Workshop Description (from the pr - + diff --git a/workshops/ASHG2023/Session1/index.html b/workshops/ASHG2023/Session1/index.html index b37fff1..c41ae81 100644 --- a/workshops/ASHG2023/Session1/index.html +++ b/workshops/ASHG2023/Session1/index.html @@ -12,7 +12,7 @@ - + @@ -872,7 +872,7 @@

Selected Literature{"base": "../../..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../../../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/workshops/ASHG2023/Session2/index.html b/workshops/ASHG2023/Session2/index.html index 01d5754..81e700e 100644 --- a/workshops/ASHG2023/Session2/index.html +++ b/workshops/ASHG2023/Session2/index.html @@ -12,7 +12,7 @@ - + @@ -890,7 +890,7 @@

Contact{"base": "../../..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../../../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/workshops/ASHG2023/Session3/index.html b/workshops/ASHG2023/Session3/index.html index 6578010..3d31084 100644 --- a/workshops/ASHG2023/Session3/index.html +++ b/workshops/ASHG2023/Session3/index.html @@ -12,7 +12,7 @@ - + @@ -859,7 +859,7 @@

Session3

- + diff --git a/workshops/ASHG2023/Session4/index.html b/workshops/ASHG2023/Session4/index.html index a299918..afb1ca6 100644 --- a/workshops/ASHG2023/Session4/index.html +++ b/workshops/ASHG2023/Session4/index.html @@ -12,7 +12,7 @@ - + @@ -939,7 +939,7 @@

Contact{"base": "../../..", "features": ["content.tooltips", "navigation.tabs", "search.highlight", "search.share", "search.suggest", "toc.follow", "content.tabs.link", "content.code.annotate", "content.code.copy"], "search": "../../../assets/javascripts/workers/search.07f07601.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} + diff --git a/workshops/ASHG2023/Session5/index.html b/workshops/ASHG2023/Session5/index.html index 01b0aea..d408ec8 100644 --- a/workshops/ASHG2023/Session5/index.html +++ b/workshops/ASHG2023/Session5/index.html @@ -12,7 +12,7 @@ - + @@ -862,7 +862,7 @@

Session5

- + diff --git a/workshops/ASHG2023/Session6/index.html b/workshops/ASHG2023/Session6/index.html index 1d289ba..c33b5d3 100644 --- a/workshops/ASHG2023/Session6/index.html +++ b/workshops/ASHG2023/Session6/index.html @@ -12,7 +12,7 @@ - + @@ -859,7 +859,7 @@

Session6

- + diff --git a/workshops/ASHG2023/index.html b/workshops/ASHG2023/index.html index 29d45bd..ff73f0b 100644 --- a/workshops/ASHG2023/index.html +++ b/workshops/ASHG2023/index.html @@ -12,7 +12,7 @@ - + @@ -949,7 +949,7 @@

Workshop Facilitator(s) - +