1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.schemes; |
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
|
|
| 90.9% |
Uncovered Elements: 3 (33) |
Complexity: 9 |
Complexity Density: 0.45 |
|
27 |
|
public class Consensus |
28 |
|
{ |
29 |
|
int[] mask; |
30 |
|
|
31 |
|
double threshold; |
32 |
|
|
33 |
|
String maskstr; |
34 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
35 |
527 |
public Consensus(String mask, double threshold)... |
36 |
|
{ |
37 |
|
|
38 |
|
|
39 |
527 |
this.maskstr = mask; |
40 |
527 |
setMask(mask); |
41 |
527 |
this.threshold = threshold; |
42 |
|
} |
43 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
44 |
527 |
public void setMask(String s)... |
45 |
|
{ |
46 |
527 |
this.mask = setNums(s); |
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
} |
53 |
|
|
54 |
|
|
55 |
|
@deprecated@link |
56 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
57 |
0 |
@Deprecated... |
58 |
|
public boolean isConserved(int[][] cons2, int col, int size) |
59 |
|
{ |
60 |
0 |
jalview.bin.Console.outPrintln("DEPRECATED!!!!"); |
61 |
0 |
return isConserved(cons2, col, size, true); |
62 |
|
} |
63 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (14) |
Complexity: 4 |
Complexity Density: 0.5 |
|
64 |
154 |
public boolean isConserved(int[][] cons2, int col, int size,... |
65 |
|
boolean includeGaps) |
66 |
|
{ |
67 |
154 |
int tot = 0; |
68 |
154 |
if (!includeGaps) |
69 |
|
{ |
70 |
15 |
size -= cons2[col][cons2[col].length - 1]; |
71 |
|
} |
72 |
478 |
for (int i = 0; i < mask.length; i++) |
73 |
|
{ |
74 |
324 |
tot += cons2[col][mask[i]]; |
75 |
|
} |
76 |
|
|
77 |
154 |
if (tot > ((threshold * size) / 100)) |
78 |
|
{ |
79 |
|
|
80 |
|
|
81 |
|
|
82 |
23 |
return true; |
83 |
|
} |
84 |
|
|
85 |
131 |
return false; |
86 |
|
} |
87 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
88 |
527 |
int[] setNums(String s)... |
89 |
|
{ |
90 |
527 |
int[] out = new int[s.length()]; |
91 |
527 |
int i = 0; |
92 |
|
|
93 |
1462 |
while (i < s.length()) |
94 |
|
{ |
95 |
935 |
out[i] = ResidueProperties.aaIndex[s.charAt(i)]; |
96 |
935 |
i++; |
97 |
|
} |
98 |
|
|
99 |
527 |
return out; |
100 |
|
} |
101 |
|
} |