1 Clazz.declarePackage ("jalview.schemes");
2 Clazz.load (null, "jalview.schemes.Consensus", ["jalview.schemes.ResidueProperties"], function () {
3 c$ = Clazz.decorateAsClass (function () {
7 Clazz.instantialize (this, arguments);
8 }, jalview.schemes, "Consensus");
9 Clazz.makeConstructor (c$,
10 function (mask, threshold) {
13 this.threshold = threshold;
15 Clazz.defineMethod (c$, "setMask",
17 this.mask = this.setNums (s);
19 Clazz.defineMethod (c$, "isConserved",
20 function (cons2, col, size) {
21 return this.isConserved (cons2, col, size, true);
23 Clazz.defineMethod (c$, "isConserved",
24 function (cons2, col, size, includeGaps) {
27 size -= cons2[col][cons2[col].length - 1];
28 }for (var i = 0; i < this.mask.length; i++) {
29 tot += cons2[col][this.mask[i]];
31 if (tot > ((this.threshold * size) / 100)) {
35 Clazz.defineMethod (c$, "setNums",
37 var out = Clazz.newIntArray (s.length, 0);
39 while (i < s.length) {
40 out[i] = jalview.schemes.ResidueProperties.aaIndex[s.charCodeAt (i)];