"use strict";(self.webpackChunkbio=self.webpackChunkbio||[]).push([[589],{6066:(t,e,a)=>{var n;a.d(e,{G:()=>n}),function(t){t.EUCLIDEAN="EUCLIDEAN",t.MANHATTAN="MANHATTAN"}(n||(n={}))},2780:(t,e,a)=>{a.d(e,{lW:()=>n.lW,t$:()=>n.t$}),a(8498);var n=a(9336)},9336:(t,e,a)=>{a.d(e,{lW:()=>A,t$:()=>M});var n=a(2787),r=a(944),o=a(6295),i=a(3629),s=a(6863),T=a(8498);const u={[T.Pn.Euclidean]:i.ou},c={[T.xL.Levenshtein]:n.I,[T.xL.JaroWinkler]:r.Vb,[T.xL.Manhattan]:function(t,e){if(t.length!==e.length)return 1;{let a=0;for(let n=1;n<t.length;n++)a+=t[n]==e[n]?0:1;return a/t.length}},[T.xL.Onehot]:function(t,e){return t===e?0:1}},h={[T.aT.Tanimoto]:o.tO,[T.aT.Dice]:o.zn,[T.aT.Asymmetric]:o.gt,[T.aT.BraunBlanquet]:o.ij,[T.aT.Cosine]:o.lO,[T.aT.Kulczynski]:o.rR,[T.aT.McConnaughey]:o.lP,[T.aT.RogotGoldberg]:o.TK,[T.aT.Russel]:o.yK,[T.aT.Sokal]:o.Ii,[T.aT.Hamming]:o.be,[T.aT.Euclidean]:o.a4},l={[T.m6.TanimotoIntArray]:o.v_},m={[T.RR.Difference]:o.T6},E={[T.Wn.CommonItems]:o.Hr},y={[T.EG.Vector]:{[T.Pn.Euclidean]:u[T.Pn.Euclidean]},[T.EG.String]:{[T.xL.Levenshtein]:c[T.xL.Levenshtein],[T.xL.JaroWinkler]:c[T.xL.JaroWinkler],[T.xL.Manhattan]:c[T.xL.Manhattan],[T.xL.Onehot]:c[T.xL.Onehot]},[T.EG.BitArray]:{[T.aT.Tanimoto]:h[T.aT.Tanimoto],[T.aT.Dice]:h[T.aT.Dice],[T.aT.Asymmetric]:h[T.aT.Asymmetric],[T.aT.BraunBlanquet]:h[T.aT.BraunBlanquet],[T.aT.Cosine]:h[T.aT.Cosine],[T.aT.Kulczynski]:h[T.aT.Kulczynski],[T.aT.McConnaughey]:h[T.aT.McConnaughey],[T.aT.RogotGoldberg]:h[T.aT.RogotGoldberg],[T.aT.Russel]:h[T.aT.Russel],[T.aT.Sokal]:h[T.aT.Sokal]},[T.EG.MacroMolecule]:{[s.Z.HAMMING]:s.V[s.Z.HAMMING],[s.Z.LEVENSHTEIN]:s.V[s.Z.LEVENSHTEIN],[s.Z.NEEDLEMANN_WUNSCH]:s.V[s.Z.NEEDLEMANN_WUNSCH],[s.Z.MONOMER_CHEMICAL_DISTANCE]:s.V[s.Z.MONOMER_CHEMICAL_DISTANCE]},[T.EG.Number]:{[T.RR.Difference]:m[T.RR.Difference]},[T.EG.IntArray]:{[T.m6.TanimotoIntArray]:l[T.m6.TanimotoIntArray]},[T.EG.NumberArray]:{[T.Wn.CommonItems]:E[T.Wn.CommonItems]}},N=Object.keys(y).reduce(((t,e)=>{for(const a of Object.keys(y[e]))t[a]=e;return t}),{});function A(t){return"BitArray"==N[t]}class M{constructor(t){this.method=t,this.dataType=N[t]}metricNeedsArgs(t){return N[t]==T.EG.MacroMolecule.toString()||N[t]==T.EG.Number.toString()||function(t){return N[t]==T.EG.NumberArray.toString()}(t)}getMeasure(t){const e=y;if(!e.hasOwnProperty(this.dataType)||!e[this.dataType].hasOwnProperty(this.method))throw new Error(`Unknown measure ${this.method} for data type ${this.dataType}`);return this.metricNeedsArgs(this.method)?e[this.dataType][this.method](t):e[this.dataType][this.method]}static getMetricByDataType(t){return Object.keys(y[t])}static get availableMeasures(){return Object.keys(y)}}},3629:(t,e,a)=>{function n(t,e){let a=0;const n=t.length;if(n!==e.length)throw new Error("The dimensionality of the vectors must match");for(let r=0;r<n;++r)a+=Math.pow(t[r]-e[r],2);return Math.sqrt(a)}a.d(e,{ou:()=>n})}}]);
//# sourceMappingURL=589.js.map