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