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 |
|
|
|
|
| 0% |
Uncovered Elements: 33 (33) |
Complexity: 9 |
Complexity Density: 0.45 |
|
27 |
|
public class Consensus |
28 |
|
{ |
29 |
|
int[] mask; |
30 |
|
|
31 |
|
double threshold; |
32 |
|
|
33 |
|
String maskstr; |
34 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
35 |
0 |
public Consensus(String mask, double threshold)... |
36 |
|
{ |
37 |
|
|
38 |
|
|
39 |
0 |
this.maskstr = mask; |
40 |
0 |
setMask(mask); |
41 |
0 |
this.threshold = threshold; |
42 |
|
} |
43 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
44 |
0 |
public void setMask(String s)... |
45 |
|
{ |
46 |
0 |
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 |
|
|
|
|
| 0% |
Uncovered Elements: 14 (14) |
Complexity: 4 |
Complexity Density: 0.5 |
|
64 |
0 |
public boolean isConserved(int[][] cons2, int col, int size,... |
65 |
|
boolean includeGaps) |
66 |
|
{ |
67 |
0 |
int tot = 0; |
68 |
0 |
if (!includeGaps) |
69 |
|
{ |
70 |
0 |
size -= cons2[col][cons2[col].length - 1]; |
71 |
|
} |
72 |
0 |
for (int i = 0; i < mask.length; i++) |
73 |
|
{ |
74 |
0 |
tot += cons2[col][mask[i]]; |
75 |
|
} |
76 |
|
|
77 |
0 |
if (tot > ((threshold * size) / 100)) |
78 |
|
{ |
79 |
|
|
80 |
|
|
81 |
|
|
82 |
0 |
return true; |
83 |
|
} |
84 |
|
|
85 |
0 |
return false; |
86 |
|
} |
87 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
88 |
0 |
int[] setNums(String s)... |
89 |
|
{ |
90 |
0 |
int[] out = new int[s.length()]; |
91 |
0 |
int i = 0; |
92 |
|
|
93 |
0 |
while (i < s.length()) |
94 |
|
{ |
95 |
0 |
out[i] = ResidueProperties.aaIndex[s.charAt(i)]; |
96 |
0 |
i++; |
97 |
|
} |
98 |
|
|
99 |
0 |
return out; |
100 |
|
} |
101 |
|
} |