1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.workers; |
22 |
|
|
23 |
|
import jalview.analysis.AAFrequency; |
24 |
|
import jalview.api.AlignViewportI; |
25 |
|
import jalview.api.AlignmentViewPanel; |
26 |
|
import jalview.datamodel.AlignmentAnnotation; |
27 |
|
import jalview.datamodel.AlignmentI; |
28 |
|
|
29 |
|
import java.util.ConcurrentModificationException; |
30 |
|
import java.util.Hashtable; |
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
@author |
37 |
|
|
38 |
|
|
|
|
| 91.7% |
Uncovered Elements: 2 (24) |
Complexity: 12 |
Complexity Density: 0.86 |
|
39 |
|
public class ComplementConsensusThread extends ConsensusThread |
40 |
|
{ |
41 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
42 |
4 |
public ComplementConsensusThread(AlignViewportI alignViewport,... |
43 |
|
AlignmentViewPanel alignPanel) |
44 |
|
{ |
45 |
4 |
super(alignViewport, alignPanel); |
46 |
|
} |
47 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
48 |
12 |
@Override... |
49 |
|
protected AlignmentAnnotation getConsensusAnnotation() |
50 |
|
{ |
51 |
12 |
return alignViewport.getComplementConsensusAnnotation(); |
52 |
|
} |
53 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
54 |
4 |
@Override... |
55 |
|
protected Hashtable<String, Object>[] getViewportConsensus() |
56 |
|
{ |
57 |
4 |
return alignViewport.getComplementConsensusHash(); |
58 |
|
} |
59 |
|
|
60 |
|
|
61 |
|
|
62 |
|
|
|
|
| 87.5% |
Uncovered Elements: 1 (8) |
Complexity: 3 |
Complexity Density: 0.5 |
|
63 |
4 |
@Override... |
64 |
|
protected void computeConsensus(AlignmentI alignment) |
65 |
|
{ |
66 |
4 |
@SuppressWarnings("unchecked") |
67 |
|
Hashtable<String, Object>[] hconsensus = new Hashtable[alignment |
68 |
|
.getWidth()]; |
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
|
73 |
|
|
74 |
|
|
75 |
|
|
76 |
4 |
for (int i = 0; i < 3; i++) |
77 |
|
{ |
78 |
4 |
try |
79 |
|
{ |
80 |
4 |
AAFrequency.calculateCdna(alignment, hconsensus); |
81 |
4 |
break; |
82 |
|
} catch (ConcurrentModificationException e) |
83 |
|
{ |
84 |
|
|
85 |
|
} |
86 |
|
} |
87 |
|
|
88 |
4 |
alignViewport.setComplementConsensusHash(hconsensus); |
89 |
|
} |
90 |
|
|
91 |
|
|
92 |
|
|
93 |
|
|
94 |
|
|
95 |
|
@param |
96 |
|
|
97 |
|
@param |
98 |
|
|
99 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
100 |
4 |
protected void deriveConsensus(AlignmentAnnotation consensusAnnotation,... |
101 |
|
Hashtable<String, Object>[] consensusData) |
102 |
|
{ |
103 |
4 |
AAFrequency.completeCdnaConsensus(consensusAnnotation, consensusData, |
104 |
|
alignViewport.isShowSequenceLogo(), getSequences().length); |
105 |
|
} |
106 |
|
|
|
|
| 83.3% |
Uncovered Elements: 1 (6) |
Complexity: 5 |
Complexity Density: 1.25 |
|
107 |
4 |
@Override... |
108 |
|
public void updateResultAnnotation(boolean immediate) |
109 |
|
{ |
110 |
4 |
AlignmentAnnotation consensus = getConsensusAnnotation(); |
111 |
4 |
Hashtable<String, Object>[] hconsensus = getViewportConsensus(); |
112 |
4 |
if (immediate || !calcMan.isWorking(this) && consensus != null |
113 |
|
&& hconsensus != null) |
114 |
|
{ |
115 |
4 |
deriveConsensus(consensus, hconsensus); |
116 |
|
} |
117 |
|
} |
118 |
|
|
119 |
|
} |