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 |
|
|
|
|
| 0% |
Uncovered Elements: 24 (24) |
Complexity: 12 |
Complexity Density: 0.86 |
|
39 |
|
public class ComplementConsensusThread extends ConsensusThread |
40 |
|
{ |
41 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
42 |
0 |
public ComplementConsensusThread(AlignViewportI alignViewport,... |
43 |
|
AlignmentViewPanel alignPanel) |
44 |
|
{ |
45 |
0 |
super(alignViewport, alignPanel); |
46 |
|
} |
47 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
48 |
0 |
@Override... |
49 |
|
protected AlignmentAnnotation getConsensusAnnotation() |
50 |
|
{ |
51 |
0 |
return alignViewport.getComplementConsensusAnnotation(); |
52 |
|
} |
53 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
54 |
0 |
@Override... |
55 |
|
protected Hashtable<String, Object>[] getViewportConsensus() |
56 |
|
{ |
57 |
0 |
return alignViewport.getComplementConsensusHash(); |
58 |
|
} |
59 |
|
|
60 |
|
|
61 |
|
|
62 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 3 |
Complexity Density: 0.5 |
|
63 |
0 |
@Override... |
64 |
|
protected void computeConsensus(AlignmentI alignment) |
65 |
|
{ |
66 |
0 |
@SuppressWarnings("unchecked") |
67 |
|
Hashtable<String, Object>[] hconsensus = new Hashtable[alignment |
68 |
|
.getWidth()]; |
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
|
73 |
|
|
74 |
|
|
75 |
|
|
76 |
0 |
for (int i = 0; i < 3; i++) |
77 |
|
{ |
78 |
0 |
try |
79 |
|
{ |
80 |
0 |
AAFrequency.calculateCdna(alignment, hconsensus); |
81 |
0 |
break; |
82 |
|
} catch (ConcurrentModificationException e) |
83 |
|
{ |
84 |
|
|
85 |
|
} |
86 |
|
} |
87 |
|
|
88 |
0 |
alignViewport.setComplementConsensusHash(hconsensus); |
89 |
|
} |
90 |
|
|
91 |
|
|
92 |
|
|
93 |
|
|
94 |
|
|
95 |
|
@param |
96 |
|
|
97 |
|
@param |
98 |
|
|
99 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
100 |
0 |
protected void deriveConsensus(AlignmentAnnotation consensusAnnotation,... |
101 |
|
Hashtable<String, Object>[] consensusData) |
102 |
|
{ |
103 |
0 |
AAFrequency.completeCdnaConsensus(consensusAnnotation, consensusData, |
104 |
|
alignViewport.isShowSequenceLogo(), getSequences().length); |
105 |
|
} |
106 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 5 |
Complexity Density: 1.25 |
|
107 |
0 |
@Override... |
108 |
|
public void updateResultAnnotation(boolean immediate) |
109 |
|
{ |
110 |
0 |
AlignmentAnnotation consensus = getConsensusAnnotation(); |
111 |
0 |
Hashtable<String, Object>[] hconsensus = getViewportConsensus(); |
112 |
0 |
if (immediate || !calcMan.isWorking(this) && consensus != null |
113 |
|
&& hconsensus != null) |
114 |
|
{ |
115 |
0 |
deriveConsensus(consensus, hconsensus); |
116 |
|
} |
117 |
|
} |
118 |
|
|
119 |
|
} |