1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.viewmodel; |
22 |
|
|
23 |
|
import java.awt.Color; |
24 |
|
import java.beans.PropertyChangeSupport; |
25 |
|
import java.util.ArrayDeque; |
26 |
|
import java.util.ArrayList; |
27 |
|
import java.util.BitSet; |
28 |
|
import java.util.Deque; |
29 |
|
import java.util.HashMap; |
30 |
|
import java.util.Hashtable; |
31 |
|
import java.util.Iterator; |
32 |
|
import java.util.List; |
33 |
|
import java.util.Map; |
34 |
|
|
35 |
|
import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder; |
36 |
|
import jalview.analysis.AlignmentUtils; |
37 |
|
import jalview.analysis.Conservation; |
38 |
|
import jalview.analysis.TreeModel; |
39 |
|
import jalview.api.AlignCalcManagerI; |
40 |
|
import jalview.api.AlignExportSettingsI; |
41 |
|
import jalview.api.AlignViewportI; |
42 |
|
import jalview.api.AlignmentViewPanel; |
43 |
|
import jalview.api.FeaturesDisplayedI; |
44 |
|
import jalview.api.ViewStyleI; |
45 |
|
import jalview.bin.Console; |
46 |
|
import jalview.commands.CommandI; |
47 |
|
import jalview.datamodel.AlignedCodonFrame; |
48 |
|
import jalview.datamodel.AlignmentAnnotation; |
49 |
|
import jalview.datamodel.AlignmentExportData; |
50 |
|
import jalview.datamodel.AlignmentI; |
51 |
|
import jalview.datamodel.AlignmentView; |
52 |
|
import jalview.datamodel.Annotation; |
53 |
|
import jalview.datamodel.ColumnSelection; |
54 |
|
import jalview.datamodel.ContactListI; |
55 |
|
import jalview.datamodel.ContactMatrixI; |
56 |
|
import jalview.datamodel.HiddenColumns; |
57 |
|
import jalview.datamodel.HiddenSequences; |
58 |
|
import jalview.datamodel.ProfilesI; |
59 |
|
import jalview.datamodel.SearchResultsI; |
60 |
|
import jalview.datamodel.Sequence; |
61 |
|
import jalview.datamodel.SequenceCollectionI; |
62 |
|
import jalview.datamodel.SequenceGroup; |
63 |
|
import jalview.datamodel.SequenceI; |
64 |
|
import jalview.gui.QuitHandler; |
65 |
|
import jalview.project.Jalview2XML; |
66 |
|
import jalview.renderer.ResidueShader; |
67 |
|
import jalview.renderer.ResidueShaderI; |
68 |
|
import jalview.schemes.ColourSchemeI; |
69 |
|
import jalview.structure.CommandListener; |
70 |
|
import jalview.structure.StructureSelectionManager; |
71 |
|
import jalview.structure.VamsasSource; |
72 |
|
import jalview.util.Comparison; |
73 |
|
import jalview.util.Constants; |
74 |
|
import jalview.util.MapList; |
75 |
|
import jalview.util.MappingUtils; |
76 |
|
import jalview.util.MessageManager; |
77 |
|
import jalview.viewmodel.styles.ViewStyle; |
78 |
|
import jalview.workers.AlignCalcManager; |
79 |
|
import jalview.workers.ComplementConsensusThread; |
80 |
|
import jalview.workers.ConsensusThread; |
81 |
|
import jalview.workers.SecondaryStructureConsensusThread; |
82 |
|
import jalview.workers.StrucConsensusThread; |
83 |
|
|
84 |
|
|
85 |
|
|
86 |
|
|
87 |
|
|
88 |
|
@author |
89 |
|
|
90 |
|
|
|
|
| 75.7% |
Uncovered Elements: 332 (1,364) |
Complexity: 469 |
Complexity Density: 0.61 |
|
91 |
|
public abstract class AlignmentViewport |
92 |
|
implements AlignViewportI, CommandListener, VamsasSource |
93 |
|
{ |
94 |
|
protected ViewportRanges ranges; |
95 |
|
|
96 |
|
protected ViewStyleI viewStyle = new ViewStyle(); |
97 |
|
|
98 |
|
|
99 |
|
|
100 |
|
|
101 |
|
|
102 |
|
AlignViewportI codingComplement = null; |
103 |
|
|
104 |
|
FeaturesDisplayedI featuresDisplayed = null; |
105 |
|
|
106 |
|
protected Deque<CommandI> historyList = new ArrayDeque<>(); |
107 |
|
|
108 |
|
protected Deque<CommandI> redoList = new ArrayDeque<>(); |
109 |
|
|
110 |
|
|
111 |
|
|
112 |
|
|
113 |
|
private boolean savedUpToDate = false; |
114 |
|
|
115 |
|
|
116 |
|
|
117 |
|
|
118 |
|
protected AlignmentI alignment; |
119 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
120 |
509 |
public AlignmentViewport(AlignmentI al)... |
121 |
|
{ |
122 |
509 |
setAlignment(al); |
123 |
509 |
ranges = new ViewportRanges(al); |
124 |
|
} |
125 |
|
|
126 |
|
|
127 |
|
@param |
128 |
|
@see |
129 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
130 |
0 |
@Override... |
131 |
|
public void setFontName(String name) |
132 |
|
{ |
133 |
0 |
viewStyle.setFontName(name); |
134 |
|
} |
135 |
|
|
136 |
|
|
137 |
|
@param |
138 |
|
@see |
139 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
140 |
0 |
@Override... |
141 |
|
public void setFontStyle(int style) |
142 |
|
{ |
143 |
0 |
viewStyle.setFontStyle(style); |
144 |
|
} |
145 |
|
|
146 |
|
|
147 |
|
@param |
148 |
|
@see |
149 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
150 |
0 |
@Override... |
151 |
|
public void setFontSize(int size) |
152 |
|
{ |
153 |
0 |
viewStyle.setFontSize(size); |
154 |
|
} |
155 |
|
|
156 |
|
|
157 |
|
@return |
158 |
|
@see |
159 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
160 |
0 |
@Override... |
161 |
|
public int getFontStyle() |
162 |
|
{ |
163 |
0 |
return viewStyle.getFontStyle(); |
164 |
|
} |
165 |
|
|
166 |
|
|
167 |
|
@return |
168 |
|
@see |
169 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
170 |
0 |
@Override... |
171 |
|
public String getFontName() |
172 |
|
{ |
173 |
0 |
return viewStyle.getFontName(); |
174 |
|
} |
175 |
|
|
176 |
|
|
177 |
|
@return |
178 |
|
@see |
179 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
180 |
0 |
@Override... |
181 |
|
public int getFontSize() |
182 |
|
{ |
183 |
0 |
return viewStyle.getFontSize(); |
184 |
|
} |
185 |
|
|
186 |
|
|
187 |
|
@param |
188 |
|
@see |
189 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
190 |
0 |
@Override... |
191 |
|
public void setUpperCasebold(boolean upperCasebold) |
192 |
|
{ |
193 |
0 |
viewStyle.setUpperCasebold(upperCasebold); |
194 |
|
} |
195 |
|
|
196 |
|
|
197 |
|
@return |
198 |
|
@see |
199 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
200 |
0 |
@Override... |
201 |
|
public boolean isUpperCasebold() |
202 |
|
{ |
203 |
0 |
return viewStyle.isUpperCasebold(); |
204 |
|
} |
205 |
|
|
206 |
|
|
207 |
|
@return |
208 |
|
@see |
209 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
210 |
2812 |
@Override... |
211 |
|
public boolean isSeqNameItalics() |
212 |
|
{ |
213 |
2812 |
return viewStyle.isSeqNameItalics(); |
214 |
|
} |
215 |
|
|
216 |
|
|
217 |
|
@param |
218 |
|
@see |
219 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
220 |
10 |
@Override... |
221 |
|
public void setColourByReferenceSeq(boolean colourByReferenceSeq) |
222 |
|
{ |
223 |
10 |
viewStyle.setColourByReferenceSeq(colourByReferenceSeq); |
224 |
|
} |
225 |
|
|
226 |
|
|
227 |
|
@param |
228 |
|
@see |
229 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
230 |
694 |
@Override... |
231 |
|
public void setColourAppliesToAllGroups(boolean b) |
232 |
|
{ |
233 |
694 |
viewStyle.setColourAppliesToAllGroups(b); |
234 |
|
} |
235 |
|
|
236 |
|
|
237 |
|
@return |
238 |
|
@see |
239 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
240 |
962 |
@Override... |
241 |
|
public boolean getColourAppliesToAllGroups() |
242 |
|
{ |
243 |
962 |
return viewStyle.getColourAppliesToAllGroups(); |
244 |
|
} |
245 |
|
|
246 |
|
|
247 |
|
@return |
248 |
|
@see |
249 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
250 |
878 |
@Override... |
251 |
|
public boolean getAbovePIDThreshold() |
252 |
|
{ |
253 |
878 |
return viewStyle.getAbovePIDThreshold(); |
254 |
|
} |
255 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
256 |
878 |
@Override... |
257 |
|
public boolean getByConsensusSecondaryStructureSelected() |
258 |
|
{ |
259 |
878 |
return viewStyle.getByConsensusSecondaryStructureSelected(); |
260 |
|
} |
261 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
262 |
85 |
public void setShowStructureProvider(boolean b)... |
263 |
|
{ |
264 |
85 |
viewStyle.setShowStructureProvider(b); |
265 |
|
} |
266 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
267 |
5868 |
public boolean isShowStructureProvider()... |
268 |
|
{ |
269 |
5868 |
return viewStyle.isShowStructureProvider(); |
270 |
|
} |
271 |
|
|
272 |
|
|
273 |
|
@param |
274 |
|
@see |
275 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
276 |
85 |
@Override... |
277 |
|
public void setIncrement(int inc) |
278 |
|
{ |
279 |
85 |
viewStyle.setIncrement(inc); |
280 |
|
} |
281 |
|
|
282 |
|
|
283 |
|
@return |
284 |
|
@see |
285 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
286 |
0 |
@Override... |
287 |
|
public int getIncrement() |
288 |
|
{ |
289 |
0 |
return viewStyle.getIncrement(); |
290 |
|
} |
291 |
|
|
292 |
|
|
293 |
|
@param |
294 |
|
@see |
295 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
296 |
85 |
@Override... |
297 |
|
public void setConsensusSecondaryStructureThreshold(int val) |
298 |
|
{ |
299 |
85 |
viewStyle.setConsensusSecondaryStructureThreshold(val); |
300 |
|
} |
301 |
|
|
302 |
|
|
303 |
|
@return |
304 |
|
@see |
305 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
306 |
0 |
@Override... |
307 |
|
public int getConsensusSecondaryStructureThreshold() |
308 |
|
{ |
309 |
0 |
return viewStyle.getConsensusSecondaryStructureThreshold(); |
310 |
|
} |
311 |
|
|
312 |
|
|
313 |
|
@param |
314 |
|
@see |
315 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
316 |
93 |
@Override... |
317 |
|
public void setConservationSelected(boolean b) |
318 |
|
{ |
319 |
93 |
viewStyle.setConservationSelected(b); |
320 |
|
} |
321 |
|
|
322 |
|
|
323 |
|
@param |
324 |
|
@see |
325 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
326 |
0 |
@Override... |
327 |
|
public void setShowHiddenMarkers(boolean show) |
328 |
|
{ |
329 |
0 |
viewStyle.setShowHiddenMarkers(show); |
330 |
|
} |
331 |
|
|
332 |
|
|
333 |
|
@return |
334 |
|
@see |
335 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
336 |
7018 |
@Override... |
337 |
|
public boolean getShowHiddenMarkers() |
338 |
|
{ |
339 |
7018 |
return viewStyle.getShowHiddenMarkers(); |
340 |
|
} |
341 |
|
|
342 |
|
|
343 |
|
@param |
344 |
|
@see |
345 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
346 |
9 |
@Override... |
347 |
|
public void setScaleRightWrapped(boolean b) |
348 |
|
{ |
349 |
9 |
viewStyle.setScaleRightWrapped(b); |
350 |
|
} |
351 |
|
|
352 |
|
|
353 |
|
@param |
354 |
|
@see |
355 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
356 |
11 |
@Override... |
357 |
|
public void setScaleLeftWrapped(boolean b) |
358 |
|
{ |
359 |
11 |
viewStyle.setScaleLeftWrapped(b); |
360 |
|
} |
361 |
|
|
362 |
|
|
363 |
|
@param |
364 |
|
@see |
365 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
366 |
9 |
@Override... |
367 |
|
public void setScaleAboveWrapped(boolean b) |
368 |
|
{ |
369 |
9 |
viewStyle.setScaleAboveWrapped(b); |
370 |
|
} |
371 |
|
|
372 |
|
|
373 |
|
@return |
374 |
|
@see |
375 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
376 |
1321 |
@Override... |
377 |
|
public boolean getScaleLeftWrapped() |
378 |
|
{ |
379 |
1321 |
return viewStyle.getScaleLeftWrapped(); |
380 |
|
} |
381 |
|
|
382 |
|
|
383 |
|
@return |
384 |
|
@see |
385 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
386 |
922 |
@Override... |
387 |
|
public boolean getScaleAboveWrapped() |
388 |
|
{ |
389 |
922 |
return viewStyle.getScaleAboveWrapped(); |
390 |
|
} |
391 |
|
|
392 |
|
|
393 |
|
@return |
394 |
|
@see |
395 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
396 |
2147 |
@Override... |
397 |
|
public boolean getScaleRightWrapped() |
398 |
|
{ |
399 |
2147 |
return viewStyle.getScaleRightWrapped(); |
400 |
|
} |
401 |
|
|
402 |
|
|
403 |
|
@param |
404 |
|
@see |
405 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
406 |
94 |
@Override... |
407 |
|
public void setAbovePIDThreshold(boolean b) |
408 |
|
{ |
409 |
94 |
viewStyle.setAbovePIDThreshold(b); |
410 |
|
} |
411 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
412 |
85 |
@Override... |
413 |
|
public void setByConsensusSecondaryStructureSelected(boolean b) |
414 |
|
{ |
415 |
85 |
viewStyle.setByConsensusSecondaryStructureSelected(b); |
416 |
|
} |
417 |
|
|
418 |
|
|
419 |
|
@param |
420 |
|
@see |
421 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
422 |
106 |
@Override... |
423 |
|
public void setThreshold(int thresh) |
424 |
|
{ |
425 |
106 |
viewStyle.setThreshold(thresh); |
426 |
|
} |
427 |
|
|
428 |
|
|
429 |
|
@return |
430 |
|
@see |
431 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
432 |
0 |
@Override... |
433 |
|
public int getThreshold() |
434 |
|
{ |
435 |
0 |
return viewStyle.getThreshold(); |
436 |
|
} |
437 |
|
|
438 |
|
|
439 |
|
@return |
440 |
|
@see |
441 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
442 |
43274 |
@Override... |
443 |
|
public boolean getShowJVSuffix() |
444 |
|
{ |
445 |
43274 |
return viewStyle.getShowJVSuffix(); |
446 |
|
} |
447 |
|
|
448 |
|
|
449 |
|
@param |
450 |
|
@see |
451 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
452 |
86 |
@Override... |
453 |
|
public void setShowJVSuffix(boolean b) |
454 |
|
{ |
455 |
86 |
viewStyle.setShowJVSuffix(b); |
456 |
|
} |
457 |
|
|
458 |
|
|
459 |
|
@param |
460 |
|
@see |
461 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
462 |
97 |
@Override... |
463 |
|
public void setWrapAlignment(boolean state) |
464 |
|
{ |
465 |
97 |
viewStyle.setWrapAlignment(state); |
466 |
97 |
ranges.setWrappedMode(state); |
467 |
|
} |
468 |
|
|
469 |
|
|
470 |
|
@param |
471 |
|
@see |
472 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
473 |
85 |
@Override... |
474 |
|
public void setShowText(boolean state) |
475 |
|
{ |
476 |
85 |
viewStyle.setShowText(state); |
477 |
|
} |
478 |
|
|
479 |
|
|
480 |
|
@param |
481 |
|
@see |
482 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
483 |
85 |
@Override... |
484 |
|
public void setRenderGaps(boolean state) |
485 |
|
{ |
486 |
85 |
viewStyle.setRenderGaps(state); |
487 |
|
} |
488 |
|
|
489 |
|
|
490 |
|
@return |
491 |
|
@see |
492 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
493 |
406640 |
@Override... |
494 |
|
public boolean getColourText() |
495 |
|
{ |
496 |
406640 |
return viewStyle.getColourText(); |
497 |
|
} |
498 |
|
|
499 |
|
|
500 |
|
@param |
501 |
|
@see |
502 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
503 |
85 |
@Override... |
504 |
|
public void setColourText(boolean state) |
505 |
|
{ |
506 |
85 |
viewStyle.setColourText(state); |
507 |
|
} |
508 |
|
|
509 |
|
|
510 |
|
@return |
511 |
|
@see |
512 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
513 |
28934 |
@Override... |
514 |
|
public boolean getWrapAlignment() |
515 |
|
{ |
516 |
28934 |
return viewStyle.getWrapAlignment(); |
517 |
|
} |
518 |
|
|
519 |
|
|
520 |
|
@return |
521 |
|
@see |
522 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
523 |
407312 |
@Override... |
524 |
|
public boolean getShowText() |
525 |
|
{ |
526 |
407312 |
return viewStyle.getShowText(); |
527 |
|
} |
528 |
|
|
529 |
|
|
530 |
|
@return |
531 |
|
@see |
532 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
533 |
2 |
@Override... |
534 |
|
public int getWrappedWidth() |
535 |
|
{ |
536 |
2 |
return viewStyle.getWrappedWidth(); |
537 |
|
} |
538 |
|
|
539 |
|
|
540 |
|
@param |
541 |
|
@see |
542 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
543 |
851 |
@Override... |
544 |
|
public void setWrappedWidth(int w) |
545 |
|
{ |
546 |
851 |
viewStyle.setWrappedWidth(w); |
547 |
|
} |
548 |
|
|
549 |
|
|
550 |
|
@return |
551 |
|
@see |
552 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
553 |
108668 |
@Override... |
554 |
|
public int getCharHeight() |
555 |
|
{ |
556 |
108668 |
return viewStyle.getCharHeight(); |
557 |
|
} |
558 |
|
|
559 |
|
|
560 |
|
@param |
561 |
|
@see |
562 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
563 |
597 |
@Override... |
564 |
|
public void setCharHeight(int h) |
565 |
|
{ |
566 |
597 |
viewStyle.setCharHeight(h); |
567 |
|
} |
568 |
|
|
569 |
|
|
570 |
|
@return |
571 |
|
@see |
572 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
573 |
1438408 |
@Override... |
574 |
|
public int getCharWidth() |
575 |
|
{ |
576 |
1438417 |
return viewStyle.getCharWidth(); |
577 |
|
} |
578 |
|
|
579 |
|
|
580 |
|
@param |
581 |
|
@see |
582 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
583 |
600 |
@Override... |
584 |
|
public void setCharWidth(int w) |
585 |
|
{ |
586 |
600 |
viewStyle.setCharWidth(w); |
587 |
|
} |
588 |
|
|
589 |
|
|
590 |
|
@return |
591 |
|
@see |
592 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
593 |
446153 |
@Override... |
594 |
|
public boolean getShowBoxes() |
595 |
|
{ |
596 |
446161 |
return viewStyle.getShowBoxes(); |
597 |
|
} |
598 |
|
|
599 |
|
|
600 |
|
@return |
601 |
|
@see |
602 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
603 |
404493 |
@Override... |
604 |
|
public boolean getShowUnconserved() |
605 |
|
{ |
606 |
404493 |
return viewStyle.getShowUnconserved(); |
607 |
|
} |
608 |
|
|
609 |
|
|
610 |
|
@param |
611 |
|
@see |
612 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
613 |
85 |
@Override... |
614 |
|
public void setShowUnconserved(boolean showunconserved) |
615 |
|
{ |
616 |
85 |
viewStyle.setShowUnconserved(showunconserved); |
617 |
|
} |
618 |
|
|
619 |
|
|
620 |
|
@param |
621 |
|
@see |
622 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
623 |
0 |
@Override... |
624 |
|
public void setSeqNameItalics(boolean default1) |
625 |
|
{ |
626 |
0 |
viewStyle.setSeqNameItalics(default1); |
627 |
|
} |
628 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
629 |
199136 |
@Override... |
630 |
|
public AlignmentI getAlignment() |
631 |
|
{ |
632 |
199136 |
return alignment; |
633 |
|
} |
634 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
635 |
0 |
@Override... |
636 |
|
public char getGapCharacter() |
637 |
|
{ |
638 |
0 |
return alignment.getGapCharacter(); |
639 |
|
} |
640 |
|
|
641 |
|
protected String sequenceSetID; |
642 |
|
|
643 |
|
|
644 |
|
|
645 |
|
|
646 |
|
|
647 |
|
protected boolean isDataset = false; |
648 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
649 |
0 |
public void setDataset(boolean b)... |
650 |
|
{ |
651 |
0 |
isDataset = b; |
652 |
|
} |
653 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
654 |
479 |
public boolean isDataset()... |
655 |
|
{ |
656 |
479 |
return isDataset; |
657 |
|
} |
658 |
|
|
659 |
|
private Map<SequenceI, SequenceCollectionI> hiddenRepSequences; |
660 |
|
|
661 |
|
protected ColumnSelection colSel = new ColumnSelection(); |
662 |
|
|
663 |
|
public boolean autoCalculateConsensus = true; |
664 |
|
|
665 |
|
protected boolean autoCalculateStrucConsensus = true; |
666 |
|
|
667 |
|
protected boolean ignoreGapsInConsensusCalculation = false; |
668 |
|
|
669 |
|
protected ResidueShaderI residueShading = new ResidueShader(); |
670 |
|
|
|
|
| 92% |
Uncovered Elements: 2 (25) |
Complexity: 7 |
Complexity Density: 0.54 |
|
671 |
274 |
@Override... |
672 |
|
public void setGlobalColourScheme(ColourSchemeI cs) |
673 |
|
{ |
674 |
|
|
675 |
|
|
676 |
|
|
677 |
|
|
678 |
|
|
679 |
|
|
680 |
|
|
681 |
|
|
682 |
|
|
683 |
|
|
684 |
|
|
685 |
|
|
686 |
|
|
687 |
274 |
if (residueShading == null) |
688 |
|
{ |
689 |
0 |
residueShading = new ResidueShader(viewStyle); |
690 |
|
} |
691 |
274 |
residueShading.setColourScheme(cs); |
692 |
|
|
693 |
|
|
694 |
|
|
695 |
|
|
696 |
274 |
if (cs != null) |
697 |
|
{ |
698 |
81 |
if (getConservationSelected()) |
699 |
|
{ |
700 |
15 |
residueShading.setConservation(hconservation); |
701 |
|
} |
702 |
|
|
703 |
|
|
704 |
|
|
705 |
|
|
706 |
81 |
residueShading.setConservationApplied(getConservationSelected()); |
707 |
81 |
residueShading.alignmentChanged(alignment, hiddenRepSequences); |
708 |
|
} |
709 |
|
|
710 |
|
|
711 |
|
|
712 |
|
|
713 |
|
|
714 |
274 |
if (getColourAppliesToAllGroups()) |
715 |
|
{ |
716 |
86 |
for (SequenceGroup sg : getAlignment().getGroups()) |
717 |
|
{ |
718 |
|
|
719 |
|
|
720 |
|
|
721 |
|
|
722 |
9 |
sg.setColourScheme(cs == null ? null : cs.getInstance(this, sg)); |
723 |
9 |
if (cs != null) |
724 |
|
{ |
725 |
8 |
sg.getGroupColourScheme().alignmentChanged(sg, |
726 |
|
hiddenRepSequences); |
727 |
|
} |
728 |
|
} |
729 |
|
} |
730 |
|
} |
731 |
|
|
|
|
| 66.7% |
Uncovered Elements: 1 (3) |
Complexity: 2 |
Complexity Density: 2 |
|
732 |
1399 |
@Override... |
733 |
|
public ColourSchemeI getGlobalColourScheme() |
734 |
|
{ |
735 |
1399 |
return residueShading == null ? null : residueShading.getColourScheme(); |
736 |
|
} |
737 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
738 |
450593 |
@Override... |
739 |
|
public ResidueShaderI getResidueShading() |
740 |
|
{ |
741 |
450593 |
return residueShading; |
742 |
|
} |
743 |
|
|
744 |
|
protected AlignmentAnnotation consensus; |
745 |
|
|
746 |
|
protected List<AlignmentAnnotation> secondaryStructureConsensus; |
747 |
|
|
748 |
|
protected AlignmentAnnotation complementConsensus; |
749 |
|
|
750 |
|
protected AlignmentAnnotation gapcounts; |
751 |
|
|
752 |
|
protected AlignmentAnnotation strucConsensus; |
753 |
|
|
754 |
|
protected AlignmentAnnotation conservation; |
755 |
|
|
756 |
|
protected AlignmentAnnotation quality; |
757 |
|
|
758 |
|
protected AlignmentAnnotation[] groupConsensus; |
759 |
|
|
760 |
|
protected AlignmentAnnotation[] groupSSConsensus; |
761 |
|
|
762 |
|
protected AlignmentAnnotation[] groupConservation; |
763 |
|
|
764 |
|
|
765 |
|
|
766 |
|
|
767 |
|
protected ProfilesI hconsensus = null; |
768 |
|
|
769 |
|
protected Map<String, ProfilesI> hSSConsensusProfileMap = null; |
770 |
|
|
771 |
|
|
772 |
|
|
773 |
|
|
774 |
|
|
775 |
|
protected Hashtable<String, Object>[] hcomplementConsensus = null; |
776 |
|
|
777 |
|
|
778 |
|
|
779 |
|
|
780 |
|
|
781 |
|
protected Hashtable<String, Object>[] hStrucConsensus = null; |
782 |
|
|
783 |
|
protected Conservation hconservation = null; |
784 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
785 |
996 |
@Override... |
786 |
|
public void setConservation(Conservation cons) |
787 |
|
{ |
788 |
996 |
hconservation = cons; |
789 |
|
} |
790 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
791 |
1481 |
@Override... |
792 |
|
public List<String> getSecondaryStructureSources() |
793 |
|
{ |
794 |
1481 |
return viewStyle.getSecondaryStructureSources(); |
795 |
|
} |
796 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
797 |
972 |
@Override... |
798 |
|
public void setSecondaryStructureSources( |
799 |
|
List<String> secondaryStructureSources) |
800 |
|
{ |
801 |
972 |
viewStyle.setSecondaryStructureSources(secondaryStructureSources); |
802 |
|
} |
803 |
|
|
|
|
| 90% |
Uncovered Elements: 1 (10) |
Complexity: 3 |
Complexity Density: 0.5 |
|
804 |
509 |
protected void setSecondaryStructureSources(AlignmentAnnotation[] aa)... |
805 |
|
{ |
806 |
509 |
List<String> sources = null; |
807 |
|
|
808 |
509 |
if (aa != null) |
809 |
|
{ |
810 |
417 |
sources = AlignmentUtils.extractSSSourceInAlignmentAnnotation(aa); |
811 |
417 |
if (sources != null) |
812 |
|
{ |
813 |
417 |
sources.add(0, Constants.SS_ALL_PROVIDERS); |
814 |
417 |
viewStyle.setSecondaryStructureSources(sources); |
815 |
|
} |
816 |
|
} |
817 |
|
} |
818 |
|
|
819 |
|
|
820 |
|
|
821 |
|
|
822 |
|
|
823 |
|
int ConsPercGaps = 25; |
824 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
825 |
1843 |
@Override... |
826 |
|
public int getConsPercGaps() |
827 |
|
{ |
828 |
1843 |
return ConsPercGaps; |
829 |
|
} |
830 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
831 |
960 |
@Override... |
832 |
|
public void setSequenceConsensusHash(ProfilesI hconsensus) |
833 |
|
{ |
834 |
960 |
this.hconsensus = hconsensus; |
835 |
|
} |
836 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
837 |
972 |
@Override... |
838 |
|
public void setSequenceSSConsensusHash( |
839 |
|
Map<String, ProfilesI> hSSConsensusProfileMap) |
840 |
|
{ |
841 |
972 |
this.hSSConsensusProfileMap = hSSConsensusProfileMap; |
842 |
|
} |
843 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
844 |
4 |
@Override... |
845 |
|
public void setComplementConsensusHash( |
846 |
|
Hashtable<String, Object>[] hconsensus) |
847 |
|
{ |
848 |
4 |
this.hcomplementConsensus = hconsensus; |
849 |
|
} |
850 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
851 |
3524 |
@Override... |
852 |
|
public ProfilesI getSequenceConsensusHash() |
853 |
|
{ |
854 |
3524 |
return hconsensus; |
855 |
|
} |
856 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
857 |
3537 |
@Override... |
858 |
|
public Map<String, ProfilesI> getSequenceSSConsensusHash() |
859 |
|
{ |
860 |
3537 |
return hSSConsensusProfileMap; |
861 |
|
} |
862 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
863 |
2467 |
@Override... |
864 |
|
public Hashtable<String, Object>[] getComplementConsensusHash() |
865 |
|
{ |
866 |
2467 |
return hcomplementConsensus; |
867 |
|
} |
868 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
869 |
2468 |
@Override... |
870 |
|
public Hashtable<String, Object>[] getRnaStructureConsensusHash() |
871 |
|
{ |
872 |
2468 |
return hStrucConsensus; |
873 |
|
} |
874 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
875 |
5 |
@Override... |
876 |
|
public void setRnaStructureConsensusHash( |
877 |
|
Hashtable<String, Object>[] hStrucConsensus) |
878 |
|
{ |
879 |
5 |
this.hStrucConsensus = hStrucConsensus; |
880 |
|
|
881 |
|
} |
882 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
883 |
1438 |
@Override... |
884 |
|
public AlignmentAnnotation getAlignmentQualityAnnot() |
885 |
|
{ |
886 |
1438 |
return quality; |
887 |
|
} |
888 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
889 |
2398 |
@Override... |
890 |
|
public AlignmentAnnotation getAlignmentConservationAnnotation() |
891 |
|
{ |
892 |
2398 |
return conservation; |
893 |
|
} |
894 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
895 |
5756 |
@Override... |
896 |
|
public AlignmentAnnotation getAlignmentConsensusAnnotation() |
897 |
|
{ |
898 |
5756 |
return consensus; |
899 |
|
} |
900 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
901 |
5443 |
@Override... |
902 |
|
public List<AlignmentAnnotation> getAlignmentSecondaryStructureConsensusAnnotation() |
903 |
|
{ |
904 |
5443 |
return secondaryStructureConsensus; |
905 |
|
} |
906 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
907 |
5884 |
@Override... |
908 |
|
public AlignmentAnnotation getAlignmentGapAnnotation() |
909 |
|
{ |
910 |
5884 |
return gapcounts; |
911 |
|
} |
912 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
913 |
2475 |
@Override... |
914 |
|
public AlignmentAnnotation getComplementConsensusAnnotation() |
915 |
|
{ |
916 |
2475 |
return complementConsensus; |
917 |
|
} |
918 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
919 |
2468 |
@Override... |
920 |
|
public AlignmentAnnotation getAlignmentStrucConsensusAnnotation() |
921 |
|
{ |
922 |
2468 |
return strucConsensus; |
923 |
|
} |
924 |
|
|
925 |
|
protected AlignCalcManagerI calculator = new AlignCalcManager(); |
926 |
|
|
927 |
|
|
928 |
|
|
929 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 6 |
Complexity Density: 1.5 |
|
930 |
1004 |
public void updateConservation(final AlignmentViewPanel ap)... |
931 |
|
{ |
932 |
|
|
933 |
1004 |
if (alignment.isNucleotide() |
934 |
|
|| (conservation == null && quality == null) |
935 |
|
|| !autoCalculateConsensus) |
936 |
|
{ |
937 |
219 |
return; |
938 |
|
} |
939 |
785 |
if (calculator.getRegisteredWorkersOfClass( |
940 |
|
jalview.workers.ConservationThread.class) == null) |
941 |
|
{ |
942 |
443 |
calculator.registerWorker( |
943 |
|
new jalview.workers.ConservationThread(this, ap)); |
944 |
|
} |
945 |
|
} |
946 |
|
|
947 |
|
|
948 |
|
|
949 |
|
|
|
|
| 81.5% |
Uncovered Elements: 5 (27) |
Complexity: 11 |
Complexity Density: 0.73 |
|
950 |
1010 |
public void updateConsensus(final AlignmentViewPanel ap)... |
951 |
|
{ |
952 |
|
|
953 |
1010 |
if (consensus == null || !autoCalculateConsensus) |
954 |
|
{ |
955 |
0 |
return; |
956 |
|
} |
957 |
1010 |
if (calculator |
958 |
|
.getRegisteredWorkersOfClass(ConsensusThread.class) == null) |
959 |
|
{ |
960 |
452 |
calculator.registerWorker(new ConsensusThread(this, ap)); |
961 |
|
} |
962 |
|
|
963 |
|
|
964 |
|
|
965 |
|
|
966 |
|
|
967 |
1010 |
final AlignmentI al = this.getAlignment(); |
968 |
1010 |
if (!al.isNucleotide() && al.getCodonFrames() != null |
969 |
|
&& !al.getCodonFrames().isEmpty()) |
970 |
|
{ |
971 |
|
|
972 |
|
|
973 |
|
|
974 |
|
|
975 |
4 |
boolean doConsensus = false; |
976 |
4 |
for (AlignedCodonFrame mapping : al.getCodonFrames()) |
977 |
|
{ |
978 |
|
|
979 |
4 |
MapList[] mapLists = mapping.getdnaToProt(); |
980 |
|
|
981 |
4 |
if (mapLists.length > 0 && mapLists[0].getFromRatio() == 3) |
982 |
|
{ |
983 |
4 |
doConsensus = true; |
984 |
4 |
break; |
985 |
|
} |
986 |
|
} |
987 |
4 |
if (doConsensus) |
988 |
|
{ |
989 |
4 |
if (calculator.getRegisteredWorkersOfClass( |
990 |
|
ComplementConsensusThread.class) == null) |
991 |
|
{ |
992 |
4 |
calculator |
993 |
|
.registerWorker(new ComplementConsensusThread(this, ap)); |
994 |
|
} |
995 |
|
} |
996 |
|
} |
997 |
|
} |
998 |
|
|
999 |
|
|
1000 |
|
|
1001 |
|
|
|
|
| 84.8% |
Uncovered Elements: 5 (33) |
Complexity: 8 |
Complexity Density: 0.38 |
|
1002 |
1010 |
public void updateSecondaryStructureConsensus(final AlignmentViewPanel ap)... |
1003 |
|
{ |
1004 |
|
|
1005 |
1010 |
if (secondaryStructureConsensus == null || !autoCalculateConsensus) |
1006 |
|
{ |
1007 |
0 |
return; |
1008 |
|
} |
1009 |
1010 |
List<String> ssSources = viewStyle.getSecondaryStructureSources(); |
1010 |
1010 |
if (secondaryStructureConsensus.size() != ssSources.size()) |
1011 |
|
{ |
1012 |
|
|
1013 |
75 |
for (String source : ssSources) |
1014 |
|
{ |
1015 |
89 |
boolean ssConsensusForSourcePresent = false; |
1016 |
89 |
for (AlignmentAnnotation aa : secondaryStructureConsensus) |
1017 |
|
{ |
1018 |
28 |
if (aa.description.startsWith(source)) |
1019 |
|
{ |
1020 |
14 |
ssConsensusForSourcePresent = true; |
1021 |
14 |
break; |
1022 |
|
} |
1023 |
|
} |
1024 |
|
|
1025 |
89 |
if (!ssConsensusForSourcePresent) |
1026 |
|
{ |
1027 |
75 |
AlignmentAnnotation ssConsensus = new AlignmentAnnotation( |
1028 |
|
MessageManager.getString("label.ssconsensus_label") + " " |
1029 |
|
+ source, |
1030 |
|
source + " " |
1031 |
|
+ MessageManager |
1032 |
|
.getString("label.ssconsensus_descr"), |
1033 |
|
new Annotation[1], 0f, 100f, |
1034 |
|
AlignmentAnnotation.BAR_GRAPH); |
1035 |
|
|
1036 |
75 |
ssConsensus.hasText = true; |
1037 |
75 |
ssConsensus.autoCalculated = true; |
1038 |
75 |
secondaryStructureConsensus.add(ssConsensus); |
1039 |
75 |
if (showSSConsensus) |
1040 |
|
{ |
1041 |
0 |
ssConsensus.visible = true; |
1042 |
0 |
alignment.addAnnotation(ssConsensus); |
1043 |
|
|
1044 |
|
} |
1045 |
|
} |
1046 |
|
} |
1047 |
|
} |
1048 |
1010 |
if (calculator.getRegisteredWorkersOfClass( |
1049 |
|
SecondaryStructureConsensusThread.class) == null) |
1050 |
|
{ |
1051 |
457 |
calculator.registerWorker( |
1052 |
|
new SecondaryStructureConsensusThread(this, ap)); |
1053 |
|
} |
1054 |
1009 |
ap.adjustAnnotationHeight(); |
1055 |
|
|
1056 |
|
} |
1057 |
|
|
1058 |
|
|
|
|
| 75% |
Uncovered Elements: 3 (12) |
Complexity: 8 |
Complexity Density: 1.33 |
|
1059 |
1006 |
public void updateStrucConsensus(final AlignmentViewPanel ap)... |
1060 |
|
{ |
1061 |
1006 |
if (autoCalculateStrucConsensus && strucConsensus == null |
1062 |
|
&& alignment.isNucleotide() && alignment.hasRNAStructure()) |
1063 |
|
{ |
1064 |
|
|
1065 |
0 |
initRNAStructure(); |
1066 |
|
} |
1067 |
|
|
1068 |
|
|
1069 |
1006 |
if (strucConsensus == null || !autoCalculateStrucConsensus) |
1070 |
|
{ |
1071 |
1003 |
return; |
1072 |
|
} |
1073 |
3 |
if (calculator.getRegisteredWorkersOfClass( |
1074 |
|
StrucConsensusThread.class) == null) |
1075 |
|
{ |
1076 |
3 |
calculator.registerWorker(new StrucConsensusThread(this, ap)); |
1077 |
|
} |
1078 |
|
} |
1079 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1080 |
2815 |
public boolean isCalcInProgress()... |
1081 |
|
{ |
1082 |
2815 |
return calculator.isWorking(); |
1083 |
|
} |
1084 |
|
|
|
|
| 77.8% |
Uncovered Elements: 2 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
1085 |
9673 |
@Override... |
1086 |
|
public boolean isCalculationInProgress( |
1087 |
|
AlignmentAnnotation alignmentAnnotation) |
1088 |
|
{ |
1089 |
9673 |
if (!alignmentAnnotation.autoCalculated) |
1090 |
|
{ |
1091 |
0 |
return false; |
1092 |
|
} |
1093 |
9673 |
if (calculator.workingInvolvedWith(alignmentAnnotation)) |
1094 |
|
{ |
1095 |
|
|
1096 |
|
|
1097 |
218 |
return true; |
1098 |
|
} |
1099 |
9455 |
return false; |
1100 |
|
} |
1101 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1102 |
762 |
public void setAlignment(AlignmentI align)... |
1103 |
|
{ |
1104 |
762 |
this.alignment = align; |
1105 |
|
} |
1106 |
|
|
1107 |
|
|
1108 |
|
|
1109 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (20) |
Complexity: 1 |
Complexity Density: 0.05 |
|
1110 |
253 |
@Override... |
1111 |
|
public void dispose() |
1112 |
|
{ |
1113 |
|
|
1114 |
|
|
1115 |
|
|
1116 |
|
|
1117 |
253 |
consensus = null; |
1118 |
253 |
complementConsensus = null; |
1119 |
253 |
strucConsensus = null; |
1120 |
253 |
secondaryStructureConsensus = null; |
1121 |
253 |
conservation = null; |
1122 |
253 |
quality = null; |
1123 |
253 |
groupConsensus = null; |
1124 |
253 |
groupConservation = null; |
1125 |
253 |
hconsensus = null; |
1126 |
253 |
hconservation = null; |
1127 |
253 |
hcomplementConsensus = null; |
1128 |
253 |
gapcounts = null; |
1129 |
253 |
calculator = null; |
1130 |
253 |
residueShading = null; |
1131 |
253 |
changeSupport = null; |
1132 |
253 |
ranges = null; |
1133 |
253 |
currentTree = null; |
1134 |
253 |
selectionGroup = null; |
1135 |
253 |
colSel = null; |
1136 |
253 |
setAlignment(null); |
1137 |
|
} |
1138 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1139 |
3952 |
@Override... |
1140 |
|
public boolean isClosed() |
1141 |
|
{ |
1142 |
|
|
1143 |
|
|
1144 |
3952 |
return alignment == null; |
1145 |
|
} |
1146 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1147 |
3199 |
@Override... |
1148 |
|
public AlignCalcManagerI getCalcManager() |
1149 |
|
{ |
1150 |
3199 |
return calculator; |
1151 |
|
} |
1152 |
|
|
1153 |
|
|
1154 |
|
|
1155 |
|
|
1156 |
|
protected boolean showGroupConservation = false; |
1157 |
|
|
1158 |
|
|
1159 |
|
|
1160 |
|
|
1161 |
|
protected boolean showGroupConsensus = false; |
1162 |
|
|
1163 |
|
protected boolean showGroupSSConsensus = false; |
1164 |
|
|
1165 |
|
|
1166 |
|
|
1167 |
|
|
1168 |
|
protected boolean showSequenceLogo = false; |
1169 |
|
|
1170 |
|
|
1171 |
|
|
1172 |
|
|
1173 |
|
protected boolean normaliseSequenceLogo = false; |
1174 |
|
|
1175 |
|
|
1176 |
|
|
1177 |
|
|
1178 |
|
protected boolean showConsensusHistogram = true; |
1179 |
|
|
1180 |
|
|
1181 |
|
@return |
1182 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1183 |
5238 |
@Override... |
1184 |
|
public boolean isShowSequenceLogo() |
1185 |
|
{ |
1186 |
5238 |
return showSequenceLogo; |
1187 |
|
} |
1188 |
|
|
1189 |
|
|
1190 |
|
@param |
1191 |
|
|
1192 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 2 |
Complexity Density: 0.29 |
|
1193 |
85 |
public void setShowSequenceLogo(boolean showSequenceLogo)... |
1194 |
|
{ |
1195 |
85 |
if (showSequenceLogo != this.showSequenceLogo) |
1196 |
|
{ |
1197 |
|
|
1198 |
|
|
1199 |
16 |
this.showSequenceLogo = showSequenceLogo; |
1200 |
16 |
calculator.updateAnnotationFor(ConsensusThread.class); |
1201 |
16 |
calculator.updateAnnotationFor(ComplementConsensusThread.class); |
1202 |
16 |
calculator.updateAnnotationFor(StrucConsensusThread.class); |
1203 |
|
|
1204 |
|
|
1205 |
|
|
1206 |
16 |
calculator |
1207 |
|
.updateAnnotationFor(SecondaryStructureConsensusThread.class); |
1208 |
|
} |
1209 |
85 |
this.showSequenceLogo = showSequenceLogo; |
1210 |
|
} |
1211 |
|
|
1212 |
|
|
1213 |
|
@param |
1214 |
|
|
1215 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1216 |
85 |
public void setShowConsensusHistogram(boolean showConsensusHistogram)... |
1217 |
|
{ |
1218 |
85 |
this.showConsensusHistogram = showConsensusHistogram; |
1219 |
|
} |
1220 |
|
|
1221 |
|
|
1222 |
|
@return |
1223 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1224 |
848 |
public boolean isShowGroupConservation()... |
1225 |
|
{ |
1226 |
848 |
return showGroupConservation; |
1227 |
|
} |
1228 |
|
|
1229 |
|
|
1230 |
|
@param |
1231 |
|
|
1232 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1233 |
85 |
public void setShowGroupConservation(boolean showGroupConservation)... |
1234 |
|
{ |
1235 |
85 |
this.showGroupConservation = showGroupConservation; |
1236 |
|
} |
1237 |
|
|
1238 |
|
|
1239 |
|
@return |
1240 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1241 |
848 |
public boolean isShowGroupConsensus()... |
1242 |
|
{ |
1243 |
848 |
return showGroupConsensus; |
1244 |
|
} |
1245 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1246 |
848 |
public boolean isShowGroupSSConsensus()... |
1247 |
|
{ |
1248 |
848 |
return showGroupSSConsensus; |
1249 |
|
} |
1250 |
|
|
1251 |
|
|
1252 |
|
@param |
1253 |
|
|
1254 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1255 |
85 |
public void setShowGroupConsensus(boolean showGroupConsensus)... |
1256 |
|
{ |
1257 |
85 |
this.showGroupConsensus = showGroupConsensus; |
1258 |
|
} |
1259 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1260 |
85 |
public void setShowGroupSSConsensus(boolean showGroupSSConsensus)... |
1261 |
|
{ |
1262 |
85 |
this.showGroupSSConsensus = showGroupSSConsensus; |
1263 |
|
} |
1264 |
|
|
1265 |
|
|
1266 |
|
@param |
1267 |
|
|
1268 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1269 |
0 |
public void setShowSSConsensus(boolean showSSConsensus)... |
1270 |
|
{ |
1271 |
0 |
this.showSSConsensus = showSSConsensus; |
1272 |
|
} |
1273 |
|
|
1274 |
|
|
1275 |
|
|
1276 |
|
@return |
1277 |
|
|
1278 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1279 |
3311 |
@Override... |
1280 |
|
public boolean isShowConsensusHistogram() |
1281 |
|
{ |
1282 |
3311 |
return this.showConsensusHistogram; |
1283 |
|
} |
1284 |
|
|
1285 |
|
|
1286 |
|
|
1287 |
|
|
1288 |
|
private boolean padGaps = false; |
1289 |
|
|
1290 |
|
|
1291 |
|
|
1292 |
|
|
1293 |
|
public boolean sortByTree = false; |
1294 |
|
|
1295 |
|
|
1296 |
|
|
1297 |
|
|
1298 |
|
@return |
1299 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1300 |
18821 |
@Override... |
1301 |
|
public SequenceGroup getSelectionGroup() |
1302 |
|
{ |
1303 |
18821 |
return selectionGroup; |
1304 |
|
} |
1305 |
|
|
1306 |
|
|
1307 |
|
|
1308 |
|
|
1309 |
|
|
1310 |
|
@param |
1311 |
|
|
1312 |
|
|
1313 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
1314 |
140 |
@Override... |
1315 |
|
public void setSelectionGroup(SequenceGroup sg) |
1316 |
|
{ |
1317 |
140 |
selectionGroup = sg; |
1318 |
140 |
if (sg != null && sg.getContext() == null) |
1319 |
|
{ |
1320 |
36 |
sg.setContext(alignment); |
1321 |
|
} |
1322 |
|
} |
1323 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1324 |
1 |
public void setHiddenColumns(HiddenColumns hidden)... |
1325 |
|
{ |
1326 |
1 |
this.alignment.setHiddenColumns(hidden); |
1327 |
|
} |
1328 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1329 |
4917 |
@Override... |
1330 |
|
public ColumnSelection getColumnSelection() |
1331 |
|
{ |
1332 |
4917 |
return colSel; |
1333 |
|
} |
1334 |
|
|
|
|
| 83.3% |
Uncovered Elements: 1 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
1335 |
13 |
@Override... |
1336 |
|
public void setColumnSelection(ColumnSelection colSel) |
1337 |
|
{ |
1338 |
13 |
this.colSel = colSel; |
1339 |
13 |
if (colSel != null) |
1340 |
|
{ |
1341 |
13 |
updateHiddenColumns(); |
1342 |
|
} |
1343 |
13 |
isColSelChanged(true); |
1344 |
|
} |
1345 |
|
|
1346 |
|
|
1347 |
|
|
1348 |
|
@return |
1349 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1350 |
32 |
@Override... |
1351 |
|
public Map<SequenceI, SequenceCollectionI> getHiddenRepSequences() |
1352 |
|
{ |
1353 |
32 |
return hiddenRepSequences; |
1354 |
|
} |
1355 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1356 |
0 |
@Override... |
1357 |
|
public void setHiddenRepSequences( |
1358 |
|
Map<SequenceI, SequenceCollectionI> hiddenRepSequences) |
1359 |
|
{ |
1360 |
0 |
this.hiddenRepSequences = hiddenRepSequences; |
1361 |
|
} |
1362 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
1363 |
0 |
@Override... |
1364 |
|
public boolean hasSelectedColumns() |
1365 |
|
{ |
1366 |
0 |
ColumnSelection columnSelection = getColumnSelection(); |
1367 |
0 |
return columnSelection != null && columnSelection.hasSelectedColumns(); |
1368 |
|
} |
1369 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1370 |
8775 |
@Override... |
1371 |
|
public boolean hasHiddenColumns() |
1372 |
|
{ |
1373 |
8775 |
return alignment.getHiddenColumns() != null |
1374 |
|
&& alignment.getHiddenColumns().hasHiddenColumns(); |
1375 |
|
} |
1376 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
1377 |
14 |
public void updateHiddenColumns()... |
1378 |
|
{ |
1379 |
|
|
1380 |
|
|
1381 |
|
|
1382 |
|
} |
1383 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1384 |
4140 |
@Override... |
1385 |
|
public boolean hasHiddenRows() |
1386 |
|
{ |
1387 |
4140 |
return alignment.getHiddenSequences().getSize() > 0; |
1388 |
|
} |
1389 |
|
|
1390 |
|
protected SequenceGroup selectionGroup; |
1391 |
|
|
|
|
| 80% |
Uncovered Elements: 1 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
1392 |
85 |
public void setSequenceSetId(String newid)... |
1393 |
|
{ |
1394 |
85 |
if (sequenceSetID != null) |
1395 |
|
{ |
1396 |
85 |
jalview.bin.Console.errPrintln( |
1397 |
|
"Warning - overwriting a sequenceSetId for a viewport!"); |
1398 |
|
} |
1399 |
85 |
sequenceSetID = new String(newid); |
1400 |
|
} |
1401 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
1402 |
4775 |
@Override... |
1403 |
|
public String getSequenceSetId() |
1404 |
|
{ |
1405 |
4775 |
if (sequenceSetID == null) |
1406 |
|
{ |
1407 |
365 |
sequenceSetID = alignment.hashCode() + ""; |
1408 |
|
} |
1409 |
|
|
1410 |
4775 |
return sequenceSetID; |
1411 |
|
} |
1412 |
|
|
1413 |
|
|
1414 |
|
|
1415 |
|
|
1416 |
|
|
1417 |
|
protected String viewId = null; |
1418 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
1419 |
598 |
@Override... |
1420 |
|
public String getViewId() |
1421 |
|
{ |
1422 |
598 |
if (viewId == null) |
1423 |
|
{ |
1424 |
300 |
viewId = this.getSequenceSetId() + "." + this.hashCode() + ""; |
1425 |
|
} |
1426 |
598 |
return viewId; |
1427 |
|
} |
1428 |
|
|
|
|
| 90% |
Uncovered Elements: 1 (10) |
Complexity: 3 |
Complexity Density: 0.5 |
|
1429 |
88 |
public void setIgnoreGapsConsensus(boolean b, AlignmentViewPanel ap)... |
1430 |
|
{ |
1431 |
88 |
ignoreGapsInConsensusCalculation = b; |
1432 |
88 |
if (ap != null) |
1433 |
|
{ |
1434 |
3 |
updateConsensus(ap); |
1435 |
3 |
updateSecondaryStructureConsensus(ap); |
1436 |
3 |
if (residueShading != null) |
1437 |
|
{ |
1438 |
3 |
residueShading.setThreshold(residueShading.getThreshold(), |
1439 |
|
ignoreGapsInConsensusCalculation); |
1440 |
|
} |
1441 |
|
} |
1442 |
|
|
1443 |
|
} |
1444 |
|
|
1445 |
|
private long sgrouphash = -1, colselhash = -1; |
1446 |
|
|
1447 |
|
|
1448 |
|
|
1449 |
|
|
1450 |
|
|
1451 |
|
@param |
1452 |
|
|
1453 |
|
|
1454 |
|
@return |
1455 |
|
|
|
|
| 91.7% |
Uncovered Elements: 1 (12) |
Complexity: 6 |
Complexity Density: 1 |
|
1456 |
161 |
public boolean isSelectionGroupChanged(boolean b)... |
1457 |
|
{ |
1458 |
161 |
int hc = (selectionGroup == null || selectionGroup.getSize() == 0) ? -1 |
1459 |
|
: selectionGroup.hashCode(); |
1460 |
161 |
if (hc != -1 && hc != sgrouphash) |
1461 |
|
{ |
1462 |
9 |
if (b) |
1463 |
|
{ |
1464 |
9 |
sgrouphash = hc; |
1465 |
|
} |
1466 |
9 |
return true; |
1467 |
|
} |
1468 |
152 |
return false; |
1469 |
|
} |
1470 |
|
|
1471 |
|
|
1472 |
|
|
1473 |
|
|
1474 |
|
|
1475 |
|
@param |
1476 |
|
|
1477 |
|
@return |
1478 |
|
|
|
|
| 91.7% |
Uncovered Elements: 1 (12) |
Complexity: 6 |
Complexity Density: 1 |
|
1479 |
173 |
public boolean isColSelChanged(boolean b)... |
1480 |
|
{ |
1481 |
173 |
int hc = (colSel == null || colSel.isEmpty()) ? -1 : colSel.hashCode(); |
1482 |
173 |
if (hc != -1 && hc != colselhash) |
1483 |
|
{ |
1484 |
17 |
if (b) |
1485 |
|
{ |
1486 |
17 |
colselhash = hc; |
1487 |
|
} |
1488 |
17 |
return true; |
1489 |
|
} |
1490 |
156 |
return false; |
1491 |
|
} |
1492 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1493 |
4459 |
@Override... |
1494 |
|
public boolean isIgnoreGapsConsensus() |
1495 |
|
{ |
1496 |
4459 |
return ignoreGapsInConsensusCalculation; |
1497 |
|
} |
1498 |
|
|
1499 |
|
|
1500 |
|
|
1501 |
|
private PropertyChangeSupport changeSupport = new PropertyChangeSupport( |
1502 |
|
this); |
1503 |
|
|
1504 |
|
protected boolean showConservation = true; |
1505 |
|
|
1506 |
|
protected boolean showQuality = true; |
1507 |
|
|
1508 |
|
protected boolean showConsensus = true; |
1509 |
|
|
1510 |
|
protected boolean showSSConsensus = true; |
1511 |
|
|
1512 |
|
protected boolean showOccupancy = true; |
1513 |
|
|
1514 |
|
private Map<SequenceI, Color> sequenceColours = new HashMap<>(); |
1515 |
|
|
1516 |
|
protected SequenceAnnotationOrder sortAnnotationsBy = null; |
1517 |
|
|
1518 |
|
protected boolean showAutocalculatedAbove; |
1519 |
|
|
1520 |
|
|
1521 |
|
|
1522 |
|
|
1523 |
|
private boolean followHighlight = true; |
1524 |
|
|
1525 |
|
|
1526 |
|
|
1527 |
|
|
1528 |
|
@param |
1529 |
|
|
1530 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1531 |
493 |
public void addPropertyChangeListener(... |
1532 |
|
java.beans.PropertyChangeListener listener) |
1533 |
|
{ |
1534 |
493 |
changeSupport.addPropertyChangeListener(listener); |
1535 |
|
} |
1536 |
|
|
1537 |
|
|
1538 |
|
|
1539 |
|
|
1540 |
|
@param |
1541 |
|
|
1542 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
1543 |
265 |
public void removePropertyChangeListener(... |
1544 |
|
java.beans.PropertyChangeListener listener) |
1545 |
|
{ |
1546 |
265 |
if (changeSupport != null) |
1547 |
|
{ |
1548 |
264 |
changeSupport.removePropertyChangeListener(listener); |
1549 |
|
} |
1550 |
|
} |
1551 |
|
|
1552 |
|
|
1553 |
|
|
1554 |
|
|
1555 |
|
@param |
1556 |
|
|
1557 |
|
@param |
1558 |
|
|
1559 |
|
@param |
1560 |
|
|
1561 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1562 |
78 |
public void firePropertyChange(String prop, Object oldvalue,... |
1563 |
|
Object newvalue) |
1564 |
|
{ |
1565 |
78 |
changeSupport.firePropertyChange(prop, oldvalue, newvalue); |
1566 |
|
} |
1567 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1568 |
0 |
@Override... |
1569 |
|
public void notifyAlignmentChanged() |
1570 |
|
{ |
1571 |
0 |
firePropertyChange("alignment", null, alignment); |
1572 |
|
} |
1573 |
|
|
1574 |
|
|
1575 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
1576 |
6 |
public void hideSelectedColumns()... |
1577 |
|
{ |
1578 |
6 |
if (colSel.isEmpty()) |
1579 |
|
{ |
1580 |
2 |
return; |
1581 |
|
} |
1582 |
|
|
1583 |
4 |
colSel.hideSelectedColumns(alignment); |
1584 |
4 |
setSelectionGroup(null); |
1585 |
4 |
isColSelChanged(true); |
1586 |
|
} |
1587 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
1588 |
71 |
public void hideColumns(int start, int end)... |
1589 |
|
{ |
1590 |
71 |
if (start == end) |
1591 |
|
{ |
1592 |
2 |
colSel.hideSelectedColumns(start, alignment.getHiddenColumns()); |
1593 |
|
} |
1594 |
|
else |
1595 |
|
{ |
1596 |
69 |
alignment.getHiddenColumns().hideColumns(start, end); |
1597 |
|
} |
1598 |
71 |
isColSelChanged(true); |
1599 |
|
} |
1600 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
1601 |
1 |
public void showColumn(int col)... |
1602 |
|
{ |
1603 |
1 |
alignment.getHiddenColumns().revealHiddenColumns(col, colSel); |
1604 |
1 |
isColSelChanged(true); |
1605 |
|
} |
1606 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
1607 |
5 |
public void showAllHiddenColumns()... |
1608 |
|
{ |
1609 |
5 |
alignment.getHiddenColumns().revealAllHiddenColumns(colSel); |
1610 |
5 |
isColSelChanged(true); |
1611 |
|
} |
1612 |
|
|
1613 |
|
|
|
|
| 77.8% |
Uncovered Elements: 4 (18) |
Complexity: 3 |
Complexity Density: 0.21 |
|
1614 |
1 |
public void showAllHiddenSeqs()... |
1615 |
|
{ |
1616 |
1 |
int startSeq = ranges.getStartSeq(); |
1617 |
1 |
int endSeq = ranges.getEndSeq(); |
1618 |
|
|
1619 |
1 |
if (alignment.getHiddenSequences().getSize() > 0) |
1620 |
|
{ |
1621 |
1 |
if (selectionGroup == null) |
1622 |
|
{ |
1623 |
0 |
selectionGroup = new SequenceGroup(); |
1624 |
0 |
selectionGroup.setEndRes(alignment.getWidth() - 1); |
1625 |
|
} |
1626 |
1 |
List<SequenceI> tmp = alignment.getHiddenSequences() |
1627 |
|
.showAll(hiddenRepSequences); |
1628 |
1 |
for (SequenceI seq : tmp) |
1629 |
|
{ |
1630 |
2 |
selectionGroup.addSequence(seq, false); |
1631 |
2 |
setSequenceAnnotationsVisible(seq, true); |
1632 |
|
} |
1633 |
|
|
1634 |
1 |
hiddenRepSequences = null; |
1635 |
|
|
1636 |
1 |
ranges.setStartEndSeq(startSeq, endSeq + tmp.size()); |
1637 |
|
|
1638 |
1 |
firePropertyChange("alignment", null, alignment.getSequences()); |
1639 |
|
|
1640 |
|
|
1641 |
1 |
sendSelection(); |
1642 |
|
} |
1643 |
|
} |
1644 |
|
|
|
|
| 88.2% |
Uncovered Elements: 2 (17) |
Complexity: 3 |
Complexity Density: 0.23 |
|
1645 |
2 |
public void showSequence(int index)... |
1646 |
|
{ |
1647 |
2 |
int startSeq = ranges.getStartSeq(); |
1648 |
2 |
int endSeq = ranges.getEndSeq(); |
1649 |
|
|
1650 |
2 |
List<SequenceI> tmp = alignment.getHiddenSequences().showSequence(index, |
1651 |
|
hiddenRepSequences); |
1652 |
2 |
if (tmp.size() > 0) |
1653 |
|
{ |
1654 |
2 |
if (selectionGroup == null) |
1655 |
|
{ |
1656 |
2 |
selectionGroup = new SequenceGroup(); |
1657 |
2 |
selectionGroup.setEndRes(alignment.getWidth() - 1); |
1658 |
|
} |
1659 |
|
|
1660 |
2 |
for (SequenceI seq : tmp) |
1661 |
|
{ |
1662 |
3 |
selectionGroup.addSequence(seq, false); |
1663 |
3 |
setSequenceAnnotationsVisible(seq, true); |
1664 |
|
} |
1665 |
|
|
1666 |
2 |
ranges.setStartEndSeq(startSeq, endSeq + tmp.size()); |
1667 |
|
|
1668 |
2 |
firePropertyChange("alignment", null, alignment.getSequences()); |
1669 |
2 |
sendSelection(); |
1670 |
|
} |
1671 |
|
} |
1672 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 3 |
Complexity Density: 0.6 |
|
1673 |
0 |
public void hideAllSelectedSeqs()... |
1674 |
|
{ |
1675 |
0 |
if (selectionGroup == null || selectionGroup.getSize() < 1) |
1676 |
|
{ |
1677 |
0 |
return; |
1678 |
|
} |
1679 |
|
|
1680 |
0 |
SequenceI[] seqs = selectionGroup.getSequencesInOrder(alignment); |
1681 |
|
|
1682 |
0 |
hideSequence(seqs); |
1683 |
|
|
1684 |
0 |
setSelectionGroup(null); |
1685 |
|
} |
1686 |
|
|
|
|
| 90.9% |
Uncovered Elements: 1 (11) |
Complexity: 3 |
Complexity Density: 0.43 |
|
1687 |
54 |
public void hideSequence(SequenceI[] seq)... |
1688 |
|
{ |
1689 |
|
|
1690 |
|
|
1691 |
|
|
1692 |
54 |
int startSeq = ranges.getStartSeq(); |
1693 |
|
|
1694 |
54 |
if (seq != null) |
1695 |
|
{ |
1696 |
252 |
for (int i = 0; i < seq.length; i++) |
1697 |
|
{ |
1698 |
198 |
alignment.getHiddenSequences().hideSequence(seq[i]); |
1699 |
198 |
setSequenceAnnotationsVisible(seq[i], false); |
1700 |
|
} |
1701 |
54 |
ranges.setStartSeq(startSeq); |
1702 |
54 |
firePropertyChange("alignment", null, alignment.getSequences()); |
1703 |
|
} |
1704 |
|
} |
1705 |
|
|
1706 |
|
|
1707 |
|
|
1708 |
|
|
1709 |
|
@param |
1710 |
|
|
1711 |
|
@param |
1712 |
|
|
1713 |
|
|
1714 |
|
|
|
|
| 43.8% |
Uncovered Elements: 9 (16) |
Complexity: 4 |
Complexity Density: 0.33 |
|
1715 |
3 |
public void hideSequences(SequenceI sequence, boolean representGroup)... |
1716 |
|
{ |
1717 |
3 |
if (selectionGroup == null || selectionGroup.getSize() < 1) |
1718 |
|
{ |
1719 |
0 |
hideSequence(new SequenceI[] { sequence }); |
1720 |
0 |
return; |
1721 |
|
} |
1722 |
|
|
1723 |
3 |
if (representGroup) |
1724 |
|
{ |
1725 |
3 |
hideRepSequences(sequence, selectionGroup); |
1726 |
3 |
setSelectionGroup(null); |
1727 |
3 |
return; |
1728 |
|
} |
1729 |
|
|
1730 |
0 |
int gsize = selectionGroup.getSize(); |
1731 |
0 |
SequenceI[] hseqs = selectionGroup.getSequences() |
1732 |
|
.toArray(new SequenceI[gsize]); |
1733 |
|
|
1734 |
0 |
hideSequence(hseqs); |
1735 |
0 |
setSelectionGroup(null); |
1736 |
0 |
sendSelection(); |
1737 |
|
} |
1738 |
|
|
1739 |
|
|
1740 |
|
|
1741 |
|
|
1742 |
|
@param |
1743 |
|
|
|
|
| 66.7% |
Uncovered Elements: 3 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
1744 |
203 |
protected void setSequenceAnnotationsVisible(SequenceI sequenceI,... |
1745 |
|
boolean visible) |
1746 |
|
{ |
1747 |
203 |
AlignmentAnnotation[] anns = alignment.getAlignmentAnnotation(); |
1748 |
203 |
if (anns != null) |
1749 |
|
{ |
1750 |
203 |
for (AlignmentAnnotation ann : anns) |
1751 |
|
{ |
1752 |
1033 |
if (ann.sequenceRef == sequenceI) |
1753 |
|
{ |
1754 |
0 |
ann.visible = visible; |
1755 |
|
} |
1756 |
|
} |
1757 |
|
} |
1758 |
|
} |
1759 |
|
|
|
|
| 80.8% |
Uncovered Elements: 5 (26) |
Complexity: 6 |
Complexity Density: 0.38 |
|
1760 |
5 |
public void hideRepSequences(SequenceI repSequence, SequenceGroup sg)... |
1761 |
|
{ |
1762 |
5 |
int sSize = sg.getSize(); |
1763 |
5 |
if (sSize < 2) |
1764 |
|
{ |
1765 |
0 |
return; |
1766 |
|
} |
1767 |
|
|
1768 |
5 |
if (hiddenRepSequences == null) |
1769 |
|
{ |
1770 |
5 |
hiddenRepSequences = new Hashtable<>(); |
1771 |
|
} |
1772 |
|
|
1773 |
5 |
hiddenRepSequences.put(repSequence, sg); |
1774 |
|
|
1775 |
|
|
1776 |
5 |
SequenceI[] seqs = new SequenceI[sSize - 1]; |
1777 |
5 |
int index = 0; |
1778 |
16 |
for (int i = 0; i < sSize; i++) |
1779 |
|
{ |
1780 |
11 |
if (sg.getSequenceAt(i) != repSequence) |
1781 |
|
{ |
1782 |
6 |
if (index == sSize - 1) |
1783 |
|
{ |
1784 |
0 |
return; |
1785 |
|
} |
1786 |
|
|
1787 |
6 |
seqs[index++] = sg.getSequenceAt(i); |
1788 |
|
} |
1789 |
|
} |
1790 |
5 |
sg.setSeqrep(repSequence); |
1791 |
5 |
sg.setHidereps(true); |
1792 |
5 |
hideSequence(seqs); |
1793 |
|
|
1794 |
|
} |
1795 |
|
|
1796 |
|
|
1797 |
|
|
1798 |
|
@return |
1799 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1800 |
0 |
public SequenceI getReferenceSeq()... |
1801 |
|
{ |
1802 |
0 |
return alignment.getSeqrep(); |
1803 |
|
} |
1804 |
|
|
1805 |
|
|
1806 |
|
@param |
1807 |
|
@return |
1808 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1809 |
5173 |
public boolean isReferenceSeq(SequenceI seq)... |
1810 |
|
{ |
1811 |
5173 |
return alignment.getSeqrep() == seq; |
1812 |
|
} |
1813 |
|
|
1814 |
|
|
1815 |
|
|
1816 |
|
@param |
1817 |
|
@return |
1818 |
|
|
1819 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1820 |
5240 |
public boolean isHiddenRepSequence(SequenceI seq)... |
1821 |
|
{ |
1822 |
5240 |
return (hiddenRepSequences != null |
1823 |
|
&& hiddenRepSequences.containsKey(seq)); |
1824 |
|
} |
1825 |
|
|
1826 |
|
|
1827 |
|
|
1828 |
|
@param |
1829 |
|
@return |
1830 |
|
|
1831 |
|
|
|
|
| 66.7% |
Uncovered Elements: 1 (3) |
Complexity: 2 |
Complexity Density: 2 |
|
1832 |
2 |
public SequenceGroup getRepresentedSequences(SequenceI seq)... |
1833 |
|
{ |
1834 |
2 |
return (SequenceGroup) (hiddenRepSequences == null ? null |
1835 |
|
: hiddenRepSequences.get(seq)); |
1836 |
|
} |
1837 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1838 |
0 |
@Override... |
1839 |
|
public int adjustForHiddenSeqs(int alignmentIndex) |
1840 |
|
{ |
1841 |
0 |
return alignment.getHiddenSequences() |
1842 |
|
.adjustForHiddenSeqs(alignmentIndex); |
1843 |
|
} |
1844 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
1845 |
0 |
@Override... |
1846 |
|
public void invertColumnSelection() |
1847 |
|
{ |
1848 |
0 |
colSel.invertColumnSelection(0, alignment.getWidth(), alignment); |
1849 |
0 |
isColSelChanged(true); |
1850 |
|
} |
1851 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (12) |
Complexity: 4 |
Complexity Density: 0.5 |
|
1852 |
4 |
@Override... |
1853 |
|
public SequenceI[] getSelectionAsNewSequence() |
1854 |
|
{ |
1855 |
4 |
SequenceI[] sequences; |
1856 |
|
|
1857 |
|
|
1858 |
|
|
1859 |
|
|
1860 |
|
|
1861 |
4 |
if (selectionGroup == null || selectionGroup.getSize() == 0) |
1862 |
|
{ |
1863 |
2 |
sequences = alignment.getSequencesArray(); |
1864 |
2 |
AlignmentAnnotation[] annots = alignment.getAlignmentAnnotation(); |
1865 |
4 |
for (int i = 0; i < sequences.length; i++) |
1866 |
|
{ |
1867 |
|
|
1868 |
2 |
sequences[i] = new Sequence(sequences[i], annots); |
1869 |
|
} |
1870 |
|
} |
1871 |
|
else |
1872 |
|
{ |
1873 |
2 |
sequences = selectionGroup.getSelectionAsNewSequences(alignment); |
1874 |
|
} |
1875 |
|
|
1876 |
4 |
return sequences; |
1877 |
|
} |
1878 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (10) |
Complexity: 3 |
Complexity Density: 0.5 |
|
1879 |
28 |
@Override... |
1880 |
|
public SequenceI[] getSequenceSelection() |
1881 |
|
{ |
1882 |
28 |
SequenceI[] sequences = null; |
1883 |
28 |
if (selectionGroup != null) |
1884 |
|
{ |
1885 |
4 |
sequences = selectionGroup.getSequencesInOrder(alignment); |
1886 |
|
} |
1887 |
28 |
if (sequences == null) |
1888 |
|
{ |
1889 |
24 |
sequences = alignment.getSequencesArray(); |
1890 |
|
} |
1891 |
28 |
return sequences; |
1892 |
|
} |
1893 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1894 |
20 |
@Override... |
1895 |
|
public jalview.datamodel.AlignmentView getAlignmentView( |
1896 |
|
boolean selectedOnly) |
1897 |
|
{ |
1898 |
20 |
return getAlignmentView(selectedOnly, false); |
1899 |
|
} |
1900 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1901 |
21 |
@Override... |
1902 |
|
public jalview.datamodel.AlignmentView getAlignmentView( |
1903 |
|
boolean selectedOnly, boolean markGroups) |
1904 |
|
{ |
1905 |
21 |
return new AlignmentView(alignment, alignment.getHiddenColumns(), |
1906 |
|
selectionGroup, |
1907 |
|
alignment.getHiddenColumns() != null |
1908 |
|
&& alignment.getHiddenColumns().hasHiddenColumns(), |
1909 |
|
selectedOnly, markGroups); |
1910 |
|
} |
1911 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1912 |
24 |
@Override... |
1913 |
|
public String[] getViewAsString(boolean selectedRegionOnly) |
1914 |
|
{ |
1915 |
24 |
return getViewAsString(selectedRegionOnly, true); |
1916 |
|
} |
1917 |
|
|
|
|
| 71.4% |
Uncovered Elements: 10 (35) |
Complexity: 9 |
Complexity Density: 0.36 |
|
1918 |
24 |
@Override... |
1919 |
|
public String[] getViewAsString(boolean selectedRegionOnly, |
1920 |
|
boolean exportHiddenSeqs) |
1921 |
|
{ |
1922 |
24 |
String[] selection = null; |
1923 |
24 |
SequenceI[] seqs = null; |
1924 |
24 |
int i, iSize; |
1925 |
24 |
int start = 0, end = 0; |
1926 |
24 |
if (selectedRegionOnly && selectionGroup != null) |
1927 |
|
{ |
1928 |
0 |
iSize = selectionGroup.getSize(); |
1929 |
0 |
seqs = selectionGroup.getSequencesInOrder(alignment); |
1930 |
0 |
start = selectionGroup.getStartRes(); |
1931 |
0 |
end = selectionGroup.getEndRes() + 1; |
1932 |
|
} |
1933 |
|
else |
1934 |
|
{ |
1935 |
24 |
if (hasHiddenRows() && exportHiddenSeqs) |
1936 |
|
{ |
1937 |
0 |
AlignmentI fullAlignment = alignment.getHiddenSequences() |
1938 |
|
.getFullAlignment(); |
1939 |
0 |
iSize = fullAlignment.getHeight(); |
1940 |
0 |
seqs = fullAlignment.getSequencesArray(); |
1941 |
0 |
end = fullAlignment.getWidth(); |
1942 |
|
} |
1943 |
|
else |
1944 |
|
{ |
1945 |
24 |
iSize = alignment.getHeight(); |
1946 |
24 |
seqs = alignment.getSequencesArray(); |
1947 |
24 |
end = alignment.getWidth(); |
1948 |
|
} |
1949 |
|
} |
1950 |
|
|
1951 |
24 |
selection = new String[iSize]; |
1952 |
24 |
if (alignment.getHiddenColumns() != null |
1953 |
|
&& alignment.getHiddenColumns().hasHiddenColumns()) |
1954 |
|
{ |
1955 |
206 |
for (i = 0; i < iSize; i++) |
1956 |
|
{ |
1957 |
188 |
Iterator<int[]> blocks = alignment.getHiddenColumns() |
1958 |
|
.getVisContigsIterator(start, end + 1, false); |
1959 |
188 |
selection[i] = seqs[i].getSequenceStringFromIterator(blocks); |
1960 |
|
} |
1961 |
|
} |
1962 |
|
else |
1963 |
|
{ |
1964 |
36 |
for (i = 0; i < iSize; i++) |
1965 |
|
{ |
1966 |
30 |
selection[i] = seqs[i].getSequenceAsString(start, end); |
1967 |
|
} |
1968 |
|
|
1969 |
|
} |
1970 |
24 |
return selection; |
1971 |
|
} |
1972 |
|
|
|
|
| 0% |
Uncovered Elements: 30 (30) |
Complexity: 9 |
Complexity Density: 0.5 |
|
1973 |
0 |
@Override... |
1974 |
|
public List<int[]> getVisibleRegionBoundaries(int min, int max) |
1975 |
|
{ |
1976 |
0 |
ArrayList<int[]> regions = new ArrayList<>(); |
1977 |
0 |
int start = min; |
1978 |
0 |
int end = max; |
1979 |
|
|
1980 |
0 |
do |
1981 |
|
{ |
1982 |
0 |
HiddenColumns hidden = alignment.getHiddenColumns(); |
1983 |
0 |
if (hidden != null && hidden.hasHiddenColumns()) |
1984 |
|
{ |
1985 |
0 |
if (start == 0) |
1986 |
|
{ |
1987 |
0 |
start = hidden.visibleToAbsoluteColumn(start); |
1988 |
|
} |
1989 |
|
|
1990 |
0 |
end = hidden.getNextHiddenBoundary(false, start); |
1991 |
0 |
if (start == end) |
1992 |
|
{ |
1993 |
0 |
end = max; |
1994 |
|
} |
1995 |
0 |
if (end > max) |
1996 |
|
{ |
1997 |
0 |
end = max; |
1998 |
|
} |
1999 |
|
} |
2000 |
|
|
2001 |
0 |
regions.add(new int[] { start, end }); |
2002 |
|
|
2003 |
0 |
if (hidden != null && hidden.hasHiddenColumns()) |
2004 |
|
{ |
2005 |
0 |
start = hidden.visibleToAbsoluteColumn(end); |
2006 |
0 |
start = hidden.getNextHiddenBoundary(true, start) + 1; |
2007 |
|
} |
2008 |
0 |
} while (end < max); |
2009 |
|
|
2010 |
|
|
2011 |
|
|
2012 |
0 |
return regions; |
2013 |
|
} |
2014 |
|
|
|
|
| 71.4% |
Uncovered Elements: 4 (14) |
Complexity: 4 |
Complexity Density: 0.4 |
|
2015 |
1 |
@Override... |
2016 |
|
public List<AlignmentAnnotation> getVisibleAlignmentAnnotation( |
2017 |
|
boolean selectedOnly) |
2018 |
|
{ |
2019 |
1 |
ArrayList<AlignmentAnnotation> ala = new ArrayList<>(); |
2020 |
1 |
AlignmentAnnotation[] aa; |
2021 |
? |
if ((aa = alignment.getAlignmentAnnotation()) != null) |
2022 |
|
{ |
2023 |
1 |
for (AlignmentAnnotation annot : aa) |
2024 |
|
{ |
2025 |
4 |
AlignmentAnnotation clone = new AlignmentAnnotation(annot); |
2026 |
4 |
if (selectedOnly && selectionGroup != null) |
2027 |
|
{ |
2028 |
4 |
clone.makeVisibleAnnotation(selectionGroup.getStartRes(), |
2029 |
|
selectionGroup.getEndRes(), alignment.getHiddenColumns()); |
2030 |
|
} |
2031 |
|
else |
2032 |
|
{ |
2033 |
0 |
clone.makeVisibleAnnotation(alignment.getHiddenColumns()); |
2034 |
|
} |
2035 |
4 |
ala.add(clone); |
2036 |
|
} |
2037 |
|
} |
2038 |
1 |
return ala; |
2039 |
|
} |
2040 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2041 |
1679 |
@Override... |
2042 |
|
public boolean isPadGaps() |
2043 |
|
{ |
2044 |
1679 |
return padGaps; |
2045 |
|
} |
2046 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2047 |
509 |
@Override... |
2048 |
|
public void setPadGaps(boolean padGaps) |
2049 |
|
{ |
2050 |
509 |
this.padGaps = padGaps; |
2051 |
|
} |
2052 |
|
|
2053 |
|
|
2054 |
|
|
2055 |
|
|
2056 |
|
|
2057 |
|
@param |
2058 |
|
|
|
|
| 78.8% |
Uncovered Elements: 7 (33) |
Complexity: 10 |
Complexity Density: 0.53 |
|
2059 |
549 |
@Override... |
2060 |
|
public void alignmentChanged(AlignmentViewPanel ap) |
2061 |
|
{ |
2062 |
549 |
if (isPadGaps()) |
2063 |
|
{ |
2064 |
310 |
alignment.padGaps(); |
2065 |
|
} |
2066 |
549 |
if (autoCalculateConsensus) |
2067 |
|
{ |
2068 |
549 |
updateConsensus(ap); |
2069 |
549 |
updateSecondaryStructureConsensus(ap); |
2070 |
|
} |
2071 |
549 |
if (hconsensus != null && autoCalculateConsensus) |
2072 |
|
{ |
2073 |
546 |
updateConservation(ap); |
2074 |
|
} |
2075 |
549 |
if (autoCalculateStrucConsensus) |
2076 |
|
{ |
2077 |
549 |
updateStrucConsensus(ap); |
2078 |
|
} |
2079 |
|
|
2080 |
|
|
2081 |
549 |
int alWidth = alignment.getWidth(); |
2082 |
549 |
List<SequenceGroup> groups = alignment.getGroups(); |
2083 |
549 |
if (groups != null) |
2084 |
|
{ |
2085 |
549 |
for (SequenceGroup sg : groups) |
2086 |
|
{ |
2087 |
175 |
if (sg.getEndRes() > alWidth) |
2088 |
|
{ |
2089 |
0 |
sg.setEndRes(alWidth - 1); |
2090 |
|
} |
2091 |
|
} |
2092 |
|
} |
2093 |
|
|
2094 |
549 |
if (selectionGroup != null && selectionGroup.getEndRes() > alWidth) |
2095 |
|
{ |
2096 |
0 |
selectionGroup.setEndRes(alWidth - 1); |
2097 |
|
} |
2098 |
|
|
2099 |
549 |
updateAllColourSchemes(); |
2100 |
549 |
calculator.restartWorkers(); |
2101 |
|
|
2102 |
|
} |
2103 |
|
|
2104 |
|
|
2105 |
|
|
2106 |
|
|
|
|
| 87.5% |
Uncovered Elements: 2 (16) |
Complexity: 4 |
Complexity Density: 0.4 |
|
2107 |
549 |
void updateAllColourSchemes()... |
2108 |
|
{ |
2109 |
549 |
ResidueShaderI rs = residueShading; |
2110 |
549 |
if (rs != null) |
2111 |
|
{ |
2112 |
549 |
rs.alignmentChanged(alignment, hiddenRepSequences); |
2113 |
|
|
2114 |
549 |
rs.setConsensus(hconsensus); |
2115 |
549 |
if (rs.conservationApplied()) |
2116 |
|
{ |
2117 |
3 |
rs.setConservation(Conservation.calculateConservation("All", |
2118 |
|
alignment.getSequences(), 0, alignment.getWidth(), false, |
2119 |
|
getConsPercGaps(), false)); |
2120 |
|
} |
2121 |
|
} |
2122 |
|
|
2123 |
549 |
for (SequenceGroup sg : alignment.getGroups()) |
2124 |
|
{ |
2125 |
175 |
if (sg.cs != null) |
2126 |
|
{ |
2127 |
175 |
sg.cs.alignmentChanged(sg, hiddenRepSequences); |
2128 |
|
} |
2129 |
175 |
sg.recalcConservation(); |
2130 |
|
} |
2131 |
|
} |
2132 |
|
|
|
|
| 91.3% |
Uncovered Elements: 2 (23) |
Complexity: 5 |
Complexity Density: 0.29 |
|
2133 |
509 |
protected void initAutoAnnotation()... |
2134 |
|
{ |
2135 |
|
|
2136 |
|
|
2137 |
|
|
2138 |
|
|
2139 |
509 |
if (hconsensus == null && !isDataset) |
2140 |
|
{ |
2141 |
509 |
if (!alignment.isNucleotide()) |
2142 |
|
{ |
2143 |
398 |
initConservation(); |
2144 |
398 |
initQuality(); |
2145 |
|
} |
2146 |
|
else |
2147 |
|
{ |
2148 |
111 |
initRNAStructure(); |
2149 |
|
} |
2150 |
509 |
consensus = new AlignmentAnnotation("Consensus", |
2151 |
|
MessageManager.getString("label.consensus_descr"), |
2152 |
|
new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH); |
2153 |
509 |
setSecondaryStructureSources(alignment.getAlignmentAnnotation()); |
2154 |
509 |
List<String> secondaryStructureSources = getSecondaryStructureSources(); |
2155 |
|
|
2156 |
509 |
if (secondaryStructureSources != null) |
2157 |
|
{ |
2158 |
|
|
2159 |
509 |
secondaryStructureConsensus = new ArrayList<AlignmentAnnotation>(); |
2160 |
509 |
for (String ssSource : secondaryStructureSources) |
2161 |
|
{ |
2162 |
|
|
2163 |
435 |
AlignmentAnnotation ssConsensus = new AlignmentAnnotation( |
2164 |
|
MessageManager.getString("label.ssconsensus_label") + " " |
2165 |
|
+ ssSource, |
2166 |
|
ssSource + " " |
2167 |
|
+ MessageManager |
2168 |
|
.getString("label.ssconsensus_descr"), |
2169 |
|
new Annotation[1], 0f, 100f, |
2170 |
|
AlignmentAnnotation.BAR_GRAPH); |
2171 |
435 |
secondaryStructureConsensus.add(ssConsensus); |
2172 |
|
} |
2173 |
|
|
2174 |
|
} |
2175 |
|
|
2176 |
509 |
initConsensus(consensus); |
2177 |
509 |
initSSConsensus(secondaryStructureConsensus); |
2178 |
509 |
initGapCounts(); |
2179 |
509 |
initComplementConsensus(); |
2180 |
|
} |
2181 |
|
} |
2182 |
|
|
2183 |
|
|
2184 |
|
|
2185 |
|
|
2186 |
|
|
|
|
| 90.9% |
Uncovered Elements: 2 (22) |
Complexity: 7 |
Complexity Density: 0.5 |
|
2187 |
519 |
public boolean initComplementConsensus()... |
2188 |
|
{ |
2189 |
519 |
if (!alignment.isNucleotide()) |
2190 |
|
{ |
2191 |
407 |
final List<AlignedCodonFrame> codonMappings = alignment |
2192 |
|
.getCodonFrames(); |
2193 |
407 |
if (codonMappings != null && !codonMappings.isEmpty()) |
2194 |
|
{ |
2195 |
4 |
boolean doConsensus = false; |
2196 |
4 |
for (AlignedCodonFrame mapping : codonMappings) |
2197 |
|
{ |
2198 |
|
|
2199 |
4 |
MapList[] mapLists = mapping.getdnaToProt(); |
2200 |
|
|
2201 |
|
|
2202 |
4 |
if (mapLists.length > 0 && mapLists[0].getFromRatio() == 3) |
2203 |
|
{ |
2204 |
4 |
doConsensus = true; |
2205 |
4 |
break; |
2206 |
|
} |
2207 |
|
} |
2208 |
4 |
if (doConsensus) |
2209 |
|
{ |
2210 |
4 |
complementConsensus = new AlignmentAnnotation("cDNA Consensus", |
2211 |
|
MessageManager |
2212 |
|
.getString("label.complement_consensus_descr"), |
2213 |
|
new Annotation[1], 0f, 100f, |
2214 |
|
AlignmentAnnotation.BAR_GRAPH); |
2215 |
4 |
initConsensus(complementConsensus); |
2216 |
4 |
return true; |
2217 |
|
} |
2218 |
|
} |
2219 |
|
} |
2220 |
515 |
return false; |
2221 |
|
} |
2222 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
2223 |
513 |
private void initConsensus(AlignmentAnnotation aa)... |
2224 |
|
{ |
2225 |
513 |
aa.hasText = true; |
2226 |
513 |
aa.autoCalculated = true; |
2227 |
|
|
2228 |
513 |
if (showConsensus) |
2229 |
|
{ |
2230 |
512 |
alignment.addAnnotation(aa); |
2231 |
|
} |
2232 |
|
} |
2233 |
|
|
|
|
| 63.6% |
Uncovered Elements: 4 (11) |
Complexity: 3 |
Complexity Density: 0.43 |
|
2234 |
509 |
private void initSSConsensus(... |
2235 |
|
List<AlignmentAnnotation> secondaryStructureConsensuses) |
2236 |
|
{ |
2237 |
509 |
if (secondaryStructureConsensuses == null) |
2238 |
|
{ |
2239 |
0 |
return; |
2240 |
|
} |
2241 |
509 |
for (AlignmentAnnotation aa : secondaryStructureConsensuses) |
2242 |
|
{ |
2243 |
435 |
aa.hasText = true; |
2244 |
435 |
aa.autoCalculated = true; |
2245 |
|
|
2246 |
435 |
if (showSSConsensus) |
2247 |
|
{ |
2248 |
0 |
alignment.addAnnotation(aa); |
2249 |
|
} |
2250 |
|
|
2251 |
|
} |
2252 |
|
} |
2253 |
|
|
2254 |
|
|
2255 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 2 |
Complexity Density: 0.29 |
|
2256 |
509 |
private void initGapCounts()... |
2257 |
|
{ |
2258 |
509 |
if (showOccupancy) |
2259 |
|
{ |
2260 |
505 |
gapcounts = new AlignmentAnnotation("Occupancy", |
2261 |
|
MessageManager.getString("label.occupancy_descr"), |
2262 |
|
new Annotation[1], 0f, alignment.getHeight(), |
2263 |
|
AlignmentAnnotation.BAR_GRAPH); |
2264 |
505 |
gapcounts.hasText = true; |
2265 |
505 |
gapcounts.autoCalculated = true; |
2266 |
505 |
gapcounts.scaleColLabel = true; |
2267 |
505 |
gapcounts.graph = AlignmentAnnotation.BAR_GRAPH; |
2268 |
|
|
2269 |
505 |
alignment.addAnnotation(gapcounts); |
2270 |
|
} |
2271 |
|
} |
2272 |
|
|
|
|
| 90% |
Uncovered Elements: 1 (10) |
Complexity: 3 |
Complexity Density: 0.5 |
|
2273 |
398 |
private void initConservation()... |
2274 |
|
{ |
2275 |
398 |
if (showConservation) |
2276 |
|
{ |
2277 |
397 |
if (conservation == null) |
2278 |
|
{ |
2279 |
397 |
conservation = new AlignmentAnnotation("Conservation", |
2280 |
|
MessageManager.formatMessage("label.conservation_descr", |
2281 |
|
getConsPercGaps()), |
2282 |
|
new Annotation[1], 0f, 11f, AlignmentAnnotation.BAR_GRAPH); |
2283 |
397 |
conservation.hasText = true; |
2284 |
397 |
conservation.autoCalculated = true; |
2285 |
397 |
alignment.addAnnotation(conservation); |
2286 |
|
} |
2287 |
|
} |
2288 |
|
} |
2289 |
|
|
|
|
| 80% |
Uncovered Elements: 2 (10) |
Complexity: 3 |
Complexity Density: 0.5 |
|
2290 |
398 |
private void initQuality()... |
2291 |
|
{ |
2292 |
398 |
if (showQuality) |
2293 |
|
{ |
2294 |
398 |
if (quality == null) |
2295 |
|
{ |
2296 |
398 |
quality = new AlignmentAnnotation("Quality", |
2297 |
|
MessageManager.getString("label.quality_descr"), |
2298 |
|
new Annotation[1], 0f, 11f, AlignmentAnnotation.BAR_GRAPH); |
2299 |
398 |
quality.hasText = true; |
2300 |
398 |
quality.autoCalculated = true; |
2301 |
398 |
alignment.addAnnotation(quality); |
2302 |
|
} |
2303 |
|
} |
2304 |
|
} |
2305 |
|
|
|
|
| 90% |
Uncovered Elements: 1 (10) |
Complexity: 4 |
Complexity Density: 0.67 |
|
2306 |
111 |
private void initRNAStructure()... |
2307 |
|
{ |
2308 |
111 |
if (alignment.hasRNAStructure() && strucConsensus == null) |
2309 |
|
{ |
2310 |
2 |
strucConsensus = new AlignmentAnnotation("StrucConsensus", |
2311 |
|
MessageManager.getString("label.strucconsensus_descr"), |
2312 |
|
new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH); |
2313 |
2 |
strucConsensus.hasText = true; |
2314 |
2 |
strucConsensus.autoCalculated = true; |
2315 |
|
|
2316 |
2 |
if (showConsensus) |
2317 |
|
{ |
2318 |
2 |
alignment.addAnnotation(strucConsensus); |
2319 |
|
} |
2320 |
|
} |
2321 |
|
} |
2322 |
|
|
2323 |
|
|
2324 |
|
|
2325 |
|
|
2326 |
|
@see |
2327 |
|
|
|
|
| 91.7% |
Uncovered Elements: 4 (48) |
Complexity: 11 |
Complexity Density: 0.39 |
|
2328 |
4834 |
@Override... |
2329 |
|
public int calcPanelHeight() |
2330 |
|
{ |
2331 |
|
|
2332 |
4834 |
AlignmentAnnotation[] anns = getAlignment().getAlignmentAnnotation(); |
2333 |
4834 |
int height = 0; |
2334 |
4834 |
int charHeight = getCharHeight(); |
2335 |
4834 |
if (anns != null) |
2336 |
|
{ |
2337 |
4834 |
BitSet graphgrp = new BitSet(); |
2338 |
4834 |
for (AlignmentAnnotation aa : anns) |
2339 |
|
{ |
2340 |
22563 |
if (aa == null) |
2341 |
|
{ |
2342 |
0 |
jalview.bin.Console.errPrintln("Null annotation row: ignoring."); |
2343 |
0 |
continue; |
2344 |
|
} |
2345 |
22563 |
if (!aa.visible) |
2346 |
|
{ |
2347 |
1776 |
continue; |
2348 |
|
} |
2349 |
20787 |
if (aa.graphGroup > -1) |
2350 |
|
{ |
2351 |
390 |
if (graphgrp.get(aa.graphGroup)) |
2352 |
|
{ |
2353 |
195 |
continue; |
2354 |
|
} |
2355 |
|
else |
2356 |
|
{ |
2357 |
195 |
graphgrp.set(aa.graphGroup); |
2358 |
|
} |
2359 |
|
} |
2360 |
20592 |
aa.height = 0; |
2361 |
|
|
2362 |
20592 |
if (aa.hasText) |
2363 |
|
{ |
2364 |
18325 |
aa.height += charHeight; |
2365 |
|
} |
2366 |
|
|
2367 |
20592 |
if (aa.hasIcons) |
2368 |
|
{ |
2369 |
898 |
aa.height += 16; |
2370 |
|
} |
2371 |
|
|
2372 |
20592 |
if (aa.graph > 0) |
2373 |
|
{ |
2374 |
19202 |
aa.height += aa.graphHeight + 20; |
2375 |
|
} |
2376 |
|
|
2377 |
20592 |
if (aa.height == 0) |
2378 |
|
{ |
2379 |
158 |
aa.height = 20; |
2380 |
|
} |
2381 |
|
|
2382 |
20592 |
height += aa.height; |
2383 |
|
} |
2384 |
|
} |
2385 |
4834 |
if (height == 0) |
2386 |
|
{ |
2387 |
|
|
2388 |
23 |
height = 20; |
2389 |
|
} |
2390 |
4834 |
return height; |
2391 |
|
} |
2392 |
|
|
|
|
| 62.5% |
Uncovered Elements: 24 (64) |
Complexity: 16 |
Complexity Density: 0.4 |
|
2393 |
130 |
@Override... |
2394 |
|
public void updateGroupAnnotationSettings(boolean applyGlobalSettings, |
2395 |
|
boolean preserveNewGroupSettings) |
2396 |
|
{ |
2397 |
130 |
boolean updateCalcs = false; |
2398 |
130 |
boolean conv = isShowGroupConservation(); |
2399 |
130 |
boolean cons = isShowGroupConsensus(); |
2400 |
130 |
boolean sscons = isShowGroupSSConsensus(); |
2401 |
130 |
boolean showprf = isShowSequenceLogo(); |
2402 |
130 |
boolean showConsHist = isShowConsensusHistogram(); |
2403 |
130 |
boolean normLogo = isNormaliseSequenceLogo(); |
2404 |
|
|
2405 |
|
|
2406 |
|
|
2407 |
|
|
2408 |
|
|
2409 |
|
|
2410 |
|
|
2411 |
|
|
2412 |
|
|
2413 |
|
|
2414 |
|
|
2415 |
|
|
2416 |
130 |
AlignmentAnnotation[] aan = alignment.getAlignmentAnnotation(); |
2417 |
130 |
List<SequenceGroup> oldrfs = new ArrayList<>(); |
2418 |
130 |
if (aan != null) |
2419 |
|
{ |
2420 |
1021 |
for (int an = 0; an < aan.length; an++) |
2421 |
|
{ |
2422 |
891 |
if (aan[an].autoCalculated && aan[an].groupRef != null) |
2423 |
|
{ |
2424 |
0 |
oldrfs.add(aan[an].groupRef); |
2425 |
0 |
alignment.deleteAnnotation(aan[an], false); |
2426 |
|
} |
2427 |
|
} |
2428 |
|
} |
2429 |
130 |
if (alignment.getGroups() != null) |
2430 |
|
{ |
2431 |
130 |
for (SequenceGroup sg : alignment.getGroups()) |
2432 |
|
{ |
2433 |
56 |
updateCalcs = false; |
2434 |
56 |
if (applyGlobalSettings |
2435 |
|
|| (!preserveNewGroupSettings && !oldrfs.contains(sg))) |
2436 |
|
{ |
2437 |
|
|
2438 |
9 |
sg.setshowSequenceLogo(showprf); |
2439 |
9 |
sg.setShowConsensusHistogram(showConsHist); |
2440 |
9 |
sg.setNormaliseSequenceLogo(normLogo); |
2441 |
|
} |
2442 |
56 |
if (conv) |
2443 |
|
{ |
2444 |
0 |
updateCalcs = true; |
2445 |
0 |
alignment.addAnnotation(sg.getConservationRow(), 0); |
2446 |
|
} |
2447 |
56 |
if (cons) |
2448 |
|
{ |
2449 |
24 |
updateCalcs = true; |
2450 |
24 |
alignment.addAnnotation(sg.getConsensus(), 0); |
2451 |
|
} |
2452 |
56 |
if (sscons) |
2453 |
|
{ |
2454 |
0 |
updateCalcs = true; |
2455 |
0 |
List<String> secondaryStructureSources = getSecondaryStructureSources(); |
2456 |
0 |
if (secondaryStructureSources != null) |
2457 |
|
{ |
2458 |
0 |
List<AlignmentAnnotation> ssAa = sg |
2459 |
|
.getSSConsensus(secondaryStructureSources); |
2460 |
0 |
if (ssAa != null) |
2461 |
|
{ |
2462 |
0 |
for (AlignmentAnnotation aa : ssAa) |
2463 |
|
{ |
2464 |
|
|
2465 |
|
|
2466 |
0 |
if (aa.label.contains(Constants.SS_ALL_PROVIDERS)) |
2467 |
|
{ |
2468 |
0 |
aa.visible = true; |
2469 |
|
} |
2470 |
0 |
alignment.addAnnotation(aa, 0); |
2471 |
|
} |
2472 |
|
} |
2473 |
|
} |
2474 |
|
} |
2475 |
|
|
2476 |
56 |
if (updateCalcs) |
2477 |
|
{ |
2478 |
24 |
sg.recalcConservation(); |
2479 |
|
} |
2480 |
|
} |
2481 |
|
} |
2482 |
130 |
oldrfs.clear(); |
2483 |
|
} |
2484 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2485 |
19821 |
@Override... |
2486 |
|
public boolean isDisplayReferenceSeq() |
2487 |
|
{ |
2488 |
19821 |
return alignment.hasSeqrep() && viewStyle.isDisplayReferenceSeq(); |
2489 |
|
} |
2490 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2491 |
10 |
@Override... |
2492 |
|
public void setDisplayReferenceSeq(boolean displayReferenceSeq) |
2493 |
|
{ |
2494 |
10 |
viewStyle.setDisplayReferenceSeq(displayReferenceSeq); |
2495 |
|
} |
2496 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2497 |
5 |
@Override... |
2498 |
|
public boolean isColourByReferenceSeq() |
2499 |
|
{ |
2500 |
5 |
return alignment.hasSeqrep() && viewStyle.isColourByReferenceSeq(); |
2501 |
|
} |
2502 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
2503 |
13652 |
@Override... |
2504 |
|
public Color getSequenceColour(SequenceI seq) |
2505 |
|
{ |
2506 |
13652 |
Color sqc = sequenceColours.get(seq); |
2507 |
13652 |
return (sqc == null ? Color.white : sqc); |
2508 |
|
} |
2509 |
|
|
|
|
| 60% |
Uncovered Elements: 2 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
2510 |
1192 |
@Override... |
2511 |
|
public void setSequenceColour(SequenceI seq, Color col) |
2512 |
|
{ |
2513 |
1192 |
if (col == null) |
2514 |
|
{ |
2515 |
0 |
sequenceColours.remove(seq); |
2516 |
|
} |
2517 |
|
else |
2518 |
|
{ |
2519 |
1192 |
sequenceColours.put(seq, col); |
2520 |
|
} |
2521 |
|
} |
2522 |
|
|
|
|
| 50% |
Uncovered Elements: 3 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
2523 |
5 |
@Override... |
2524 |
|
public void updateSequenceIdColours() |
2525 |
|
{ |
2526 |
5 |
for (SequenceGroup sg : alignment.getGroups()) |
2527 |
|
{ |
2528 |
5 |
if (sg.idColour != null) |
2529 |
|
{ |
2530 |
0 |
for (SequenceI s : sg.getSequences(getHiddenRepSequences())) |
2531 |
|
{ |
2532 |
0 |
sequenceColours.put(s, sg.idColour); |
2533 |
|
} |
2534 |
|
} |
2535 |
|
} |
2536 |
|
} |
2537 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2538 |
0 |
@Override... |
2539 |
|
public void clearSequenceColours() |
2540 |
|
{ |
2541 |
0 |
sequenceColours.clear(); |
2542 |
|
} |
2543 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2544 |
1049 |
@Override... |
2545 |
|
public AlignViewportI getCodingComplement() |
2546 |
|
{ |
2547 |
1049 |
return this.codingComplement; |
2548 |
|
} |
2549 |
|
|
2550 |
|
|
2551 |
|
|
2552 |
|
|
2553 |
|
|
|
|
| 77.8% |
Uncovered Elements: 2 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
2554 |
6 |
@Override... |
2555 |
|
public void setCodingComplement(AlignViewportI av) |
2556 |
|
{ |
2557 |
6 |
if (this == av) |
2558 |
|
{ |
2559 |
0 |
jalview.bin.Console |
2560 |
|
.errPrintln("Ignoring recursive setCodingComplement request"); |
2561 |
|
} |
2562 |
|
else |
2563 |
|
{ |
2564 |
6 |
this.codingComplement = av; |
2565 |
|
|
2566 |
6 |
if (av.getCodingComplement() != this) |
2567 |
|
{ |
2568 |
3 |
av.setCodingComplement(this); |
2569 |
|
} |
2570 |
|
} |
2571 |
|
} |
2572 |
|
|
|
|
| 66.7% |
Uncovered Elements: 1 (3) |
Complexity: 2 |
Complexity Density: 2 |
|
2573 |
25 |
@Override... |
2574 |
|
public boolean isNucleotide() |
2575 |
|
{ |
2576 |
25 |
return getAlignment() == null ? false : getAlignment().isNucleotide(); |
2577 |
|
} |
2578 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2579 |
1698907 |
@Override... |
2580 |
|
public FeaturesDisplayedI getFeaturesDisplayed() |
2581 |
|
{ |
2582 |
1699287 |
return featuresDisplayed; |
2583 |
|
} |
2584 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2585 |
112 |
@Override... |
2586 |
|
public void setFeaturesDisplayed(FeaturesDisplayedI featuresDisplayedI) |
2587 |
|
{ |
2588 |
112 |
featuresDisplayed = featuresDisplayedI; |
2589 |
|
} |
2590 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2591 |
83 |
@Override... |
2592 |
|
public boolean areFeaturesDisplayed() |
2593 |
|
{ |
2594 |
83 |
return featuresDisplayed != null |
2595 |
|
&& featuresDisplayed.getRegisteredFeaturesCount() > 0; |
2596 |
|
} |
2597 |
|
|
2598 |
|
|
2599 |
|
|
2600 |
|
|
2601 |
|
@param |
2602 |
|
|
2603 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2604 |
141 |
@Override... |
2605 |
|
public void setShowSequenceFeatures(boolean b) |
2606 |
|
{ |
2607 |
141 |
viewStyle.setShowSequenceFeatures(b); |
2608 |
|
} |
2609 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2610 |
520234 |
@Override... |
2611 |
|
public boolean isShowSequenceFeatures() |
2612 |
|
{ |
2613 |
520308 |
return viewStyle.isShowSequenceFeatures(); |
2614 |
|
} |
2615 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2616 |
0 |
@Override... |
2617 |
|
public void setShowSequenceFeaturesHeight(boolean selected) |
2618 |
|
{ |
2619 |
0 |
viewStyle.setShowSequenceFeaturesHeight(selected); |
2620 |
|
} |
2621 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2622 |
0 |
@Override... |
2623 |
|
public boolean isShowSequenceFeaturesHeight() |
2624 |
|
{ |
2625 |
0 |
return viewStyle.isShowSequenceFeaturesHeight(); |
2626 |
|
} |
2627 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2628 |
681 |
@Override... |
2629 |
|
public void setShowAnnotation(boolean b) |
2630 |
|
{ |
2631 |
681 |
viewStyle.setShowAnnotation(b); |
2632 |
|
} |
2633 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2634 |
4292 |
@Override... |
2635 |
|
public boolean isShowAnnotation() |
2636 |
|
{ |
2637 |
4292 |
return viewStyle.isShowAnnotation(); |
2638 |
|
} |
2639 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2640 |
13453 |
@Override... |
2641 |
|
public boolean isRightAlignIds() |
2642 |
|
{ |
2643 |
13453 |
return viewStyle.isRightAlignIds(); |
2644 |
|
} |
2645 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2646 |
594 |
@Override... |
2647 |
|
public void setRightAlignIds(boolean rightAlignIds) |
2648 |
|
{ |
2649 |
594 |
viewStyle.setRightAlignIds(rightAlignIds); |
2650 |
|
} |
2651 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2652 |
1040 |
@Override... |
2653 |
|
public boolean getConservationSelected() |
2654 |
|
{ |
2655 |
1040 |
return viewStyle.getConservationSelected(); |
2656 |
|
} |
2657 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2658 |
85 |
@Override... |
2659 |
|
public void setShowBoxes(boolean state) |
2660 |
|
{ |
2661 |
85 |
viewStyle.setShowBoxes(state); |
2662 |
|
} |
2663 |
|
|
2664 |
|
|
2665 |
|
@return |
2666 |
|
@see |
2667 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2668 |
694258 |
@Override... |
2669 |
|
public Color getTextColour() |
2670 |
|
{ |
2671 |
694258 |
return viewStyle.getTextColour(); |
2672 |
|
} |
2673 |
|
|
2674 |
|
|
2675 |
|
@return |
2676 |
|
@see |
2677 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2678 |
46 |
@Override... |
2679 |
|
public Color getTextColour2() |
2680 |
|
{ |
2681 |
46 |
return viewStyle.getTextColour2(); |
2682 |
|
} |
2683 |
|
|
2684 |
|
|
2685 |
|
@return |
2686 |
|
@see |
2687 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2688 |
406640 |
@Override... |
2689 |
|
public int getThresholdTextColour() |
2690 |
|
{ |
2691 |
406640 |
return viewStyle.getThresholdTextColour(); |
2692 |
|
} |
2693 |
|
|
2694 |
|
|
2695 |
|
@return |
2696 |
|
@see |
2697 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2698 |
0 |
@Override... |
2699 |
|
public boolean isConservationColourSelected() |
2700 |
|
{ |
2701 |
0 |
return viewStyle.isConservationColourSelected(); |
2702 |
|
} |
2703 |
|
|
2704 |
|
|
2705 |
|
@return |
2706 |
|
@see |
2707 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2708 |
3395 |
@Override... |
2709 |
|
public boolean isRenderGaps() |
2710 |
|
{ |
2711 |
3395 |
return viewStyle.isRenderGaps(); |
2712 |
|
} |
2713 |
|
|
2714 |
|
|
2715 |
|
@return |
2716 |
|
@see |
2717 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2718 |
672 |
@Override... |
2719 |
|
public boolean isShowColourText() |
2720 |
|
{ |
2721 |
672 |
return viewStyle.isShowColourText(); |
2722 |
|
} |
2723 |
|
|
2724 |
|
|
2725 |
|
@param |
2726 |
|
@see |
2727 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2728 |
0 |
@Override... |
2729 |
|
public void setConservationColourSelected( |
2730 |
|
boolean conservationColourSelected) |
2731 |
|
{ |
2732 |
0 |
viewStyle.setConservationColourSelected(conservationColourSelected); |
2733 |
|
} |
2734 |
|
|
2735 |
|
|
2736 |
|
@param |
2737 |
|
@see |
2738 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2739 |
0 |
@Override... |
2740 |
|
public void setShowColourText(boolean showColourText) |
2741 |
|
{ |
2742 |
0 |
viewStyle.setShowColourText(showColourText); |
2743 |
|
} |
2744 |
|
|
2745 |
|
|
2746 |
|
@param |
2747 |
|
@see |
2748 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2749 |
85 |
@Override... |
2750 |
|
public void setTextColour(Color textColour) |
2751 |
|
{ |
2752 |
85 |
viewStyle.setTextColour(textColour); |
2753 |
|
} |
2754 |
|
|
2755 |
|
|
2756 |
|
@param |
2757 |
|
@see |
2758 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2759 |
85 |
@Override... |
2760 |
|
public void setThresholdTextColour(int thresholdTextColour) |
2761 |
|
{ |
2762 |
85 |
viewStyle.setThresholdTextColour(thresholdTextColour); |
2763 |
|
} |
2764 |
|
|
2765 |
|
|
2766 |
|
@param |
2767 |
|
@see |
2768 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2769 |
85 |
@Override... |
2770 |
|
public void setTextColour2(Color textColour2) |
2771 |
|
{ |
2772 |
85 |
viewStyle.setTextColour2(textColour2); |
2773 |
|
} |
2774 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2775 |
143 |
@Override... |
2776 |
|
public ViewStyleI getViewStyle() |
2777 |
|
{ |
2778 |
143 |
return new ViewStyle(viewStyle); |
2779 |
|
} |
2780 |
|
|
|
|
| 80% |
Uncovered Elements: 1 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
2781 |
86 |
@Override... |
2782 |
|
public void setViewStyle(ViewStyleI settingsForView) |
2783 |
|
{ |
2784 |
86 |
viewStyle = new ViewStyle(settingsForView); |
2785 |
86 |
if (residueShading != null) |
2786 |
|
{ |
2787 |
86 |
residueShading.setConservationApplied( |
2788 |
|
settingsForView.isConservationColourSelected()); |
2789 |
|
} |
2790 |
|
} |
2791 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2792 |
0 |
@Override... |
2793 |
|
public boolean sameStyle(ViewStyleI them) |
2794 |
|
{ |
2795 |
0 |
return viewStyle.sameStyle(them); |
2796 |
|
} |
2797 |
|
|
2798 |
|
|
2799 |
|
@return |
2800 |
|
@see |
2801 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2802 |
6365 |
@Override... |
2803 |
|
public int getIdWidth() |
2804 |
|
{ |
2805 |
6365 |
return viewStyle.getIdWidth(); |
2806 |
|
} |
2807 |
|
|
2808 |
|
|
2809 |
|
@param |
2810 |
|
@see |
2811 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2812 |
651 |
@Override... |
2813 |
|
public void setIdWidth(int i) |
2814 |
|
{ |
2815 |
651 |
viewStyle.setIdWidth(i); |
2816 |
|
} |
2817 |
|
|
2818 |
|
|
2819 |
|
@return |
2820 |
|
@see |
2821 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2822 |
672 |
@Override... |
2823 |
|
public boolean isCentreColumnLabels() |
2824 |
|
{ |
2825 |
672 |
return viewStyle.isCentreColumnLabels(); |
2826 |
|
} |
2827 |
|
|
2828 |
|
|
2829 |
|
@param |
2830 |
|
@see |
2831 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2832 |
594 |
@Override... |
2833 |
|
public void setCentreColumnLabels(boolean centreColumnLabels) |
2834 |
|
{ |
2835 |
594 |
viewStyle.setCentreColumnLabels(centreColumnLabels); |
2836 |
|
} |
2837 |
|
|
2838 |
|
|
2839 |
|
@param |
2840 |
|
@see |
2841 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2842 |
594 |
@Override... |
2843 |
|
public void setShowDBRefs(boolean showdbrefs) |
2844 |
|
{ |
2845 |
594 |
viewStyle.setShowDBRefs(showdbrefs); |
2846 |
|
} |
2847 |
|
|
2848 |
|
|
2849 |
|
@return |
2850 |
|
@see |
2851 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2852 |
718 |
@Override... |
2853 |
|
public boolean isShowDBRefs() |
2854 |
|
{ |
2855 |
718 |
return viewStyle.isShowDBRefs(); |
2856 |
|
} |
2857 |
|
|
2858 |
|
|
2859 |
|
@return |
2860 |
|
@see |
2861 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2862 |
718 |
@Override... |
2863 |
|
public boolean isShowNPFeats() |
2864 |
|
{ |
2865 |
718 |
return viewStyle.isShowNPFeats(); |
2866 |
|
} |
2867 |
|
|
2868 |
|
|
2869 |
|
@param |
2870 |
|
@see |
2871 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2872 |
594 |
@Override... |
2873 |
|
public void setShowNPFeats(boolean shownpfeats) |
2874 |
|
{ |
2875 |
594 |
viewStyle.setShowNPFeats(shownpfeats); |
2876 |
|
} |
2877 |
|
|
2878 |
|
public abstract StructureSelectionManager getStructureSelectionManager(); |
2879 |
|
|
2880 |
|
|
2881 |
|
|
2882 |
|
|
2883 |
|
@param |
2884 |
|
|
|
|
| 85.7% |
Uncovered Elements: 1 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
2885 |
1 |
public void addToHistoryList(CommandI command)... |
2886 |
|
{ |
2887 |
1 |
if (this.historyList != null) |
2888 |
|
{ |
2889 |
1 |
this.historyList.push(command); |
2890 |
1 |
broadcastCommand(command, false); |
2891 |
1 |
setSavedUpToDate(false); |
2892 |
1 |
Jalview2XML.setStateSavedUpToDate(false); |
2893 |
|
} |
2894 |
|
} |
2895 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2896 |
1 |
protected void broadcastCommand(CommandI command, boolean undo)... |
2897 |
|
{ |
2898 |
1 |
getStructureSelectionManager().commandPerformed(command, undo, |
2899 |
|
getVamsasSource()); |
2900 |
|
} |
2901 |
|
|
2902 |
|
|
2903 |
|
|
2904 |
|
|
2905 |
|
@param |
2906 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
2907 |
0 |
public void addToRedoList(CommandI command)... |
2908 |
|
{ |
2909 |
0 |
if (this.redoList != null) |
2910 |
|
{ |
2911 |
0 |
this.redoList.push(command); |
2912 |
|
} |
2913 |
0 |
broadcastCommand(command, true); |
2914 |
|
} |
2915 |
|
|
2916 |
|
|
2917 |
|
|
2918 |
|
|
|
|
| 75% |
Uncovered Elements: 1 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
2919 |
1 |
public void clearRedoList()... |
2920 |
|
{ |
2921 |
1 |
if (this.redoList != null) |
2922 |
|
{ |
2923 |
1 |
this.redoList.clear(); |
2924 |
|
} |
2925 |
|
} |
2926 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2927 |
53 |
public void setHistoryList(Deque<CommandI> list)... |
2928 |
|
{ |
2929 |
53 |
this.historyList = list; |
2930 |
|
} |
2931 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2932 |
1277 |
public Deque<CommandI> getHistoryList()... |
2933 |
|
{ |
2934 |
1277 |
return this.historyList; |
2935 |
|
} |
2936 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2937 |
53 |
public void setRedoList(Deque<CommandI> list)... |
2938 |
|
{ |
2939 |
53 |
this.redoList = list; |
2940 |
|
} |
2941 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2942 |
1275 |
public Deque<CommandI> getRedoList()... |
2943 |
|
{ |
2944 |
1275 |
return this.redoList; |
2945 |
|
} |
2946 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2947 |
1 |
@Override... |
2948 |
|
public VamsasSource getVamsasSource() |
2949 |
|
{ |
2950 |
1 |
return this; |
2951 |
|
} |
2952 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2953 |
5564 |
public SequenceAnnotationOrder getSortAnnotationsBy()... |
2954 |
|
{ |
2955 |
5564 |
return sortAnnotationsBy; |
2956 |
|
} |
2957 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2958 |
0 |
public void setSortAnnotationsBy(... |
2959 |
|
SequenceAnnotationOrder sortAnnotationsBy) |
2960 |
|
{ |
2961 |
0 |
this.sortAnnotationsBy = sortAnnotationsBy; |
2962 |
|
} |
2963 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2964 |
5564 |
public boolean isShowAutocalculatedAbove()... |
2965 |
|
{ |
2966 |
5564 |
return showAutocalculatedAbove; |
2967 |
|
} |
2968 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2969 |
452 |
public void setShowAutocalculatedAbove(boolean showAutocalculatedAbove)... |
2970 |
|
{ |
2971 |
452 |
this.showAutocalculatedAbove = showAutocalculatedAbove; |
2972 |
|
} |
2973 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2974 |
3 |
@Override... |
2975 |
|
public boolean isScaleProteinAsCdna() |
2976 |
|
{ |
2977 |
3 |
return viewStyle.isScaleProteinAsCdna(); |
2978 |
|
} |
2979 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2980 |
0 |
@Override... |
2981 |
|
public void setScaleProteinAsCdna(boolean b) |
2982 |
|
{ |
2983 |
0 |
viewStyle.setScaleProteinAsCdna(b); |
2984 |
|
} |
2985 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2986 |
0 |
@Override... |
2987 |
|
public boolean isProteinFontAsCdna() |
2988 |
|
{ |
2989 |
0 |
return viewStyle.isProteinFontAsCdna(); |
2990 |
|
} |
2991 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2992 |
0 |
@Override... |
2993 |
|
public void setProteinFontAsCdna(boolean b) |
2994 |
|
{ |
2995 |
0 |
viewStyle.setProteinFontAsCdna(b); |
2996 |
|
} |
2997 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
2998 |
85 |
@Override... |
2999 |
|
public void setShowComplementFeatures(boolean b) |
3000 |
|
{ |
3001 |
85 |
viewStyle.setShowComplementFeatures(b); |
3002 |
|
} |
3003 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
3004 |
522781 |
@Override... |
3005 |
|
public boolean isShowComplementFeatures() |
3006 |
|
{ |
3007 |
522841 |
return viewStyle.isShowComplementFeatures(); |
3008 |
|
} |
3009 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
3010 |
85 |
@Override... |
3011 |
|
public void setShowComplementFeaturesOnTop(boolean b) |
3012 |
|
{ |
3013 |
85 |
viewStyle.setShowComplementFeaturesOnTop(b); |
3014 |
|
} |
3015 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
3016 |
47 |
@Override... |
3017 |
|
public boolean isShowComplementFeaturesOnTop() |
3018 |
|
{ |
3019 |
47 |
return viewStyle.isShowComplementFeaturesOnTop(); |
3020 |
|
} |
3021 |
|
|
3022 |
|
|
3023 |
|
@return |
3024 |
|
|
3025 |
|
@return |
3026 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
3027 |
49 |
@Override... |
3028 |
|
public final boolean isFollowHighlight() |
3029 |
|
{ |
3030 |
49 |
return followHighlight; |
3031 |
|
} |
3032 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
3033 |
85 |
@Override... |
3034 |
|
public final void setFollowHighlight(boolean b) |
3035 |
|
{ |
3036 |
85 |
this.followHighlight = b; |
3037 |
|
} |
3038 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
3039 |
39131 |
@Override... |
3040 |
|
public ViewportRanges getRanges() |
3041 |
|
{ |
3042 |
39131 |
return ranges; |
3043 |
|
} |
3044 |
|
|
3045 |
|
|
3046 |
|
|
3047 |
|
|
3048 |
|
|
3049 |
|
@param |
3050 |
|
|
3051 |
|
@return |
3052 |
|
|
|
|
| 74.4% |
Uncovered Elements: 11 (43) |
Complexity: 13 |
Complexity Density: 0.48 |
|
3053 |
633 |
protected int findComplementScrollTarget(SearchResultsI sr)... |
3054 |
|
{ |
3055 |
633 |
final AlignViewportI complement = getCodingComplement(); |
3056 |
633 |
if (complement == null || !complement.isFollowHighlight()) |
3057 |
|
{ |
3058 |
631 |
return 0; |
3059 |
|
} |
3060 |
2 |
boolean iAmProtein = !getAlignment().isNucleotide(); |
3061 |
2 |
AlignmentI proteinAlignment = iAmProtein ? getAlignment() |
3062 |
|
: complement.getAlignment(); |
3063 |
2 |
if (proteinAlignment == null) |
3064 |
|
{ |
3065 |
0 |
return 0; |
3066 |
|
} |
3067 |
2 |
final List<AlignedCodonFrame> mappings = proteinAlignment |
3068 |
|
.getCodonFrames(); |
3069 |
|
|
3070 |
|
|
3071 |
|
|
3072 |
|
|
3073 |
|
|
3074 |
|
|
3075 |
2 |
int seqOffset = 0; |
3076 |
2 |
SequenceI sequence = null; |
3077 |
|
|
3078 |
|
|
3079 |
|
|
3080 |
|
|
3081 |
|
|
3082 |
2 |
int middleColumn = ranges.getStartRes() |
3083 |
|
+ (ranges.getEndRes() - ranges.getStartRes()) / 2; |
3084 |
2 |
final HiddenSequences hiddenSequences = getAlignment() |
3085 |
|
.getHiddenSequences(); |
3086 |
|
|
3087 |
|
|
3088 |
|
|
3089 |
|
|
3090 |
|
|
3091 |
2 |
int lastSeq = alignment.getHeight() - 1; |
3092 |
2 |
List<AlignedCodonFrame> seqMappings = null; |
3093 |
2 |
for (int seqNo = ranges |
3094 |
2 |
.getStartSeq(); seqNo <= lastSeq; seqNo++, seqOffset++) |
3095 |
|
{ |
3096 |
2 |
sequence = getAlignment().getSequenceAt(seqNo); |
3097 |
2 |
if (hiddenSequences != null && hiddenSequences.isHidden(sequence)) |
3098 |
|
{ |
3099 |
0 |
continue; |
3100 |
|
} |
3101 |
2 |
if (Comparison.isGap(sequence.getCharAt(middleColumn))) |
3102 |
|
{ |
3103 |
0 |
continue; |
3104 |
|
} |
3105 |
2 |
seqMappings = MappingUtils.findMappingsForSequenceAndOthers(sequence, |
3106 |
|
mappings, |
3107 |
|
getCodingComplement().getAlignment().getSequences()); |
3108 |
2 |
if (!seqMappings.isEmpty()) |
3109 |
|
{ |
3110 |
2 |
break; |
3111 |
|
} |
3112 |
|
} |
3113 |
|
|
3114 |
2 |
if (sequence == null || seqMappings == null || seqMappings.isEmpty()) |
3115 |
|
{ |
3116 |
|
|
3117 |
|
|
3118 |
|
|
3119 |
0 |
return 0; |
3120 |
|
} |
3121 |
2 |
MappingUtils.addSearchResults(sr, sequence, |
3122 |
|
sequence.findPosition(middleColumn), seqMappings); |
3123 |
2 |
return seqOffset; |
3124 |
|
} |
3125 |
|
|
3126 |
|
|
3127 |
|
|
3128 |
|
|
3129 |
|
|
3130 |
|
|
3131 |
|
@param |
3132 |
|
@param |
3133 |
|
|
|
|
| 0% |
Uncovered Elements: 16 (16) |
Complexity: 9 |
Complexity Density: 1.12 |
|
3134 |
0 |
public void expandColSelection(SequenceGroup sg, boolean wholewidth)... |
3135 |
|
{ |
3136 |
0 |
int sgs, sge; |
3137 |
0 |
if (sg != null && (sgs = sg.getStartRes()) >= 0 |
3138 |
|
&& sg.getStartRes() <= (sge = sg.getEndRes()) |
3139 |
|
&& !this.hasSelectedColumns()) |
3140 |
|
{ |
3141 |
0 |
if (!wholewidth && alignment.getWidth() == (1 + sge - sgs)) |
3142 |
|
{ |
3143 |
|
|
3144 |
0 |
return; |
3145 |
|
} |
3146 |
0 |
if (colSel == null) |
3147 |
|
{ |
3148 |
0 |
colSel = new ColumnSelection(); |
3149 |
|
} |
3150 |
0 |
for (int cspos = sg.getStartRes(); cspos <= sg.getEndRes(); cspos++) |
3151 |
|
{ |
3152 |
0 |
colSel.addElement(cspos); |
3153 |
|
} |
3154 |
|
} |
3155 |
|
} |
3156 |
|
|
3157 |
|
|
3158 |
|
|
3159 |
|
|
3160 |
|
private boolean selectionIsDefinedGroup = false; |
3161 |
|
|
|
|
| 0% |
Uncovered Elements: 15 (15) |
Complexity: 5 |
Complexity Density: 0.56 |
|
3162 |
0 |
@Override... |
3163 |
|
public boolean isSelectionDefinedGroup() |
3164 |
|
{ |
3165 |
0 |
if (selectionGroup == null) |
3166 |
|
{ |
3167 |
0 |
return false; |
3168 |
|
} |
3169 |
0 |
if (isSelectionGroupChanged(true)) |
3170 |
|
{ |
3171 |
0 |
selectionIsDefinedGroup = false; |
3172 |
0 |
List<SequenceGroup> gps = alignment.getGroups(); |
3173 |
0 |
if (gps == null || gps.size() == 0) |
3174 |
|
{ |
3175 |
0 |
selectionIsDefinedGroup = false; |
3176 |
|
} |
3177 |
|
else |
3178 |
|
{ |
3179 |
0 |
selectionIsDefinedGroup = gps.contains(selectionGroup); |
3180 |
|
} |
3181 |
|
} |
3182 |
0 |
return selectionGroup.isDefined() || selectionIsDefinedGroup; |
3183 |
|
} |
3184 |
|
|
3185 |
|
|
3186 |
|
|
3187 |
|
|
3188 |
|
private SearchResultsI searchResults = null; |
3189 |
|
|
3190 |
|
protected TreeModel currentTree = null; |
3191 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
3192 |
12258 |
@Override... |
3193 |
|
public boolean hasSearchResults() |
3194 |
|
{ |
3195 |
12258 |
return searchResults != null; |
3196 |
|
} |
3197 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
3198 |
7 |
@Override... |
3199 |
|
public void setSearchResults(SearchResultsI results) |
3200 |
|
{ |
3201 |
7 |
searchResults = results; |
3202 |
|
} |
3203 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
3204 |
44 |
@Override... |
3205 |
|
public SearchResultsI getSearchResults() |
3206 |
|
{ |
3207 |
44 |
return searchResults; |
3208 |
|
} |
3209 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
3210 |
3661 |
@Override... |
3211 |
|
public ContactListI getContactList(AlignmentAnnotation _aa, int column) |
3212 |
|
{ |
3213 |
3661 |
return alignment.getContactListFor(_aa, column); |
3214 |
|
} |
3215 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
3216 |
133 |
@Override... |
3217 |
|
public ContactMatrixI getContactMatrix( |
3218 |
|
AlignmentAnnotation alignmentAnnotation) |
3219 |
|
{ |
3220 |
133 |
return alignment.getContactMatrixFor(alignmentAnnotation); |
3221 |
|
} |
3222 |
|
|
3223 |
|
|
3224 |
|
|
3225 |
|
|
3226 |
|
|
3227 |
|
@return |
3228 |
|
|
|
|
| 77.8% |
Uncovered Elements: 6 (27) |
Complexity: 8 |
Complexity Density: 0.53 |
|
3229 |
1 |
public SequenceI getConsensusSeq()... |
3230 |
|
{ |
3231 |
1 |
if (consensus == null) |
3232 |
|
{ |
3233 |
0 |
updateConsensus(null); |
3234 |
|
} |
3235 |
1 |
if (consensus == null) |
3236 |
|
{ |
3237 |
0 |
return null; |
3238 |
|
} |
3239 |
1 |
StringBuffer seqs = new StringBuffer(); |
3240 |
4 |
for (int i = 0; i < consensus.annotations.length; i++) |
3241 |
|
{ |
3242 |
3 |
Annotation annotation = consensus.annotations[i]; |
3243 |
3 |
if (annotation != null) |
3244 |
|
{ |
3245 |
3 |
String description = annotation.description; |
3246 |
3 |
if (description != null && description.startsWith("[")) |
3247 |
|
{ |
3248 |
|
|
3249 |
1 |
seqs.append(description.charAt(1)); |
3250 |
|
} |
3251 |
|
else |
3252 |
|
{ |
3253 |
2 |
seqs.append(annotation.displayCharacter); |
3254 |
|
} |
3255 |
|
} |
3256 |
|
} |
3257 |
|
|
3258 |
1 |
SequenceI sq = new Sequence("Consensus", seqs.toString()); |
3259 |
1 |
sq.setDescription("Percentage Identity Consensus " |
3260 |
1 |
+ ((ignoreGapsInConsensusCalculation) ? " without gaps" : "")); |
3261 |
1 |
return sq; |
3262 |
|
} |
3263 |
|
|
3264 |
|
|
|
|
| 0% |
Uncovered Elements: 14 (14) |
Complexity: 4 |
Complexity Density: 0.5 |
|
3265 |
0 |
public SequenceI getSSConsensusSeq()... |
3266 |
|
{ |
3267 |
0 |
if (secondaryStructureConsensus == null) |
3268 |
|
{ |
3269 |
0 |
updateSecondaryStructureConsensus(null); |
3270 |
|
} |
3271 |
0 |
if (secondaryStructureConsensus == null) |
3272 |
|
{ |
3273 |
0 |
return null; |
3274 |
|
} |
3275 |
0 |
StringBuffer seqs = new StringBuffer(); |
3276 |
|
|
3277 |
|
|
3278 |
|
|
3279 |
|
|
3280 |
|
|
3281 |
|
|
3282 |
|
|
3283 |
|
|
3284 |
|
|
3285 |
|
|
3286 |
|
|
3287 |
|
|
3288 |
|
|
3289 |
|
|
3290 |
|
|
3291 |
|
|
3292 |
|
|
3293 |
|
|
3294 |
0 |
SequenceI sq = new Sequence("Sec Str Consensus", seqs.toString()); |
3295 |
0 |
sq.setDescription("Percentage Identity Sec Str Consensus " |
3296 |
0 |
+ ((ignoreGapsInConsensusCalculation) ? " without gaps" : "")); |
3297 |
0 |
return sq; |
3298 |
|
} |
3299 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
3300 |
28 |
@Override... |
3301 |
|
public void setCurrentTree(TreeModel tree) |
3302 |
|
{ |
3303 |
28 |
currentTree = tree; |
3304 |
|
} |
3305 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
3306 |
50 |
@Override... |
3307 |
|
public TreeModel getCurrentTree() |
3308 |
|
{ |
3309 |
50 |
return currentTree; |
3310 |
|
} |
3311 |
|
|
|
|
| 75% |
Uncovered Elements: 4 (16) |
Complexity: 5 |
Complexity Density: 0.42 |
|
3312 |
121 |
@Override... |
3313 |
|
public AlignmentExportData getAlignExportData( |
3314 |
|
AlignExportSettingsI options) |
3315 |
|
{ |
3316 |
121 |
AlignmentI alignmentToExport = null; |
3317 |
121 |
String[] omitHidden = null; |
3318 |
121 |
alignmentToExport = null; |
3319 |
|
|
3320 |
121 |
if (hasHiddenColumns() && !options.isExportHiddenColumns()) |
3321 |
|
{ |
3322 |
0 |
omitHidden = getViewAsString(false, |
3323 |
|
options.isExportHiddenSequences()); |
3324 |
|
} |
3325 |
|
|
3326 |
121 |
int[] alignmentStartEnd = new int[2]; |
3327 |
121 |
if (hasHiddenRows() && options.isExportHiddenSequences()) |
3328 |
|
{ |
3329 |
0 |
alignmentToExport = getAlignment().getHiddenSequences() |
3330 |
|
.getFullAlignment(); |
3331 |
|
} |
3332 |
|
else |
3333 |
|
{ |
3334 |
121 |
alignmentToExport = getAlignment(); |
3335 |
|
} |
3336 |
121 |
alignmentStartEnd = getAlignment().getHiddenColumns() |
3337 |
|
.getVisibleStartAndEndIndex(alignmentToExport.getWidth()); |
3338 |
121 |
AlignmentExportData ed = new AlignmentExportData(alignmentToExport, |
3339 |
|
omitHidden, alignmentStartEnd); |
3340 |
121 |
return ed; |
3341 |
|
} |
3342 |
|
|
3343 |
|
|
3344 |
|
|
3345 |
|
|
3346 |
|
|
3347 |
|
|
3348 |
|
private boolean needToUpdateStructureViews = false; |
3349 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
3350 |
0 |
@Override... |
3351 |
|
public boolean isUpdateStructures() |
3352 |
|
{ |
3353 |
0 |
return needToUpdateStructureViews; |
3354 |
|
} |
3355 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
3356 |
0 |
@Override... |
3357 |
|
public void setUpdateStructures(boolean update) |
3358 |
|
{ |
3359 |
0 |
needToUpdateStructureViews = update; |
3360 |
|
} |
3361 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
3362 |
1751 |
@Override... |
3363 |
|
public boolean needToUpdateStructureViews() |
3364 |
|
{ |
3365 |
1751 |
boolean update = needToUpdateStructureViews; |
3366 |
1751 |
needToUpdateStructureViews = false; |
3367 |
1751 |
return update; |
3368 |
|
} |
3369 |
|
|
|
|
| 0% |
Uncovered Elements: 22 (22) |
Complexity: 5 |
Complexity Density: 0.36 |
|
3370 |
0 |
@Override... |
3371 |
|
public void addSequenceGroup(SequenceGroup sequenceGroup) |
3372 |
|
{ |
3373 |
0 |
alignment.addGroup(sequenceGroup); |
3374 |
|
|
3375 |
0 |
Color col = sequenceGroup.idColour; |
3376 |
0 |
if (col != null) |
3377 |
|
{ |
3378 |
0 |
col = col.brighter(); |
3379 |
|
|
3380 |
0 |
for (SequenceI sq : sequenceGroup.getSequences()) |
3381 |
|
{ |
3382 |
0 |
setSequenceColour(sq, col); |
3383 |
|
} |
3384 |
|
} |
3385 |
|
|
3386 |
0 |
if (codingComplement != null) |
3387 |
|
{ |
3388 |
0 |
SequenceGroup mappedGroup = MappingUtils |
3389 |
|
.mapSequenceGroup(sequenceGroup, this, codingComplement); |
3390 |
0 |
if (mappedGroup.getSequences().size() > 0) |
3391 |
|
{ |
3392 |
0 |
codingComplement.getAlignment().addGroup(mappedGroup); |
3393 |
|
|
3394 |
0 |
if (col != null) |
3395 |
|
{ |
3396 |
0 |
for (SequenceI seq : mappedGroup.getSequences()) |
3397 |
|
{ |
3398 |
0 |
codingComplement.setSequenceColour(seq, col); |
3399 |
|
} |
3400 |
|
} |
3401 |
|
} |
3402 |
|
|
3403 |
0 |
codingComplement.setUpdateStructures(needToUpdateStructureViews); |
3404 |
|
} |
3405 |
|
} |
3406 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 3 |
Complexity Density: 0.43 |
|
3407 |
34 |
@Override... |
3408 |
|
public Iterator<int[]> getViewAsVisibleContigs(boolean selectedRegionOnly) |
3409 |
|
{ |
3410 |
34 |
int start = 0; |
3411 |
34 |
int end = 0; |
3412 |
34 |
if (selectedRegionOnly && selectionGroup != null) |
3413 |
|
{ |
3414 |
4 |
start = selectionGroup.getStartRes(); |
3415 |
4 |
end = selectionGroup.getEndRes() + 1; |
3416 |
|
} |
3417 |
|
else |
3418 |
|
{ |
3419 |
30 |
end = alignment.getWidth(); |
3420 |
|
} |
3421 |
34 |
return (alignment.getHiddenColumns().getVisContigsIterator(start, end, |
3422 |
|
false)); |
3423 |
|
} |
3424 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
3425 |
133 |
public void setSavedUpToDate(boolean s)... |
3426 |
|
{ |
3427 |
133 |
setSavedUpToDate(s, QuitHandler.Message.UNSAVED_CHANGES); |
3428 |
|
} |
3429 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
3430 |
452 |
public void setSavedUpToDate(boolean s, QuitHandler.Message m)... |
3431 |
|
{ |
3432 |
452 |
Console.debug( |
3433 |
|
"Setting " + this.getViewId() + " setSavedUpToDate to " + s); |
3434 |
452 |
savedUpToDate = s; |
3435 |
452 |
QuitHandler.setMessage(m); |
3436 |
|
} |
3437 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
3438 |
4 |
public boolean savedUpToDate()... |
3439 |
|
{ |
3440 |
4 |
Console.debug("Returning " + this.getViewId() + " savedUpToDate value: " |
3441 |
|
+ savedUpToDate); |
3442 |
4 |
return savedUpToDate; |
3443 |
|
} |
3444 |
|
} |