1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.datamodel; |
22 |
|
|
23 |
|
import java.awt.Color; |
24 |
|
import java.util.BitSet; |
25 |
|
import java.util.HashMap; |
26 |
|
import java.util.List; |
27 |
|
|
28 |
|
import jalview.util.MapList; |
29 |
|
import jalview.ws.datamodel.alphafold.MappableContactMatrix; |
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
@author |
35 |
|
|
36 |
|
|
|
|
| 0% |
Uncovered Elements: 32 (32) |
Complexity: 16 |
Complexity Density: 1 |
|
37 |
|
public class SeqDistanceContactMatrix |
38 |
|
extends MappableContactMatrix<SeqDistanceContactMatrix> |
39 |
|
implements ContactMatrixI |
40 |
|
{ |
41 |
|
private static final String SEQUENCE_DISTANCE = "SEQUENCE_DISTANCE"; |
42 |
|
|
43 |
|
private int width = 0; |
44 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
45 |
0 |
public SeqDistanceContactMatrix(int width)... |
46 |
|
{ |
47 |
0 |
this.width = width; |
48 |
|
} |
49 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
50 |
0 |
@Override... |
51 |
|
public float getMin() |
52 |
|
{ |
53 |
0 |
return 0f; |
54 |
|
} |
55 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
56 |
0 |
@Override... |
57 |
|
public float getMax() |
58 |
|
{ |
59 |
0 |
return width; |
60 |
|
} |
61 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
62 |
0 |
@Override... |
63 |
|
public ContactListI getContactList(final int column) |
64 |
|
{ |
65 |
0 |
if (column < 0 || column >= width) |
66 |
|
{ |
67 |
0 |
return null; |
68 |
|
} |
69 |
0 |
return new ContactListImpl(new ContactListProviderI() |
70 |
|
{ |
71 |
|
|
72 |
|
int p = column; |
73 |
|
|
74 |
|
|
75 |
|
|
76 |
|
|
77 |
|
|
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
|
82 |
|
|
83 |
|
|
84 |
|
|
85 |
|
|
86 |
|
|
87 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
88 |
0 |
@Override... |
89 |
|
public int getContactHeight() |
90 |
|
{ |
91 |
0 |
return width; |
92 |
|
|
93 |
|
} |
94 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
95 |
0 |
@Override... |
96 |
|
public int getPosition() |
97 |
|
{ |
98 |
0 |
return p; |
99 |
|
} |
100 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
101 |
0 |
@Override... |
102 |
|
public double getContactAt(int column) |
103 |
|
{ |
104 |
0 |
return Math.abs(column - p); |
105 |
|
} |
106 |
|
}); |
107 |
|
} |
108 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
109 |
0 |
@Override... |
110 |
|
public String getAnnotDescr() |
111 |
|
{ |
112 |
0 |
return "Sequence distance matrix"; |
113 |
|
} |
114 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
115 |
0 |
@Override... |
116 |
|
public String getAnnotLabel() |
117 |
|
{ |
118 |
0 |
return "Sequence Distance"; |
119 |
|
} |
120 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
121 |
0 |
@Override... |
122 |
|
public String getType() |
123 |
|
{ |
124 |
0 |
return SEQUENCE_DISTANCE; |
125 |
|
} |
126 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
127 |
0 |
@Override... |
128 |
|
public int getWidth() |
129 |
|
{ |
130 |
0 |
return width; |
131 |
|
} |
132 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
133 |
0 |
@Override... |
134 |
|
public int getHeight() |
135 |
|
{ |
136 |
0 |
return width; |
137 |
|
} |
138 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
139 |
0 |
@Override... |
140 |
|
public double getElementAt(int _column, int i) |
141 |
|
{ |
142 |
0 |
return Math.abs(_column - i); |
143 |
|
} |
144 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
145 |
0 |
@Override... |
146 |
|
protected SeqDistanceContactMatrix newMappableContactMatrix( |
147 |
|
SequenceI newRefSeq, MapList newFromMapList) |
148 |
|
{ |
149 |
|
|
150 |
0 |
return new SeqDistanceContactMatrix(width); |
151 |
|
} |
152 |
|
} |