X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=bin%2Fjalview%2Fschemes%2FConsensus.js;h=45c3c6a22186ca9439084398c9b8177b5a84f9f0;hp=39d8ac95d83d3ae5b03af3307ede90434da191bd;hb=8ffd05b3abe52c0b6b79b011c0966361f82d5fe6;hpb=6154cb57a6eac3bb1344b8342495f5bb701ee921 diff --git a/bin/jalview/schemes/Consensus.js b/bin/jalview/schemes/Consensus.js index 39d8ac9..45c3c6a 100644 --- a/bin/jalview/schemes/Consensus.js +++ b/bin/jalview/schemes/Consensus.js @@ -1,45 +1,45 @@ -Clazz.declarePackage ("jalview.schemes"); -Clazz.load (null, "jalview.schemes.Consensus", ["jalview.schemes.ResidueProperties"], function () { -c$ = Clazz.decorateAsClass (function () { -this.mask = null; -this.threshold = 0; -this.maskstr = null; -Clazz.instantialize (this, arguments); -}, jalview.schemes, "Consensus"); -Clazz.makeConstructor (c$, -function (mask, threshold) { -this.maskstr = mask; -this.setMask (mask); -this.threshold = threshold; -}, "~S,~N"); -Clazz.defineMethod (c$, "setMask", -function (s) { -this.mask = this.setNums (s); -}, "~S"); -Clazz.defineMethod (c$, "isConserved", -function (cons2, col, size) { -return this.isConserved (cons2, col, size, true); -}, "~A,~N,~N"); -Clazz.defineMethod (c$, "isConserved", -function (cons2, col, size, includeGaps) { -var tot = 0; -if (!includeGaps) { -size -= cons2[col][cons2[col].length - 1]; -}for (var i = 0; i < this.mask.length; i++) { -tot += cons2[col][this.mask[i]]; -} -if (tot > ((this.threshold * size) / 100)) { -return true; -}return false; -}, "~A,~N,~N,~B"); -Clazz.defineMethod (c$, "setNums", -function (s) { -var out = Clazz.newIntArray (s.length, 0); -var i = 0; -while (i < s.length) { -out[i] = jalview.schemes.ResidueProperties.aaIndex[s.charCodeAt (i)]; -i++; -} -return out; -}, "~S"); -}); +Clazz.declarePackage ("jalview.schemes"); +Clazz.load (null, "jalview.schemes.Consensus", ["jalview.schemes.ResidueProperties"], function () { +c$ = Clazz.decorateAsClass (function () { +this.mask = null; +this.threshold = 0; +this.maskstr = null; +Clazz.instantialize (this, arguments); +}, jalview.schemes, "Consensus"); +Clazz.makeConstructor (c$, +function (mask, threshold) { +this.maskstr = mask; +this.setMask (mask); +this.threshold = threshold; +}, "~S,~N"); +Clazz.defineMethod (c$, "setMask", +function (s) { +this.mask = this.setNums (s); +}, "~S"); +Clazz.defineMethod (c$, "isConserved", +function (cons2, col, size) { +return this.isConserved (cons2, col, size, true); +}, "~A,~N,~N"); +Clazz.defineMethod (c$, "isConserved", +function (cons2, col, size, includeGaps) { +var tot = 0; +if (!includeGaps) { +size -= cons2[col][cons2[col].length - 1]; +}for (var i = 0; i < this.mask.length; i++) { +tot += cons2[col][this.mask[i]]; +} +if (tot > ((this.threshold * size) / 100)) { +return true; +}return false; +}, "~A,~N,~N,~B"); +Clazz.defineMethod (c$, "setNums", +function (s) { +var out = Clazz.newIntArray (s.length, 0); +var i = 0; +while (i < s.length) { +out[i] = jalview.schemes.ResidueProperties.aaIndex[s.charCodeAt (i)]; +i++; +} +return out; +}, "~S"); +});