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