Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

protvista-coloured-sequence

Package Overview
Dependencies
Maintainers
7
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

protvista-coloured-sequence - npm Package Compare versions

Comparing version 2.11.0 to 2.12.0

2

dist/protvista-coloured-sequence.js

@@ -1,2 +0,2 @@

var ProtvistaColouredSequence=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=12)}([function(t,e){t.exports=d3},function(t,e){t.exports=ProtvistaSequence},function(t,e){t.exports=ProtvistaUtils},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},function(t,e,r){var n=r(13),o=r(14);t.exports=function(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?o(t):e}},function(t,e){function r(e){return t.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},r(e)}t.exports=r},function(t,e,r){var n=r(15);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)}},function(t){t.exports=JSON.parse('{"I":-0.31,"L":-0.56,"F":-1.13,"V":0.07,"M":-0.23,"P":0.45,"W":-1.85,"H":0.17,"T":0.14,"E":-0.01,"Q":0.58,"C":-0.24,"Y":-0.94,"A":0.17,"S":0.13,"N":0.42,"D":-0.07,"R":0.81,"G":0.01,"K":0.99}')},function(t){t.exports=JSON.parse('{"I":-1.12,"L":-1.25,"F":-1.71,"V":-0.46,"M":-0.67,"P":0.14,"W":-2.09,"H":0.11,"T":0.25,"E":0.11,"Q":0.77,"C":-0.02,"Y":-0.71,"A":0.5,"S":0.46,"N":0.85,"D":0.43,"R":1.15,"G":3.63,"K":3.64}')},function(t){t.exports=JSON.parse('{"I":-0.81,"L":-0.69,"F":-0.58,"V":-0.53,"M":-0.44,"P":-0.31,"W":-0.24,"H":-0.06,"T":0.11,"E":0.12,"Q":0.19,"C":0.22,"Y":0.23,"A":0.33,"S":0.33,"N":0.43,"D":0.5,"R":1.14,"G":1.61,"K":2.41}')},function(t){t.exports=JSON.parse('{"I":6.04,"L":6.04,"F":5.91,"V":6.02,"M":5.74,"P":6.3,"W":5.88,"H":7.64,"T":5.6,"E":3.08,"Q":5.65,"C":5.02,"Y":5.63,"A":6.11,"S":5.68,"N":5.41,"D":2.87,"R":10.76,"G":6.06,"K":9.47}')},function(t,e,r){t.exports=r(16)},function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(e){return"function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?t.exports=n=function(t){return r(t)}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)},n(e)}t.exports=n},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e){function r(e,n){return t.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(e,n)}t.exports=r},function(t,e,r){"use strict";r.r(e);var n=r(3),o=r.n(n),i=r(4),s=r.n(i),a=r(5),c=r.n(a),u=r(6),l=r.n(u),f=r(7),p=r.n(f),h=r(0),d=r(1),y=r.n(d),b=r(2),g=r(8),v=r(9),m=r(10),S=r(11),_=["hydrophobicity-interface-scale","hydrophobicity-octanol-scale","hydrophobicity-scale","isoelectric-point-scale"],x={domain:[-2,2],range:["#ffdd00","#0000FF"]},O=function(t){function e(){return o()(this,e),c()(this,l()(e).apply(this,arguments))}return p()(e,t),s()(e,[{key:"_createSequence",value:function(){this.svg=Object(h.select)(this).append("div").attr("class","").append("svg").attr("id","").attr("width",this.width).attr("height",this._height),this.uniqueID=Math.random().toString(36).substring(7),this.gradient=this.svg.append("defs").append("linearGradient").attr("id","scale-gradient-".concat(this.uniqueID)),this.seq_g=this.svg.append("g").attr("class","background"),this.seq_greadient=this.svg.append("rect").attr("class","seq-gradient").style("pointer-events","none"),this._getCharSize(),this.trackHighlighter.appendHighlightTo(this.svg),this.refresh()}},{key:"getScaleFromAttribute",value:function(){var t=null;if(_.indexOf(this._scale)>=0)switch(this._scale){case"hydrophobicity-scale":return m;case"hydrophobicity-interface-scale":return g;case"isoelectric-point-scale":return S;case"hydrophobicity-octanol-scale":return v;default:return null}if(/([ILFVMPWHTEQCYASNDRGK]:-?\d+\.?\d*)(,[ILFVMPWHTEQCYASNDRGK]:-?\d+\.?\d*)*/.test(this._scale))try{t=Object(b.String2Object)(this._scale,{keyFormatter:function(t){return t.toUpperCase()},valueFormatter:function(t){return parseFloat(t)}})}catch(t){console.error("Couldn't parse the given scale ".concat(this._scale),t)}return t}},{key:"refresh",value:function(){var t=this;if(this.seq_g){var e=this.getScaleFromAttribute();if(null===e)return void console.error("The attribute scale is not valid.");var r=Object(h.scaleLinear)();this.colorScale=x,this._color_range&&(this.colorScale=Object(b.ColorScaleParser)(this._color_range)),r.domain(this.colorScale.domain).range(this.colorScale.range);var n=this.getSingleBaseWidth(),o=Math.round(Math.max(0,this._displaystart-2)),i=Math.round(Math.min(this.sequence.length,this._displayend+1)),s=this.sequence.slice(o,i).split("").map(function(t,n){var i=t.toUpperCase()in e?e[t.toUpperCase()]:0;return{start:1+o+n,end:1+o+n,aa:t,value:i,colour:r(i)}});this.residues=this.seq_g.selectAll("rect.base_bg").data(n<8?[]:s,function(t){return t.start}),this.residues.enter().append("rect").attr("class","base_bg feature").attr("data-base",function(t){return t.aa}).attr("data-pos",function(t){return t.start}).attr("height",this._height).merge(this.residues).attr("width",n).attr("fill",function(t){return t.colour}).attr("x",function(e){var r=e.start;return t.getXFromSeqPosition(r)}).call(this.bindEvents,this),this.residues.exit().remove();var a=this.gradient.selectAll("stop").data(this.sequence.split(""));a.enter().append("stop").merge(a).attr("offset",function(e,r){return(r+.5)/t.sequence.length}).attr("stop-color",function(t){return r(t.toUpperCase()in e?e[t.toUpperCase()]:0)}),this.gradient.exit().remove(),this.seq_greadient.attr("x",this.getXFromSeqPosition(1)).attr("y",0).attr("height",this._height).attr("width",this.getXFromSeqPosition(this.sequence.length)-this.getXFromSeqPosition(0)).style("opacity",n<8?1:8/n).attr("fill","url(#scale-gradient-".concat(this.uniqueID,")")),this._updateHighlight()}}}],[{key:"observedAttributes",get:function(){return y.a.observedAttributes.concat("scale","color_range")}}]),e}(y.a),P=function(){customElements.define("protvista-coloured-sequence",O)};window.customElements?P():document.addEventListener("WebComponentsReady",function(){P()})}]);
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3"),require("ProtvistaSequence"),require("ProtvistaUtils")):"function"==typeof define&&define.amd?define(["d3","ProtvistaSequence","ProtvistaUtils"],e):"object"==typeof exports?exports.ProtvistaColouredSequence=e(require("d3"),require("ProtvistaSequence"),require("ProtvistaUtils")):t.ProtvistaColouredSequence=e(t.d3,t.ProtvistaSequence,t.ProtvistaUtils)}(window,(function(t,e,r){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=12)}([function(t,e){function r(e){return t.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},r(e)}t.exports=r},function(e,r){e.exports=t},function(t,r){t.exports=e},function(t,e){t.exports=r},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},function(t,e,r){var n=r(13);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)}},function(t,e,r){var n=r(14),o=r(15);t.exports=function(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?o(t):e}},function(t){t.exports=JSON.parse('{"I":-0.31,"L":-0.56,"F":-1.13,"V":0.07,"M":-0.23,"P":0.45,"W":-1.85,"H":0.17,"T":0.14,"E":-0.01,"Q":0.58,"C":-0.24,"Y":-0.94,"A":0.17,"S":0.13,"N":0.42,"D":-0.07,"R":0.81,"G":0.01,"K":0.99}')},function(t){t.exports=JSON.parse('{"I":-1.12,"L":-1.25,"F":-1.71,"V":-0.46,"M":-0.67,"P":0.14,"W":-2.09,"H":0.11,"T":0.25,"E":0.11,"Q":0.77,"C":-0.02,"Y":-0.71,"A":0.5,"S":0.46,"N":0.85,"D":0.43,"R":1.15,"G":3.63,"K":3.64}')},function(t){t.exports=JSON.parse('{"I":-0.81,"L":-0.69,"F":-0.58,"V":-0.53,"M":-0.44,"P":-0.31,"W":-0.24,"H":-0.06,"T":0.11,"E":0.12,"Q":0.19,"C":0.22,"Y":0.23,"A":0.33,"S":0.33,"N":0.43,"D":0.5,"R":1.14,"G":1.61,"K":2.41}')},function(t){t.exports=JSON.parse('{"I":6.04,"L":6.04,"F":5.91,"V":6.02,"M":5.74,"P":6.3,"W":5.88,"H":7.64,"T":5.6,"E":3.08,"Q":5.65,"C":5.02,"Y":5.63,"A":6.11,"S":5.68,"N":5.41,"D":2.87,"R":10.76,"G":6.06,"K":9.47}')},function(t,e,r){t.exports=r(16)},function(t,e){function r(e,n){return t.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(e,n)}t.exports=r},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=r=function(t){return typeof t}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(e)}t.exports=r},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e,r){"use strict";r.r(e);var n=r(4),o=r.n(n),i=r(5),s=r.n(i),a=r(6),c=r.n(a),u=r(7),l=r.n(u),f=r(0),p=r.n(f),h=r(1),d=r(2),y=r.n(d),g=r(3),b=r(8),v=r(9),m=r(10),S=r(11);function _(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p()(t);if(e){var o=p()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return l()(this,r)}}var x=["hydrophobicity-interface-scale","hydrophobicity-octanol-scale","hydrophobicity-scale","isoelectric-point-scale"],q={domain:[-2,2],range:["#ffdd00","#0000FF"]},P=function(t){c()(r,t);var e=_(r);function r(){return o()(this,r),e.apply(this,arguments)}return s()(r,[{key:"_createSequence",value:function(){this.svg=Object(h.select)(this).append("div").attr("class","").append("svg").attr("id","").attr("width",this.width).attr("height",this._height),this.uniqueID=Math.random().toString(36).substring(7),this.gradient=this.svg.append("defs").append("linearGradient").attr("id","scale-gradient-".concat(this.uniqueID)),this.seq_g=this.svg.append("g").attr("class","background"),this.seq_greadient=this.svg.append("rect").attr("class","seq-gradient").style("pointer-events","none"),this._getCharSize(),this.trackHighlighter.appendHighlightTo(this.svg),this.refresh()}},{key:"getScaleFromAttribute",value:function(){var t=null;if(x.indexOf(this._scale)>=0)switch(this._scale){case"hydrophobicity-scale":return m;case"hydrophobicity-interface-scale":return b;case"isoelectric-point-scale":return S;case"hydrophobicity-octanol-scale":return v;default:return null}if(/([ILFVMPWHTEQCYASNDRGK]:-?\d+\.?\d*)(,[ILFVMPWHTEQCYASNDRGK]:-?\d+\.?\d*)*/.test(this._scale))try{t=Object(g.String2Object)(this._scale,{keyFormatter:function(t){return t.toUpperCase()},valueFormatter:function(t){return parseFloat(t)}})}catch(t){console.error("Couldn't parse the given scale ".concat(this._scale),t)}return t}},{key:"refresh",value:function(){var t=this;if(this.seq_g){var e=this.getScaleFromAttribute();if(null===e)return void console.error("The attribute scale is not valid.");var r=Object(h.scaleLinear)();this.colorScale=q,this._color_range&&(this.colorScale=Object(g.ColorScaleParser)(this._color_range)),r.domain(this.colorScale.domain).range(this.colorScale.range);var n=this.getSingleBaseWidth(),o=Math.round(Math.max(0,this._displaystart-2)),i=Math.round(Math.min(this.sequence.length,this._displayend+1)),s=this.sequence.slice(o,i).split("").map((function(t,n){var i=t.toUpperCase()in e?e[t.toUpperCase()]:0;return{start:1+o+n,end:1+o+n,aa:t,value:i,colour:r(i)}}));this.residues=this.seq_g.selectAll("rect.base_bg").data(n<8?[]:s,(function(t){return t.start})),this.residues.enter().append("rect").attr("class","base_bg feature").attr("data-base",(function(t){return t.aa})).attr("data-pos",(function(t){return t.start})).attr("height",this._height).merge(this.residues).attr("width",n).attr("fill",(function(t){return t.colour})).attr("x",(function(e){var r=e.start;return t.getXFromSeqPosition(r)})).call(this.bindEvents,this),this.residues.exit().remove();var a=this.gradient.selectAll("stop").data(this.sequence.split(""));a.enter().append("stop").merge(a).attr("offset",(function(e,r){return(r+.5)/t.sequence.length})).attr("stop-color",(function(t){return r(t.toUpperCase()in e?e[t.toUpperCase()]:0)})),this.gradient.exit().remove(),this.seq_greadient.attr("x",this.getXFromSeqPosition(1)).attr("y",0).attr("height",this._height).attr("width",this.getXFromSeqPosition(this.sequence.length)-this.getXFromSeqPosition(0)).style("opacity",n<8?1:8/n).attr("fill","url(#scale-gradient-".concat(this.uniqueID,")")),this._updateHighlight()}}}],[{key:"observedAttributes",get:function(){return y.a.observedAttributes.concat("scale","color_range")}}]),r}(y.a),O=function(){customElements.define("protvista-coloured-sequence",P)};window.customElements?O():document.addEventListener("WebComponentsReady",(function(){O()}))}])}));
//# sourceMappingURL=protvista-coloured-sequence.js.map
{
"name": "protvista-coloured-sequence",
"version": "2.11.0",
"version": "2.12.0",
"description": "Track that colors each base by a given function. The default function is hydrophobicity",

@@ -14,4 +14,4 @@ "files": [

"dependencies": {
"protvista-sequence": "^2.11.0",
"protvista-utils": "^2.11.0"
"protvista-sequence": "^2.12.0",
"protvista-utils": "^2.12.0"
},

@@ -37,3 +37,3 @@ "repository": {

},
"gitHead": "317d251a184fbc469539d0406d92641b39bea23a"
"gitHead": "de4ae11992b4fe93810949e45c4ae6297ad604e1"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc