@datagrok/bio
Advanced tools
Comparing version 2.10.12 to 2.10.14
@@ -19,3 +19,4 @@ # Bio changelog | ||
* Fix added by Split to monomers columns to be not used as a filter. | ||
* Fix WebLogo with `filterSource`of Selection to work from project. | ||
* Fix WebLogo with `filterSource` of `Selection` to work from project. | ||
* Fix WebLogo with `filterSource` of `Selection` display all in case of empty selection. | ||
@@ -22,0 +23,0 @@ ## 2.10.0 (2023-09-06) |
@@ -1,2 +0,2 @@ | ||
"use strict";(self.webpackChunkbio=self.webpackChunkbio||[]).push([[452],{5697:(t,n,u)=>{u.d(n,{Dz:()=>h,KR:()=>o,MI:()=>l,NB:()=>s,UX:()=>c,WI:()=>a,Zd:()=>i,_h:()=>e,aW:()=>C,bX:()=>m,fX:()=>k,s:()=>g,yU:()=>f});var r=u(1040);function o(t,n){return d(function(t,n){const u=t.trueCount()+n.trueCount();if(0==u)return 1;const r=t.andWithCountBits(n,!0);return r/(u-r)}(t,n))}function e(t,n){return d(function(t,n){const u=t.trueCount()+n.trueCount();return 0==u?0:2*t.andWithCountBits(n,!0)/u}(t,n))}function i(t,n){return d(function(t,n){const u=t.trueCount()*n.trueCount();return 0==u?0:t.andWithCountBits(n,!0)/Math.sqrt(u)}(t,n))}function a(t,n){return Math.sqrt(t.trueCount()+n.trueCount()-2*t.andWithCountBits(n,!0))}function c(t,n){return t.trueCount()+n.trueCount()-2*t.andWithCountBits(n,!0)}function s(t,n){return d(function(t,n){const u=t.trueCount()+n.trueCount(),r=t.andWithCountBits(n,!0);return r/(2*u-3*r)}(t,n))}function g(t,n){return d(function(t,n){const u=t.trueCount()+n.trueCount(),r=t.trueCount()*n.trueCount();return 0==r?0:t.andWithCountBits(n,!0)*u/(2*r)}(t,n))}function C(t,n){return d(function(t,n){const u=t.trueCount()+n.trueCount(),r=t.trueCount()*n.trueCount();return 0==r?0:(t.andWithCountBits(n,!0)*u-r)/r}(t,n))}function f(t,n){return d(function(t,n){const u=Math.min(t.trueCount(),n.trueCount());return 0==u?0:t.andWithCountBits(n,!0)/u}(t,n))}function h(t,n){return d(function(t,n){const u=Math.max(t.trueCount(),n.trueCount());return 0==u?0:t.andWithCountBits(n,!0)/u}(t,n))}function k(t,n){return d(function(t,n){return 0==t.length?0:t.andWithCountBits(n,!0)/t.length}(t,n))}function l(t,n){return d(function(t,n){const u=t.andWithCountBits(n,!0),r=t.countBits(!0)+n.countBits(!0),o=t.length,e=o-r+u;return u==o||e==o?1:u/r+e/(2*o-r)}(t,n))}function d(t){return 0===t?3402823e32:1/t-1}function m(t,n){return Math.abs(t-n)}r.gk.Tanimoto,r.gk.Dice,r.gk.Asymmetric,r.gk.BraunBlanquet,r.gk.Cosine,r.gk.Kulczynski,r.gk.McConnaughey,r.gk.RogotGoldberg,r.gk.Russel,r.gk.Sokal,r.gk.Hamming,r.gk.Euclidean,r.gk.Tanimoto,r.gk.Dice,r.gk.Asymmetric,r.gk.BraunBlanquet,r.gk.Cosine,r.gk.Kulczynski,r.gk.McConnaughey,r.gk.RogotGoldberg,r.gk.Russel,r.gk.Sokal,r.gk.Hamming,r.gk.Euclidean,r.gk.Tanimoto,r.gk.Dice,r.gk.Cosine,r.gk.Tanimoto,r.gk.Asymmetric,r.gk.Cosine,r.gk.Sokal},489:(t,n,u)=>{u.d(n,{U:()=>r.U,o:()=>r.o});var r=u(5540)},5540:(t,n,u)=>{u.d(n,{U:()=>r,o:()=>a});var r,o=u(779),e=u(458),i=u(6683);!function(t){t.HAMMING="Hamming",t.LEVENSHTEIN="Levenshtein",t.NEEDLEMANN_WUNSCH="Needlemann-Wunsch"}(r||(r={}));const a={[r.HAMMING]:o.j,[r.LEVENSHTEIN]:e.r,[r.NEEDLEMANN_WUNSCH]:i.n}},3659:(t,n,u)=>{u.d(n,{OW:()=>r});class r extends Float32Array{}},3979:(t,n)=>{n.H$=void 0,n.H$=function(t,n,u){var r=function(t,n,u){if(0===t.length||0===n.length)return 0;if(u&&!u.caseSensitive&&(t=t.toUpperCase(),n=n.toUpperCase()),t===n)return 1;for(var r=0,o=t.length,e=n.length,i=Math.floor(Math.max(o,e)/2)-1,a=new Array(o),c=new Array(e),s=0;s<o;s++)for(var g=Math.max(0,s-i);g<=Math.min(e,s+i+1);g++)if(!a[s]&&!c[g]&&t[s]===n[g]){++r,a[s]=c[g]=!0;break}if(0===r)return 0;var C=0,f=0;for(s=0;s<o;s++)if(a[s]){for(;!c[f];)f++;t.charAt(s)!==n.charAt(f++)&&C++}return(r/o+r/e+(r-(C/=2))/r)/3}(t,n,u),o=0;if(r>.7){for(var e=Math.min(t.length,n.length),i=0;t[i]===n[i]&&i<4&&i<e;)++o,i++;r+=.1*o*(1-r)}return r}}}]); | ||
"use strict";(self.webpackChunkbio=self.webpackChunkbio||[]).push([[452],{5697:(t,e,n)=>{n.d(e,{Dz:()=>m,FV:()=>o,KR:()=>h,MI:()=>B,NB:()=>f,UX:()=>g,WI:()=>l,Zd:()=>u,_h:()=>a,aW:()=>c,bX:()=>v,fX:()=>C,s:()=>_,yU:()=>d});var r=n(9657),s=n(1040);function i(t,e){const n=t.trueCount()+e.trueCount();if(0==n)return 1;const r=t.andWithCountBits(e,!0);return r/(n-r)}function h(t,e){return I(i(t,e))}function o(t,e){return I(i(new r.Z(t,32*t.length),new r.Z(e,32*e.length)))}function a(t,e){return I(function(t,e){const n=t.trueCount()+e.trueCount();return 0==n?0:2*t.andWithCountBits(e,!0)/n}(t,e))}function u(t,e){return I(function(t,e){const n=t.trueCount()*e.trueCount();return 0==n?0:t.andWithCountBits(e,!0)/Math.sqrt(n)}(t,e))}function l(t,e){return Math.sqrt(t.trueCount()+e.trueCount()-2*t.andWithCountBits(e,!0))}function g(t,e){return t.trueCount()+e.trueCount()-2*t.andWithCountBits(e,!0)}function f(t,e){return I(function(t,e){const n=t.trueCount()+e.trueCount(),r=t.andWithCountBits(e,!0);return r/(2*n-3*r)}(t,e))}function _(t,e){return I(function(t,e){const n=t.trueCount()+e.trueCount(),r=t.trueCount()*e.trueCount();return 0==r?0:t.andWithCountBits(e,!0)*n/(2*r)}(t,e))}function c(t,e){return I(function(t,e){const n=t.trueCount()+e.trueCount(),r=t.trueCount()*e.trueCount();return 0==r?0:(t.andWithCountBits(e,!0)*n-r)/r}(t,e))}function d(t,e){return I(function(t,e){const n=Math.min(t.trueCount(),e.trueCount());return 0==n?0:t.andWithCountBits(e,!0)/n}(t,e))}function m(t,e){return I(function(t,e){const n=Math.max(t.trueCount(),e.trueCount());return 0==n?0:t.andWithCountBits(e,!0)/n}(t,e))}function C(t,e){return I(function(t,e){return 0==t.length?0:t.andWithCountBits(e,!0)/t.length}(t,e))}function B(t,e){return I(function(t,e){const n=t.andWithCountBits(e,!0),r=t.countBits(!0)+e.countBits(!0),s=t.length,i=s-r+n;return n==s||i==s?1:n/r+i/(2*s-r)}(t,e))}function I(t){return 0===t?3402823e32:1/t-1}function v(t,e){return Math.abs(t-e)}s.gk.Tanimoto,s.gk.Dice,s.gk.Asymmetric,s.gk.BraunBlanquet,s.gk.Cosine,s.gk.Kulczynski,s.gk.McConnaughey,s.gk.RogotGoldberg,s.gk.Russel,s.gk.Sokal,s.gk.Hamming,s.gk.Euclidean,s.gk.Tanimoto,s.gk.Dice,s.gk.Asymmetric,s.gk.BraunBlanquet,s.gk.Cosine,s.gk.Kulczynski,s.gk.McConnaughey,s.gk.RogotGoldberg,s.gk.Russel,s.gk.Sokal,s.gk.Hamming,s.gk.Euclidean,s.gk.Tanimoto,s.gk.Dice,s.gk.Cosine,s.gk.Tanimoto,s.gk.Asymmetric,s.gk.Cosine,s.gk.Sokal},489:(t,e,n)=>{n.d(e,{U:()=>r.U,o:()=>r.o});var r=n(5540)},5540:(t,e,n)=>{n.d(e,{U:()=>r,o:()=>o});var r,s=n(779),i=n(458),h=n(6683);!function(t){t.HAMMING="Hamming",t.LEVENSHTEIN="Levenshtein",t.NEEDLEMANN_WUNSCH="Needlemann-Wunsch"}(r||(r={}));const o={[r.HAMMING]:s.j,[r.LEVENSHTEIN]:i.r,[r.NEEDLEMANN_WUNSCH]:h.n}},9657:(t,e,n)=>{n.d(e,{Z:()=>r});class r{constructor(t,e=!1){if(this._length=0,this._version=0,this._updateLevel=0,this._selectedCount=0,this._selectedCountVersion=-1,this._selectedIndexesVersion=-1,this._versionedName="",this._versionedNameVersion=-1,this.SHRINK_THRESHOLD=256,"number"==typeof t){const n=t,s=r._createBuffer(n);if(e)for(let t=0;t<s.length;t++)s[t]=-1;this._data=s,this._length=n}else{if(!(t instanceof Uint32Array))throw new Error("Invalid constructor");this._data=t,this._length=e}}getRawData(){return this._data}assureGoez(t,e){if(t<0)throw new Error(`${e} should be greater than zero`)}assureInRange(t,e,n,r){if(t<e||t>n)throw new Error(`Argument ${r} (${t}) out of range (${e}, ${n})`)}copy(t,e,n){for(let r=0;r<n;r++)e[r]=t[r]}copyFrom(t){if(this._length!=t._length)throw new Error(`Lengths differ (${this._length} != ${t._length})`);this.copy(t._data,this._data,this.lengthInInts),this._version++}get length(){return this._length}get buffer(){return this._data}set buffer(t){this._data=t,this._version++}get version(){return this._version}set version(t){this._version=t}incrementVersion(t=!0){this._version++}get lengthInInts(){return Math.floor((this._length+31)/32)}get versionedName(){return this._version==this._versionedNameVersion?this._versionedName:""}set versionedName(t){this._versionedName=t,this._versionedNameVersion=this._version}get self(){return this}setLength(t){if(t<0)throw new Error("should be >= 0");if(t==this._length)return;const e=Math.floor((t+31)/32);if(e>this._data.length||e+this.SHRINK_THRESHOLD<this._data.length){const t=new Uint32Array(e);this.copy(this._data,t,e>this._data.length?this._data.length:e),this._data=t}t>this._length&&(this._length%32>0&&(this._data[this.lengthInInts-1]&=(1<<(this._length%32&31))-1),this._data.fill(0,this.lengthInInts,e)),this._length=t,this._version++}static fromAnd(t,e){if(t._length!=e._length)throw new Error(`Lengths differ (${t._length} != ${e._length})`);const n=new r(t._length);n._length=t._length,n._data=r._createBuffer(n._length),n._version=0;const s=t.lengthInInts;for(let r=0;r<s;r++)n._data[r]=t._data[r]&e._data[r];return n}static _createBuffer(t){return new Uint32Array(Math.floor((t+31)/32))}static fromValues(t){const e=new r(t.length);e._version=0;for(let n=0;n<e._length;n++)t[n]&&(e._data[Math.floor(n/32)]|=1<<(n%32&31));return e}static fromSeq(t,e){const n=new r(t);for(let r=0;r<t;++r)n.setBit(r,e(r));return n._version=0,n}static fromString(t){return r.fromSeq(t.length,(e=>"1"==t.charAt(e)))}static fromUint32Array(t,e){const n=new r(t);return n._data=e,n}static fromBytes(t){const e=t.length,n=new r(8*e);n._data=new Uint32Array(Math.floor((e+3)/4)),n._length=8*e;let s=0,i=0;for(;e-i>=4;)n._data[s++]=255&t[i]|(255&t[i+1])<<8|(255&t[i+2])<<16|(255&t[i+3])<<24,i+=4;return e-i==3&&(n._data[s]=(255&t[i+2])<<16),e-i==2&&(n._data[s]|=(255&t[i+1])<<8),e-i==1&&(n._data[s]|=255&t[i]),n._version=0,n}toString(){return`${this._length} bits, ${this.countBits(!0)} set`}equals(t){if(this==t)return!0;if(null==t)return!1;if(this._length!=t._length)return!1;if(0==this._length)return!0;for(let e=0;e<this._data.length-1;e++)if(this._data[e]!=t._data[e])return!1;for(let e=8*(this._data.length-1);e<this._length;e++)if(this.getBit(e)!=t.getBit(e))return!1;return!0}clone(){const t=new r(0,!1);return t._data=Uint32Array.from(this._data),t._length=this._length,t._version=this._version,t}init(t,e){this.setAll(!1,!1);for(let e=0;e<this._length;e++)t(e)&&(this._data[Math.floor(e/32)]|=1<<(e%32&31));return this.incrementVersion(e),this}invert(t=!0){for(let t=0;t<this._data.length;t++)this._data[t]^=-1;this.incrementVersion(t)}setAll(t,e=!1){const n=t?-1:0,r=this.lengthInInts;for(let t=0;t<r;t++)this._data[t]=n;this.incrementVersion(e)}setIndexes(t,e=!0,n=!0,r=!0){n&&this.setAll(!e,!1);for(const n of t)this.setFast(n,e);this.incrementVersion(r)}everyIndex(t,e=!0){for(const n of t)if(this.getBit(n)!=e)return!1;return!0}anyIndex(t,e=!0){for(const n of t)if(this.getBit(n)==e)return!0;return!1}setWhere(t,e=!0,n=!0,r=!0,s=!0){if(n&&s&&this.setAll(!e,!1),s)for(let n=0;n<this._length;n++)t(n)&&this.setFast(n,e);else for(let n=0;n<this._length;n++)this.setFast(n,t(n)?e:!e);this.incrementVersion(r)}getRange(t,e){this.assureInRange(t,0,this._length-1,"from"),this.assureInRange(e,0,this._length,"to");const n=[];for(let r=t;r<e;++r)n.push(this.getBit(r));return r.fromValues(n)}getRangeAsList(t,e){this.assureInRange(t,0,this._length-1,"from"),this.assureInRange(e,0,this._length,"to");const n=[];for(let r=t;r<e;++r)n.push(this.getBit(r));return n}setRange(t,e,n,r=!0){this.assureInRange(t,0,this._length-1,"from"),this.assureInRange(e,0,this._length-1,"to");const s=Math.min(t,e),i=Math.max(t,e);if(n)for(let t=s;t<=i;t++)this.setTrue(t);else for(let t=s;t<=i;t++)this.setFalse(t);return this.incrementVersion(r),this}setRandom(t,e,n=!0){if(t<0||t>this._length)throw new Error("n must be >= 0 && <= Count");t>this._length/2&&this.setRandom(this._length-t,!e),this.setAll(!e);for(let n=0;n<t;){const t=Math.floor(Math.random()*this._length);this.getBit(t)!=e&&(this.setFast(t,e),n++)}this.incrementVersion(n)}and(t,e=!0){if(this._length!=t._length)throw new Error("Array lengths differ.");for(let e=0,n=this.lengthInInts;e<n;e++)this._data[e]&=t._data[e];return this.incrementVersion(e),this}andNot(t,e=!0){if(this._length!=t._length)throw new Error("Array lengths differ.");const n=this.lengthInInts;for(let e=0;e<n;e++)this._data[e]&=~t._data[e];return this.incrementVersion(e),this}notAnd(t,e=!0){if(this._length!=t._length)throw new Error("Array lengths differ.");for(let e=0,n=this.lengthInInts;e<n;e++)this._data[e]=~this._data[e]&t._data[e];return this.incrementVersion(e),this}not(t=!0){for(let t=0,e=this.lengthInInts;t<e;t++)this._data[t]=~this._data[t];return this.incrementVersion(t),this}or(t,e=!0){if(this._length!=t._length)throw new Error("Array lengths differ.");for(let e=0,n=this.lengthInInts;e<n;e++)this._data[e]|=t._data[e];return this.incrementVersion(e),this}xor(t,e=!0){if(this._length!=t._length)throw new Error("Array lengths differ.");for(let e=0,n=this.lengthInInts;e<n;e++)this._data[e]^=t._data[e];return this.incrementVersion(e),this}insertAt(t,e,n=!1){if(this.assureInRange(t,0,this._length,"pos"),0==e)return;const r=this._length;this.setLength(this._length+e);for(let n=r-1;n>=t;n--)this.setBit(n+e,this.getBit(n));for(let r=t;r<t+e;r++)this.setBit(r,n)}removeAt(t,e=1){if(e<0)throw new Error("n cannot be negative");if(this.assureInRange(t,0,this._length-e,"pos"),this.contains(!0))for(let n=t;n<this._length-e;n++)this.setBit(n,this.getBit(n+e));this.setLength(this._length-e)}removeByMask(t,e=!0){if(this._length!=t.length)throw new Error("length != mask.length");if(t==this)this.setLength(t.countBits(!e)),this.setAll(!e);else{let n=0;for(let r=-1;-1!=(r=t.findNext(r,!e));)this.setFast(n++,this.getBit(r));this._length=n,this._version++}return this}getBit(t){return 0!=(this._data[Math.floor(t/32)]&1<<(31&t))}setBit(t,e,n=!0){this.setFast(t,e),this._version++}setFast(t,e){e?this._data[Math.floor(t/32)]|=1<<(31&t):this._data[Math.floor(t/32)]&=~(1<<(31&t))}setTrue(t){this._data[Math.floor(t/32)]|=1<<(31&t)}setFalse(t){this._data[Math.floor(t/32)]&=~(1<<(31&t))}trueCount(){return this.countBits(!0)}falseCount(){return this.countBits(!1)}countBits(t){if(0==this._length)return 0;if(this._selectedCountVersion!=this._version){this._selectedCount=0;const t=this.lengthInInts;let e=0;for(;e<t-1;e++)for(let t=this._data[e];0!=t;t>>>=8)this._selectedCount+=r._onBitCount[255&t];let n=this._data[e];const s=31&this._length;for(0!=s&&(n&=~(4294967295<<s));0!=n;n>>>=8)this._selectedCount+=r._onBitCount[255&n];this._selectedCountVersion=this._version}return t?this._selectedCount:this._length-this._selectedCount}countWhere(t){let e=0;if(this.trueCount()==this._length)for(let n=0;n<this._length;n++)e+=t(n)?1:0;else for(let n=-1;-1!=(n=this.findNext(n,!0));)e+=t(n)?1:0;return e}andWithCountBits(t,e){if(0==this._length)return 0;let n=0;const s=this.lengthInInts;let i=0;for(;i<s-1;i++)for(let e=this._data[i]&t._data[i];0!=e;e>>>=8)n+=r._onBitCount[255&e];let h=this._data[i]&t._data[i];const o=31&this._length;for(0!=o&&(h&=~(4294967295<<o));0!=h;h>>>=8)n+=r._onBitCount[255&h];return e?n:this._length-n}clear(){this.setLength(0)}contains(t){return this.findNext(-1,t)>=0}get allTrue(){return this.countBits(!0)==this._length}get allFalse(){return this.countBits(!1)==this._length}get anyTrue(){return this.countBits(!0)>0}get anyFalse(){return this.countBits(!1)>0}findNext(t,e=!0){if(this.assureInRange(t,-1,this._length,"index"),t>=this._length-1)return-1;let n=31&(t=t<0?0:t+1);const s=this.lengthInInts;for(let i=Math.floor(t/32);i<s;i++){let s=e?this._data[i]:~this._data[i];if(0!=n)s&=4294967295<<n&4294967295,n=0;else if(!e&&-4294967296==s)continue;for(let e=0;0!=s;e+=8,s>>>=8){const n=r._firstOnBit[255&s];if(n>=0)return(t=n+32*i+e)>=this._length?-1:t}}return-1}findPrev(t,e=!0){if(0==t)return-1;this.assureInRange(t,-1,this._length,"index");let n=1+(t=t<0?this._length-1:t-1)&31;for(let s=Math.floor(t/32);s>=0;s--){let t=e?this._data[s]:~this._data[s];0!=n&&(t&=~(4294967295<<n),n=0);for(let e=24;0!=t;e-=8,t<<=8){const n=r._lastOnBit[t>>>24];if(n>=0)return n+32*s+e}}return-1}}r._onBitCount=Int8Array.from([0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8]),r._firstOnBit=Int8Array.from([-1,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0]),r._lastOnBit=Int8Array.from([-1,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7])},3659:(t,e,n)=>{n.d(e,{OW:()=>r});class r extends Float32Array{}},3979:(t,e)=>{e.H$=void 0,e.H$=function(t,e,n){var r=function(t,e,n){if(0===t.length||0===e.length)return 0;if(n&&!n.caseSensitive&&(t=t.toUpperCase(),e=e.toUpperCase()),t===e)return 1;for(var r=0,s=t.length,i=e.length,h=Math.floor(Math.max(s,i)/2)-1,o=new Array(s),a=new Array(i),u=0;u<s;u++)for(var l=Math.max(0,u-h);l<=Math.min(i,u+h+1);l++)if(!o[u]&&!a[l]&&t[u]===e[l]){++r,o[u]=a[l]=!0;break}if(0===r)return 0;var g=0,f=0;for(u=0;u<s;u++)if(o[u]){for(;!a[f];)f++;t.charAt(u)!==e.charAt(f++)&&g++}return(r/s+r/i+(r-(g/=2))/r)/3}(t,e,n),s=0;if(r>.7){for(var i=Math.min(t.length,e.length),h=0;t[h]===e[h]&&h<4&&h<i;)++s,h++;r+=.1*s*(1-r)}return r}}}]); | ||
//# sourceMappingURL=452.js.map |
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "2.10.12", | ||
"version": "2.10.14", | ||
"description": "Bioinformatics support (import/export of sequences, conversion, visualization, analysis). [See more](https://github.com/datagrok-ai/public/blob/master/packages/Bio/README.md) for details.", | ||
@@ -38,5 +38,5 @@ "repository": { | ||
"@biowasm/aioli": "^3.1.0", | ||
"@datagrok-libraries/bio": "^5.38.4", | ||
"@datagrok-libraries/bio": "^5.38.7", | ||
"@datagrok-libraries/chem-meta": "^1.0.1", | ||
"@datagrok-libraries/ml": "^6.3.39", | ||
"@datagrok-libraries/ml": "^6.3.43", | ||
"@datagrok-libraries/tutorials": "^1.3.6", | ||
@@ -52,3 +52,4 @@ "@datagrok-libraries/utils": "^4.0.17", | ||
"style-loader": "^3.3.1", | ||
"wu": "latest" | ||
"wu": "latest", | ||
"umap-js": "^1.3.3" | ||
}, | ||
@@ -55,0 +56,0 @@ "devDependencies": { |
import * as DG from 'datagrok-api/dg'; | ||
import {reduceDimensinalityWithNormalization} from '@datagrok-libraries/ml/src/sequence-space'; | ||
import {BitArrayMetrics, StringMetrics} from '@datagrok-libraries/ml/src/typed-metrics'; | ||
import {Matrix} from '@datagrok-libraries/utils/src/type-declarations'; | ||
import {ISequenceSpaceParams} from '@datagrok-libraries/ml/src/viewers/activity-cliffs'; | ||
@@ -9,3 +8,2 @@ import {invalidateMols, MONOMERIC_COL_TAGS} from '../substructure-search/substructure-search'; | ||
import * as grok from 'datagrok-api/grok'; | ||
import {ALPHABET, NOTATION} from '@datagrok-libraries/bio/src/utils/macromolecule'; | ||
import {MmDistanceFunctionsNames} from '@datagrok-libraries/ml/src/macromolecule-distance-functions'; | ||
@@ -61,29 +59,38 @@ | ||
const ncUH = UnitsHandler.getOrCreate(spaceParams.seqCol); | ||
if (ncUH.isFasta() || (ncUH.isSeparator() && ncUH.alphabet && ncUH.alphabet !== ALPHABET.UN)) { | ||
let distanceFName = MmDistanceFunctionsNames.LEVENSHTEIN; | ||
let seqList = spaceParams.seqCol.toList(); | ||
if (ncUH.isSeparator()) { | ||
const fastaCol = ncUH.convert(NOTATION.FASTA); | ||
seqList = fastaCol.toList(); | ||
const uh = UnitsHandler.getOrCreate(fastaCol); | ||
distanceFName = uh.getDistanceFunctionName(); | ||
} else { | ||
distanceFName = ncUH.getDistanceFunctionName(); | ||
const distanceFName = ncUH.isMsa() ? MmDistanceFunctionsNames.HAMMING : MmDistanceFunctionsNames.LEVENSHTEIN; | ||
const seqList = spaceParams.seqCol.toList(); | ||
if (ncUH.getAlphabetIsMultichar()) { | ||
const splitter = ncUH.getSplitter(); | ||
const seqColLength = seqList.length; | ||
let charCodeCounter = 36; | ||
const charCodeMap = new Map<string, string>(); | ||
for (let i = 0; i < seqColLength; i++) { | ||
const seq = seqList[i]; | ||
if (seqList[i] === null || spaceParams.seqCol.isNone(i)) { | ||
seqList[i] = null; | ||
continue; | ||
} | ||
seqList[i] = ''; | ||
const splittedSeq = splitter(seq); | ||
for (let j = 0; j < splittedSeq.length; j++) { | ||
const char = splittedSeq[j]; | ||
if (!charCodeMap.has(char)) { | ||
charCodeMap.set(char, String.fromCharCode(charCodeCounter)); | ||
charCodeCounter++; | ||
} | ||
seqList[i] += charCodeMap.get(char)!; | ||
} | ||
} | ||
for (let i = 0; i < seqList.length; i++) { | ||
// toList puts empty values in array and it causes downstream errors. replace with null | ||
seqList[i] = spaceParams.seqCol.isNone(i) ? null : seqList[i]; | ||
} | ||
const sequenceSpaceResult = await reduceDimensinalityWithNormalization( | ||
seqList, | ||
spaceParams.methodName, | ||
distanceFName, | ||
spaceParams.options, | ||
true); | ||
const cols: DG.Column[] = spaceParams.embedAxesNames.map( | ||
(name: string, index: number) => DG.Column.fromFloat32Array(name, sequenceSpaceResult.embedding[index])); | ||
return {distance: sequenceSpaceResult.distance, coordinates: new DG.ColumnList(cols)}; | ||
} else { | ||
return await sequenceSpaceByFingerprints(spaceParams); | ||
} | ||
const sequenceSpaceResult = await reduceDimensinalityWithNormalization( | ||
seqList, | ||
spaceParams.methodName, | ||
distanceFName, | ||
spaceParams.options, | ||
true); | ||
const cols: DG.Column[] = spaceParams.embedAxesNames.map( | ||
(name: string, index: number) => DG.Column.fromFloat32Array(name, sequenceSpaceResult.embedding[index])); | ||
return {distance: sequenceSpaceResult.distance, coordinates: new DG.ColumnList(cols)}; | ||
} | ||
@@ -90,0 +97,0 @@ |
@@ -462,2 +462,3 @@ /* Do not change these import lines to match external modules in webpack configuration */ | ||
//input: bool plotEmbeddings = true | ||
//input: double sparseMatrixThreshold = 0.8 [Similarity Threshold for sparse matrix calculation] | ||
//input: object options {optional: true} | ||
@@ -468,3 +469,3 @@ //editor: Bio:SequenceSpaceEditor | ||
similarityMetric: BitArrayMetrics | MmDistanceFunctionsNames = BitArrayMetricsNames.Tanimoto, | ||
plotEmbeddings: boolean, options?: IUMAPOptions | ITSNEOptions, | ||
plotEmbeddings: boolean, sparseMatrixThreshold?: number, options?: IUMAPOptions | ITSNEOptions, | ||
): Promise<DG.Viewer | undefined> { | ||
@@ -485,3 +486,4 @@ // Delay is required for initial function dialog to close before starting invalidating of molfiles. | ||
embedAxesNames: embedColsNames, | ||
options: options, | ||
options: {...options, sparseMatrixThreshold: sparseMatrixThreshold ?? 0.8, | ||
usingSparseMatrix: table.rowCount > 20000}, | ||
}; | ||
@@ -488,0 +490,0 @@ |
@@ -46,3 +46,3 @@ import * as grok from 'datagrok-api/grok'; | ||
const distFunc = uh.getDistanceFunctionName(); | ||
expect(distFunc, MmDistanceFunctionsNames.NEEDLEMANN_WUNSCH); | ||
expect(distFunc, MmDistanceFunctionsNames.LEVENSHTEIN); | ||
}); | ||
@@ -49,0 +49,0 @@ |
@@ -19,3 +19,2 @@ import * as grok from 'datagrok-api/grok'; | ||
import {intToHtmlA} from '@datagrok-libraries/utils/src/color'; | ||
import {TAGS} from '@datagrok-libraries/bio/src/utils/macromolecule'; | ||
import {ISeqSplitted} from '@datagrok-libraries/bio/src/utils/macromolecule/types'; | ||
@@ -320,15 +319,2 @@ | ||
private get filter(): DG.BitSet { | ||
let res: DG.BitSet; | ||
switch (this.filterSource) { | ||
case FilterSources.Filtered: | ||
res = this.dataFrame.filter; | ||
break; | ||
case FilterSources.Selected: | ||
res = this.dataFrame.selection; | ||
break; | ||
} | ||
return res; | ||
} | ||
/** Full length of {@link positions}. | ||
@@ -569,4 +555,3 @@ * Inclusive, for startPosition equals to endPosition Length is 1 | ||
const dfFilter = this.filterSource === FilterSources.Filtered ? this.dataFrame.filter : | ||
this.dataFrame.selection; | ||
const dfFilter = this.getFilter(); | ||
const maxLength: number = dfFilter.trueCount === 0 ? this.unitsHandler!.maxLength : | ||
@@ -578,4 +563,4 @@ wu.enumerate(this.unitsHandler!.splitted).map(([mList, rowI]) => { | ||
/** positionNames and positionLabel can be set up through the column's tags only */ | ||
const positionNamesTxt = this.seqCol.getTag(TAGS.positionNames); | ||
const positionLabelsTxt = this.seqCol.getTag(TAGS.positionLabels); | ||
const positionNamesTxt = this.seqCol.getTag(bioTAGS.positionNames); | ||
const positionLabelsTxt = this.seqCol.getTag(bioTAGS.positionLabels); | ||
this.positionNames = !!positionNamesTxt ? positionNamesTxt.split(positionSeparator).map((v) => v.trim()) : | ||
@@ -596,2 +581,16 @@ [...Array(maxLength).keys()].map((jPos) => `${jPos + 1}`)/* fallback if tag is not provided */; | ||
private getFilter(): DG.BitSet { | ||
let dfFilterRes: DG.BitSet; | ||
switch (this.filterSource) { | ||
case FilterSources.Filtered: | ||
dfFilterRes = this.dataFrame.filter; | ||
break; | ||
case FilterSources.Selected: | ||
dfFilterRes = this.dataFrame.selection.trueCount === 0 ? this.dataFrame.filter : this.dataFrame.selection; | ||
break; | ||
} | ||
return dfFilterRes; | ||
} | ||
setSliderVisibility(visible: boolean): void { | ||
@@ -921,4 +920,3 @@ if (visible) { | ||
// 2022-05-05 askalkin instructed to show WebLogo based on filter (not selection) | ||
const dfFilter = | ||
this.filterSource === FilterSources.Filtered ? this.dataFrame.filter : this.dataFrame.selection; | ||
const dfFilter = this.getFilter(); | ||
const dfRowCount = this.dataFrame.rowCount; | ||
@@ -1123,3 +1121,3 @@ const splitted = this.unitsHandler.splitted; | ||
const monomerAtPosSeqCount = countForMonomerAtPosition( | ||
this.dataFrame, this.unitsHandler!, this.filter, monomer, atPI); | ||
this.dataFrame, this.unitsHandler!, this.getFilter(), monomer, atPI); | ||
@@ -1153,3 +1151,3 @@ const tooltipEl = ui.div([ | ||
const selBS: DG.BitSet = DG.BitSet.create(this.dataFrame.selection.length, (rowI: number) => { | ||
return checkSeqForMonomerAtPos(this.dataFrame, this.unitsHandler!, this.filter, rowI, monomer, atPI); | ||
return checkSeqForMonomerAtPos(this.dataFrame, this.unitsHandler!, this.getFilter(), rowI, monomer, atPI); | ||
}); | ||
@@ -1156,0 +1154,0 @@ this.dataFrame.selection.init((i) => selBS.get(i)); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
20041010
186
54903
16
+ Addedumap-js@^1.3.3