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