1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.datamodel; |
22 |
|
|
23 |
|
import jalview.analysis.AAFrequency; |
24 |
|
import jalview.analysis.Conservation; |
25 |
|
import jalview.renderer.ResidueShader; |
26 |
|
import jalview.renderer.ResidueShaderI; |
27 |
|
import jalview.schemes.ColourSchemeI; |
28 |
|
|
29 |
|
import java.awt.Color; |
30 |
|
import java.beans.PropertyChangeListener; |
31 |
|
import java.beans.PropertyChangeSupport; |
32 |
|
import java.util.ArrayList; |
33 |
|
import java.util.Arrays; |
34 |
|
import java.util.List; |
35 |
|
import java.util.Map; |
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
@author |
41 |
|
@version |
42 |
|
|
|
|
| 54.5% |
Uncovered Elements: 265 (583) |
Complexity: 181 |
Complexity Density: 0.53 |
|
43 |
|
public class SequenceGroup implements AnnotatedCollectionI |
44 |
|
{ |
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
public static final String SEQ_GROUP_CHANGED = "Sequence group changed"; |
50 |
|
|
51 |
|
protected PropertyChangeSupport changeSupport = new PropertyChangeSupport( |
52 |
|
this); |
53 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
54 |
0 |
public void addPropertyChangeListener(PropertyChangeListener listener)... |
55 |
|
{ |
56 |
0 |
changeSupport.addPropertyChangeListener(listener); |
57 |
|
} |
58 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
59 |
0 |
public void removePropertyChangeListener(PropertyChangeListener listener)... |
60 |
|
{ |
61 |
0 |
changeSupport.removePropertyChangeListener(listener); |
62 |
|
} |
63 |
|
|
64 |
|
|
65 |
|
String groupName; |
66 |
|
|
67 |
|
String description; |
68 |
|
|
69 |
|
Conservation conserve; |
70 |
|
|
71 |
|
boolean displayBoxes = true; |
72 |
|
|
73 |
|
boolean displayText = true; |
74 |
|
|
75 |
|
boolean colourText = false; |
76 |
|
|
77 |
|
|
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
boolean isDefined = false; |
82 |
|
|
83 |
|
|
84 |
|
|
85 |
|
|
86 |
|
boolean showNonconserved = false; |
87 |
|
|
88 |
|
|
89 |
|
|
90 |
|
|
91 |
|
private List<SequenceI> sequences = new ArrayList<>(); |
92 |
|
|
93 |
|
|
94 |
|
|
95 |
|
|
96 |
|
private SequenceI seqrep = null; |
97 |
|
|
98 |
|
int width = -1; |
99 |
|
|
100 |
|
|
101 |
|
|
102 |
|
|
103 |
|
public ResidueShaderI cs; |
104 |
|
|
105 |
|
|
106 |
|
int startRes = 0; |
107 |
|
|
108 |
|
|
109 |
|
int endRes = 0; |
110 |
|
|
111 |
|
public Color outlineColour = Color.black; |
112 |
|
|
113 |
|
public Color idColour = null; |
114 |
|
|
115 |
|
public int thresholdTextColour = 0; |
116 |
|
|
117 |
|
public Color textColour = Color.black; |
118 |
|
|
119 |
|
public Color textColour2 = Color.white; |
120 |
|
|
121 |
|
|
122 |
|
|
123 |
|
|
124 |
|
private boolean ignoreGapsInConsensus = true; |
125 |
|
|
126 |
|
|
127 |
|
|
128 |
|
|
129 |
|
private boolean showSequenceLogo = false; |
130 |
|
|
131 |
|
|
132 |
|
|
133 |
|
|
134 |
|
private boolean normaliseSequenceLogo; |
135 |
|
|
136 |
|
|
137 |
|
|
138 |
|
|
139 |
|
private boolean hidereps = false; |
140 |
|
|
141 |
|
|
142 |
|
|
143 |
|
|
144 |
|
private boolean hidecols = false; |
145 |
|
|
146 |
|
AlignmentAnnotation consensus = null; |
147 |
|
|
148 |
|
AlignmentAnnotation conservation = null; |
149 |
|
|
150 |
|
private boolean showConsensusHistogram; |
151 |
|
|
152 |
|
private AnnotatedCollectionI context; |
153 |
|
|
154 |
|
|
155 |
|
|
156 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
157 |
1214 |
public SequenceGroup()... |
158 |
|
{ |
159 |
1214 |
groupName = "JGroup:" + this.hashCode(); |
160 |
1214 |
cs = new ResidueShader(); |
161 |
|
} |
162 |
|
|
163 |
|
|
164 |
|
|
165 |
|
|
166 |
|
@param |
167 |
|
@param |
168 |
|
@param |
169 |
|
@param |
170 |
|
@param |
171 |
|
@param |
172 |
|
@param |
173 |
|
|
174 |
|
@param |
175 |
|
|
176 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (10) |
Complexity: 1 |
Complexity Density: 0.1 |
|
177 |
80 |
public SequenceGroup(List<SequenceI> sequences, String groupName,... |
178 |
|
ColourSchemeI scheme, boolean displayBoxes, boolean displayText, |
179 |
|
boolean colourText, int start, int end) |
180 |
|
{ |
181 |
80 |
this(); |
182 |
80 |
this.sequences = sequences; |
183 |
80 |
this.groupName = groupName; |
184 |
80 |
this.displayBoxes = displayBoxes; |
185 |
80 |
this.displayText = displayText; |
186 |
80 |
this.colourText = colourText; |
187 |
80 |
this.cs = new ResidueShader(scheme); |
188 |
80 |
startRes = start; |
189 |
80 |
endRes = end; |
190 |
80 |
recalcConservation(); |
191 |
|
} |
192 |
|
|
193 |
|
|
194 |
|
|
195 |
|
|
196 |
|
@param |
197 |
|
|
|
|
| 92.1% |
Uncovered Elements: 3 (38) |
Complexity: 5 |
Complexity Density: 0.17 |
|
198 |
48 |
public SequenceGroup(SequenceGroup seqsel)... |
199 |
|
{ |
200 |
48 |
this(); |
201 |
48 |
if (seqsel != null) |
202 |
|
{ |
203 |
42 |
sequences = new ArrayList<>(); |
204 |
42 |
sequences.addAll(seqsel.sequences); |
205 |
42 |
if (seqsel.groupName != null) |
206 |
|
{ |
207 |
42 |
groupName = new String(seqsel.groupName); |
208 |
|
} |
209 |
42 |
displayBoxes = seqsel.displayBoxes; |
210 |
42 |
displayText = seqsel.displayText; |
211 |
42 |
colourText = seqsel.colourText; |
212 |
42 |
startRes = seqsel.startRes; |
213 |
42 |
endRes = seqsel.endRes; |
214 |
42 |
cs = new ResidueShader((ResidueShader) seqsel.cs); |
215 |
42 |
if (seqsel.description != null) |
216 |
|
{ |
217 |
1 |
description = new String(seqsel.description); |
218 |
|
} |
219 |
42 |
hidecols = seqsel.hidecols; |
220 |
42 |
hidereps = seqsel.hidereps; |
221 |
42 |
showNonconserved = seqsel.showNonconserved; |
222 |
42 |
showSequenceLogo = seqsel.showSequenceLogo; |
223 |
42 |
normaliseSequenceLogo = seqsel.normaliseSequenceLogo; |
224 |
42 |
showConsensusHistogram = seqsel.showConsensusHistogram; |
225 |
42 |
idColour = seqsel.idColour; |
226 |
42 |
outlineColour = seqsel.outlineColour; |
227 |
42 |
seqrep = seqsel.seqrep; |
228 |
42 |
textColour = seqsel.textColour; |
229 |
42 |
textColour2 = seqsel.textColour2; |
230 |
42 |
thresholdTextColour = seqsel.thresholdTextColour; |
231 |
42 |
width = seqsel.width; |
232 |
42 |
ignoreGapsInConsensus = seqsel.ignoreGapsInConsensus; |
233 |
42 |
if (seqsel.conserve != null) |
234 |
|
{ |
235 |
0 |
recalcConservation(); |
236 |
|
|
237 |
|
} |
238 |
|
} |
239 |
|
} |
240 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
241 |
21261 |
public boolean isShowSequenceLogo()... |
242 |
|
{ |
243 |
21261 |
return showSequenceLogo; |
244 |
|
} |
245 |
|
|
|
|
| 0% |
Uncovered Elements: 56 (56) |
Complexity: 11 |
Complexity Density: 0.31 |
|
246 |
0 |
public SequenceI[] getSelectionAsNewSequences(AlignmentI align)... |
247 |
|
{ |
248 |
0 |
int iSize = sequences.size(); |
249 |
0 |
SequenceI[] seqs = new SequenceI[iSize]; |
250 |
0 |
SequenceI[] inorder = getSequencesInOrder(align); |
251 |
|
|
252 |
0 |
for (int i = 0, ipos = 0; i < inorder.length; i++) |
253 |
|
{ |
254 |
0 |
SequenceI seq = inorder[i]; |
255 |
|
|
256 |
0 |
seqs[ipos] = seq.getSubSequence(startRes, endRes + 1); |
257 |
0 |
if (seqs[ipos] != null) |
258 |
|
{ |
259 |
0 |
seqs[ipos].setDescription(seq.getDescription()); |
260 |
0 |
seqs[ipos].setDBRefs(seq.getDBRefs()); |
261 |
0 |
seqs[ipos].setSequenceFeatures(seq.getSequenceFeatures()); |
262 |
0 |
if (seq.getDatasetSequence() != null) |
263 |
|
{ |
264 |
0 |
seqs[ipos].setDatasetSequence(seq.getDatasetSequence()); |
265 |
|
} |
266 |
|
|
267 |
0 |
if (seq.getAnnotation() != null) |
268 |
|
{ |
269 |
0 |
AlignmentAnnotation[] alann = align.getAlignmentAnnotation(); |
270 |
|
|
271 |
|
|
272 |
0 |
for (int a = 0; a < seq.getAnnotation().length; a++) |
273 |
|
{ |
274 |
0 |
AlignmentAnnotation tocopy = seq.getAnnotation()[a]; |
275 |
0 |
if (alann != null) |
276 |
|
{ |
277 |
0 |
boolean found = false; |
278 |
0 |
for (int pos = 0; pos < alann.length; pos++) |
279 |
|
{ |
280 |
0 |
if (alann[pos] == tocopy) |
281 |
|
{ |
282 |
0 |
found = true; |
283 |
0 |
break; |
284 |
|
} |
285 |
|
} |
286 |
0 |
if (!found) |
287 |
|
{ |
288 |
0 |
continue; |
289 |
|
} |
290 |
|
} |
291 |
0 |
AlignmentAnnotation newannot = new AlignmentAnnotation( |
292 |
|
seq.getAnnotation()[a]); |
293 |
0 |
newannot.restrict(startRes, endRes); |
294 |
0 |
newannot.setSequenceRef(seqs[ipos]); |
295 |
0 |
newannot.adjustForAlignment(); |
296 |
0 |
seqs[ipos].addAlignmentAnnotation(newannot); |
297 |
|
} |
298 |
|
} |
299 |
0 |
ipos++; |
300 |
|
} |
301 |
|
else |
302 |
|
{ |
303 |
0 |
iSize--; |
304 |
|
} |
305 |
|
} |
306 |
0 |
if (iSize != inorder.length) |
307 |
|
{ |
308 |
0 |
SequenceI[] nseqs = new SequenceI[iSize]; |
309 |
0 |
System.arraycopy(seqs, 0, nseqs, 0, iSize); |
310 |
0 |
seqs = nseqs; |
311 |
|
} |
312 |
0 |
return seqs; |
313 |
|
|
314 |
|
} |
315 |
|
|
316 |
|
|
317 |
|
|
318 |
|
|
319 |
|
@param |
320 |
|
|
321 |
|
@return |
322 |
|
|
|
|
| 0% |
Uncovered Elements: 15 (15) |
Complexity: 5 |
Complexity Density: 0.56 |
|
323 |
0 |
public int findEndRes(SequenceI seq)... |
324 |
|
{ |
325 |
0 |
int eres = 0; |
326 |
0 |
char ch; |
327 |
|
|
328 |
0 |
for (int j = 0; j < endRes + 1 && j < seq.getLength(); j++) |
329 |
|
{ |
330 |
0 |
ch = seq.getCharAt(j); |
331 |
0 |
if (!jalview.util.Comparison.isGap((ch))) |
332 |
|
{ |
333 |
0 |
eres++; |
334 |
|
} |
335 |
|
} |
336 |
|
|
337 |
0 |
if (eres > 0) |
338 |
|
{ |
339 |
0 |
eres += seq.getStart() - 1; |
340 |
|
} |
341 |
|
|
342 |
0 |
return eres; |
343 |
|
} |
344 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
345 |
10768 |
@Override... |
346 |
|
public List<SequenceI> getSequences() |
347 |
|
{ |
348 |
10768 |
return sequences; |
349 |
|
} |
350 |
|
|
|
|
| 17.6% |
Uncovered Elements: 14 (17) |
Complexity: 5 |
Complexity Density: 0.45 |
|
351 |
1015 |
@Override... |
352 |
|
public List<SequenceI> getSequences( |
353 |
|
Map<SequenceI, SequenceCollectionI> hiddenReps) |
354 |
|
{ |
355 |
1015 |
if (hiddenReps == null) |
356 |
|
{ |
357 |
|
|
358 |
1015 |
return sequences; |
359 |
|
} |
360 |
|
else |
361 |
|
{ |
362 |
0 |
List<SequenceI> allSequences = new ArrayList<>(); |
363 |
0 |
for (SequenceI seq : sequences) |
364 |
|
{ |
365 |
0 |
allSequences.add(seq); |
366 |
0 |
if (hiddenReps.containsKey(seq)) |
367 |
|
{ |
368 |
0 |
SequenceCollectionI hsg = hiddenReps.get(seq); |
369 |
0 |
for (SequenceI seq2 : hsg.getSequences()) |
370 |
|
{ |
371 |
0 |
if (seq2 != seq && !allSequences.contains(seq2)) |
372 |
|
{ |
373 |
0 |
allSequences.add(seq2); |
374 |
|
} |
375 |
|
} |
376 |
|
} |
377 |
|
} |
378 |
|
|
379 |
0 |
return allSequences; |
380 |
|
} |
381 |
|
} |
382 |
|
|
|
|
| 66.7% |
Uncovered Elements: 2 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
383 |
5 |
public SequenceI[] getSequencesAsArray(... |
384 |
|
Map<SequenceI, SequenceCollectionI> map) |
385 |
|
{ |
386 |
5 |
List<SequenceI> tmp = getSequences(map); |
387 |
5 |
if (tmp == null) |
388 |
|
{ |
389 |
0 |
return null; |
390 |
|
} |
391 |
5 |
return tmp.toArray(new SequenceI[tmp.size()]); |
392 |
|
} |
393 |
|
|
394 |
|
|
395 |
|
|
396 |
|
|
397 |
|
@param |
398 |
|
|
399 |
|
|
400 |
|
@return |
401 |
|
|
|
|
| 0% |
Uncovered Elements: 14 (14) |
Complexity: 4 |
Complexity Density: 0.5 |
|
402 |
0 |
public boolean adjustForRemoveLeft(int col)... |
403 |
|
{ |
404 |
|
|
405 |
0 |
if (startRes >= col) |
406 |
|
{ |
407 |
0 |
startRes = startRes - col; |
408 |
|
} |
409 |
|
|
410 |
0 |
if (endRes >= col) |
411 |
|
{ |
412 |
0 |
endRes = endRes - col; |
413 |
|
|
414 |
0 |
if (startRes > endRes) |
415 |
|
{ |
416 |
0 |
startRes = 0; |
417 |
|
} |
418 |
|
} |
419 |
|
else |
420 |
|
{ |
421 |
|
|
422 |
0 |
return false; |
423 |
|
} |
424 |
|
|
425 |
0 |
return true; |
426 |
|
} |
427 |
|
|
428 |
|
|
429 |
|
|
430 |
|
|
431 |
|
@param |
432 |
|
|
433 |
|
|
434 |
|
@return |
435 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
436 |
0 |
public boolean adjustForRemoveRight(int col)... |
437 |
|
{ |
438 |
0 |
if (startRes > col) |
439 |
|
{ |
440 |
|
|
441 |
0 |
return false; |
442 |
|
} |
443 |
|
|
444 |
0 |
if (endRes >= col) |
445 |
|
{ |
446 |
0 |
endRes = col; |
447 |
|
} |
448 |
|
|
449 |
0 |
return true; |
450 |
|
} |
451 |
|
|
452 |
|
|
453 |
|
|
454 |
|
|
455 |
|
@return |
456 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
457 |
291 |
public String getName()... |
458 |
|
{ |
459 |
291 |
return groupName; |
460 |
|
} |
461 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
462 |
13 |
public String getDescription()... |
463 |
|
{ |
464 |
13 |
return description; |
465 |
|
} |
466 |
|
|
467 |
|
|
468 |
|
|
469 |
|
|
470 |
|
@param |
471 |
|
|
472 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
473 |
20 |
public void setName(String name)... |
474 |
|
{ |
475 |
20 |
groupName = name; |
476 |
|
|
477 |
|
} |
478 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
479 |
11 |
public void setDescription(String desc)... |
480 |
|
{ |
481 |
11 |
description = desc; |
482 |
|
} |
483 |
|
|
484 |
|
|
485 |
|
|
486 |
|
|
487 |
|
@return |
488 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
489 |
0 |
public Conservation getConservation()... |
490 |
|
{ |
491 |
0 |
return conserve; |
492 |
|
} |
493 |
|
|
494 |
|
|
495 |
|
|
496 |
|
|
497 |
|
@param |
498 |
|
|
499 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
500 |
0 |
public void setConservation(Conservation c)... |
501 |
|
{ |
502 |
0 |
conserve = c; |
503 |
|
} |
504 |
|
|
505 |
|
|
506 |
|
|
507 |
|
|
508 |
|
|
509 |
|
|
510 |
|
@param |
511 |
|
|
512 |
|
@param |
513 |
|
|
514 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (10) |
Complexity: 4 |
Complexity Density: 0.67 |
|
515 |
604 |
public void addSequence(SequenceI s, boolean recalc)... |
516 |
|
{ |
517 |
604 |
synchronized (sequences) |
518 |
|
{ |
519 |
604 |
if (s != null && !sequences.contains(s)) |
520 |
|
{ |
521 |
593 |
sequences.add(s); |
522 |
593 |
changeSupport.firePropertyChange(SEQ_GROUP_CHANGED, |
523 |
|
sequences.size() - 1, sequences.size()); |
524 |
|
} |
525 |
|
|
526 |
604 |
if (recalc) |
527 |
|
{ |
528 |
1 |
recalcConservation(); |
529 |
|
} |
530 |
|
} |
531 |
|
} |
532 |
|
|
533 |
|
|
534 |
|
|
535 |
|
|
536 |
|
private int consPercGaps = 25; |
537 |
|
|
538 |
|
|
539 |
|
@return |
540 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
541 |
0 |
public int getConsPercGaps()... |
542 |
|
{ |
543 |
0 |
return consPercGaps; |
544 |
|
} |
545 |
|
|
546 |
|
|
547 |
|
|
548 |
|
|
549 |
|
@param |
550 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
551 |
0 |
public void setConsPercGaps(int consPercGaps)... |
552 |
|
{ |
553 |
0 |
this.consPercGaps = consPercGaps; |
554 |
|
} |
555 |
|
|
556 |
|
|
557 |
|
|
558 |
|
|
559 |
|
|
560 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
561 |
470 |
public boolean recalcConservation()... |
562 |
|
{ |
563 |
470 |
return recalcConservation(false); |
564 |
|
} |
565 |
|
|
566 |
|
|
567 |
|
|
568 |
|
|
569 |
|
|
570 |
|
@param |
571 |
|
|
572 |
|
|
573 |
|
|
|
|
| 75.6% |
Uncovered Elements: 11 (45) |
Complexity: 16 |
Complexity Density: 0.59 |
|
574 |
470 |
public boolean recalcConservation(boolean defer)... |
575 |
|
{ |
576 |
470 |
if (cs == null && consensus == null && conservation == null) |
577 |
|
{ |
578 |
0 |
return false; |
579 |
|
} |
580 |
|
|
581 |
|
|
582 |
470 |
boolean upd = false; |
583 |
470 |
try |
584 |
|
{ |
585 |
470 |
ProfilesI cnsns = AAFrequency.calculate(sequences, startRes, |
586 |
|
endRes + 1, showSequenceLogo); |
587 |
470 |
if (consensus != null) |
588 |
|
{ |
589 |
180 |
_updateConsensusRow(cnsns, sequences.size()); |
590 |
180 |
upd = true; |
591 |
|
} |
592 |
470 |
if (cs != null) |
593 |
|
{ |
594 |
470 |
cs.setConsensus(cnsns); |
595 |
470 |
upd = true; |
596 |
|
} |
597 |
|
|
598 |
470 |
if ((conservation != null) |
599 |
|
|| (cs != null && cs.conservationApplied())) |
600 |
|
{ |
601 |
3 |
Conservation c = new Conservation(groupName, sequences, startRes, |
602 |
|
endRes + 1); |
603 |
3 |
c.calculate(); |
604 |
3 |
c.verdict(false, consPercGaps); |
605 |
3 |
if (conservation != null) |
606 |
|
{ |
607 |
0 |
_updateConservationRow(c); |
608 |
|
} |
609 |
3 |
if (cs != null) |
610 |
|
{ |
611 |
3 |
if (cs.conservationApplied()) |
612 |
|
{ |
613 |
3 |
cs.setConservation(c); |
614 |
|
} |
615 |
|
} |
616 |
|
|
617 |
3 |
upd = true; |
618 |
|
} |
619 |
470 |
if (cs != null && !defer) |
620 |
|
{ |
621 |
|
|
622 |
470 |
cs.alignmentChanged(context != null ? context : this, null); |
623 |
470 |
return true; |
624 |
|
} |
625 |
|
else |
626 |
|
{ |
627 |
0 |
return upd; |
628 |
|
} |
629 |
|
} catch (java.lang.OutOfMemoryError err) |
630 |
|
{ |
631 |
|
|
632 |
0 |
System.out.println("Out of memory loading groups: " + err); |
633 |
|
} |
634 |
0 |
return upd; |
635 |
|
} |
636 |
|
|
|
|
| 0% |
Uncovered Elements: 14 (14) |
Complexity: 4 |
Complexity Density: 0.5 |
|
637 |
0 |
private void _updateConservationRow(Conservation c)... |
638 |
|
{ |
639 |
0 |
if (conservation == null) |
640 |
|
{ |
641 |
0 |
getConservation(); |
642 |
|
} |
643 |
|
|
644 |
0 |
conservation.label = "Conservation for " + getName(); |
645 |
0 |
conservation.description = "Conservation for group " + getName() |
646 |
|
+ " less than " + consPercGaps + "% gaps"; |
647 |
|
|
648 |
0 |
int aWidth = (conservation.annotations != null) |
649 |
0 |
? (endRes < conservation.annotations.length |
650 |
|
? conservation.annotations.length |
651 |
|
: endRes + 1) |
652 |
|
: endRes + 1; |
653 |
0 |
conservation.annotations = null; |
654 |
0 |
conservation.annotations = new Annotation[aWidth]; |
655 |
|
|
656 |
0 |
c.completeAnnotations(conservation, null, startRes, endRes + 1); |
657 |
|
} |
658 |
|
|
659 |
|
public ProfilesI consensusData = null; |
660 |
|
|
|
|
| 73.3% |
Uncovered Elements: 4 (15) |
Complexity: 4 |
Complexity Density: 0.44 |
|
661 |
180 |
private void _updateConsensusRow(ProfilesI cnsns, long nseq)... |
662 |
|
{ |
663 |
180 |
if (consensus == null) |
664 |
|
{ |
665 |
0 |
getConsensus(); |
666 |
|
} |
667 |
180 |
consensus.label = "Consensus for " + getName(); |
668 |
180 |
consensus.description = "Percent Identity"; |
669 |
180 |
consensusData = cnsns; |
670 |
|
|
671 |
180 |
int aWidth = (consensus.annotations != null) |
672 |
180 |
? (endRes < consensus.annotations.length |
673 |
|
? consensus.annotations.length |
674 |
|
: endRes + 1) |
675 |
|
: endRes + 1; |
676 |
180 |
consensus.annotations = null; |
677 |
180 |
consensus.annotations = new Annotation[aWidth]; |
678 |
|
|
679 |
180 |
AAFrequency.completeConsensus(consensus, cnsns, startRes, endRes + 1, |
680 |
|
ignoreGapsInConsensus, showSequenceLogo, nseq); |
681 |
|
|
682 |
|
|
683 |
|
|
684 |
|
} |
685 |
|
|
686 |
|
|
687 |
|
@param |
688 |
|
|
689 |
|
@param |
690 |
|
|
691 |
|
|
692 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
693 |
4 |
public void addOrRemove(SequenceI s, boolean recalc)... |
694 |
|
{ |
695 |
4 |
synchronized (sequences) |
696 |
|
{ |
697 |
4 |
if (sequences.contains(s)) |
698 |
|
{ |
699 |
1 |
deleteSequence(s, recalc); |
700 |
|
} |
701 |
|
else |
702 |
|
{ |
703 |
3 |
addSequence(s, recalc); |
704 |
|
} |
705 |
|
} |
706 |
|
} |
707 |
|
|
708 |
|
|
709 |
|
|
710 |
|
|
711 |
|
@param |
712 |
|
|
713 |
|
@param |
714 |
|
|
715 |
|
|
|
|
| 71.4% |
Uncovered Elements: 2 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
716 |
35 |
public void deleteSequence(SequenceI s, boolean recalc)... |
717 |
|
{ |
718 |
35 |
synchronized (sequences) |
719 |
|
{ |
720 |
35 |
sequences.remove(s); |
721 |
35 |
changeSupport.firePropertyChange(SEQ_GROUP_CHANGED, |
722 |
|
sequences.size() + 1, sequences.size()); |
723 |
|
|
724 |
35 |
if (recalc) |
725 |
|
{ |
726 |
0 |
recalcConservation(); |
727 |
|
} |
728 |
|
} |
729 |
|
} |
730 |
|
|
731 |
|
|
732 |
|
|
733 |
|
|
734 |
|
@return |
735 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
736 |
541301 |
@Override... |
737 |
|
public int getStartRes() |
738 |
|
{ |
739 |
541301 |
return startRes; |
740 |
|
} |
741 |
|
|
742 |
|
|
743 |
|
|
744 |
|
@return |
745 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
746 |
531692 |
@Override... |
747 |
|
public int getEndRes() |
748 |
|
{ |
749 |
531692 |
return endRes; |
750 |
|
} |
751 |
|
|
752 |
|
|
753 |
|
|
754 |
|
|
755 |
|
@param |
756 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
757 |
76 |
public void setStartRes(int i)... |
758 |
|
{ |
759 |
76 |
int before = startRes; |
760 |
76 |
startRes = i; |
761 |
76 |
changeSupport.firePropertyChange(SEQ_GROUP_CHANGED, before, startRes); |
762 |
|
} |
763 |
|
|
764 |
|
|
765 |
|
|
766 |
|
|
767 |
|
@param |
768 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
769 |
89 |
public void setEndRes(int i)... |
770 |
|
{ |
771 |
89 |
int before = endRes; |
772 |
89 |
endRes = i; |
773 |
89 |
changeSupport.firePropertyChange(SEQ_GROUP_CHANGED, before, endRes); |
774 |
|
} |
775 |
|
|
776 |
|
|
777 |
|
@return |
778 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
779 |
454 |
public int getSize()... |
780 |
|
{ |
781 |
454 |
return sequences.size(); |
782 |
|
} |
783 |
|
|
784 |
|
|
785 |
|
@param |
786 |
|
@return |
787 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
788 |
58 |
public SequenceI getSequenceAt(int i)... |
789 |
|
{ |
790 |
58 |
return sequences.get(i); |
791 |
|
} |
792 |
|
|
793 |
|
|
794 |
|
@param |
795 |
|
|
796 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
797 |
17 |
public void setColourText(boolean state)... |
798 |
|
{ |
799 |
17 |
colourText = state; |
800 |
|
} |
801 |
|
|
802 |
|
|
803 |
|
|
804 |
|
|
805 |
|
@return |
806 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
807 |
264826 |
public boolean getColourText()... |
808 |
|
{ |
809 |
264826 |
return colourText; |
810 |
|
} |
811 |
|
|
812 |
|
|
813 |
|
|
814 |
|
|
815 |
|
@param |
816 |
|
|
817 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
818 |
14 |
public void setDisplayText(boolean state)... |
819 |
|
{ |
820 |
14 |
displayText = state; |
821 |
|
} |
822 |
|
|
823 |
|
|
824 |
|
|
825 |
|
|
826 |
|
@return |
827 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
828 |
264813 |
public boolean getDisplayText()... |
829 |
|
{ |
830 |
264813 |
return displayText; |
831 |
|
} |
832 |
|
|
833 |
|
|
834 |
|
|
835 |
|
|
836 |
|
@param |
837 |
|
|
838 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
839 |
14 |
public void setDisplayBoxes(boolean state)... |
840 |
|
{ |
841 |
14 |
displayBoxes = state; |
842 |
|
} |
843 |
|
|
844 |
|
|
845 |
|
|
846 |
|
|
847 |
|
@return |
848 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
849 |
264822 |
public boolean getDisplayBoxes()... |
850 |
|
{ |
851 |
264822 |
return displayBoxes; |
852 |
|
} |
853 |
|
|
854 |
|
|
855 |
|
|
856 |
|
|
857 |
|
@return |
858 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 3 |
Complexity Density: 0.43 |
|
859 |
386 |
@Override... |
860 |
|
public int getWidth() |
861 |
|
{ |
862 |
386 |
synchronized (sequences) |
863 |
|
{ |
864 |
|
|
865 |
386 |
boolean first = true; |
866 |
386 |
for (SequenceI seq : sequences) |
867 |
|
{ |
868 |
1282 |
if (first || seq.getLength() > width) |
869 |
|
{ |
870 |
392 |
width = seq.getLength(); |
871 |
392 |
first = false; |
872 |
|
} |
873 |
|
} |
874 |
386 |
return width; |
875 |
|
} |
876 |
|
} |
877 |
|
|
878 |
|
|
879 |
|
|
880 |
|
|
881 |
|
@param |
882 |
|
|
883 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
884 |
82 |
public void setOutlineColour(Color c)... |
885 |
|
{ |
886 |
82 |
outlineColour = c; |
887 |
|
} |
888 |
|
|
889 |
|
|
890 |
|
|
891 |
|
|
892 |
|
@return |
893 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
894 |
914 |
public Color getOutlineColour()... |
895 |
|
{ |
896 |
914 |
return outlineColour; |
897 |
|
} |
898 |
|
|
899 |
|
|
900 |
|
|
901 |
|
|
902 |
|
|
903 |
|
|
904 |
|
|
905 |
|
@param |
906 |
|
|
907 |
|
@return |
908 |
|
|
909 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
910 |
72 |
public SequenceI[] getSequencesInOrder(AlignmentI al)... |
911 |
|
{ |
912 |
72 |
return getSequencesInOrder(al, true); |
913 |
|
} |
914 |
|
|
915 |
|
|
916 |
|
|
917 |
|
|
918 |
|
|
919 |
|
|
920 |
|
@param |
921 |
|
@param |
922 |
|
@return |
923 |
|
|
|
|
| 66.7% |
Uncovered Elements: 12 (36) |
Complexity: 10 |
Complexity Density: 0.5 |
|
924 |
78 |
public SequenceI[] getSequencesInOrder(AlignmentI al, boolean trim)... |
925 |
|
{ |
926 |
78 |
synchronized (sequences) |
927 |
|
{ |
928 |
78 |
int sSize = sequences.size(); |
929 |
78 |
int alHeight = al.getHeight(); |
930 |
|
|
931 |
78 |
SequenceI[] seqs = new SequenceI[(trim) ? sSize : alHeight]; |
932 |
|
|
933 |
78 |
int index = 0; |
934 |
856 |
for (int i = 0; i < alHeight && index < sSize; i++) |
935 |
|
{ |
936 |
778 |
if (sequences.contains(al.getSequenceAt(i))) |
937 |
|
{ |
938 |
265 |
seqs[(trim) ? index : i] = al.getSequenceAt(i); |
939 |
265 |
index++; |
940 |
|
} |
941 |
|
} |
942 |
78 |
if (index == 0) |
943 |
|
{ |
944 |
10 |
return null; |
945 |
|
} |
946 |
68 |
if (!trim) |
947 |
|
{ |
948 |
0 |
return seqs; |
949 |
|
} |
950 |
68 |
if (index < seqs.length) |
951 |
|
{ |
952 |
0 |
SequenceI[] dummy = seqs; |
953 |
0 |
seqs = new SequenceI[index]; |
954 |
0 |
while (--index >= 0) |
955 |
|
{ |
956 |
0 |
seqs[index] = dummy[index]; |
957 |
0 |
dummy[index] = null; |
958 |
|
} |
959 |
|
} |
960 |
68 |
return seqs; |
961 |
|
} |
962 |
|
} |
963 |
|
|
964 |
|
|
965 |
|
@return |
966 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
967 |
12 |
public Color getIdColour()... |
968 |
|
{ |
969 |
12 |
return idColour; |
970 |
|
} |
971 |
|
|
972 |
|
|
973 |
|
@param |
974 |
|
|
975 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
976 |
4 |
public void setIdColour(Color idColour)... |
977 |
|
{ |
978 |
4 |
this.idColour = idColour; |
979 |
|
} |
980 |
|
|
981 |
|
|
982 |
|
@return |
983 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
984 |
264792 |
@Override... |
985 |
|
public SequenceI getSeqrep() |
986 |
|
{ |
987 |
264792 |
return seqrep; |
988 |
|
} |
989 |
|
|
990 |
|
|
991 |
|
|
992 |
|
|
993 |
|
|
994 |
|
@param |
995 |
|
|
996 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
997 |
17 |
@Override... |
998 |
|
public void setSeqrep(SequenceI seqrep) |
999 |
|
{ |
1000 |
17 |
this.seqrep = seqrep; |
1001 |
|
} |
1002 |
|
|
1003 |
|
|
1004 |
|
|
1005 |
|
@return |
1006 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1007 |
6 |
@Override... |
1008 |
|
public boolean hasSeqrep() |
1009 |
|
{ |
1010 |
6 |
return seqrep != null; |
1011 |
|
} |
1012 |
|
|
1013 |
|
|
1014 |
|
|
1015 |
|
|
1016 |
|
|
1017 |
|
@param |
1018 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1019 |
6 |
public void setHidereps(boolean visibility)... |
1020 |
|
{ |
1021 |
6 |
hidereps = visibility; |
1022 |
|
} |
1023 |
|
|
1024 |
|
|
1025 |
|
|
1026 |
|
@return |
1027 |
|
|
1028 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1029 |
8 |
public boolean isHidereps()... |
1030 |
|
{ |
1031 |
8 |
return hidereps; |
1032 |
|
} |
1033 |
|
|
1034 |
|
|
1035 |
|
|
1036 |
|
|
1037 |
|
@param |
1038 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1039 |
1 |
public void setHideCols(boolean visibility)... |
1040 |
|
{ |
1041 |
1 |
hidecols = visibility; |
1042 |
|
} |
1043 |
|
|
1044 |
|
|
1045 |
|
|
1046 |
|
@return |
1047 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1048 |
8 |
public boolean isHideCols()... |
1049 |
|
{ |
1050 |
8 |
return hidecols; |
1051 |
|
} |
1052 |
|
|
1053 |
|
|
1054 |
|
|
1055 |
|
|
1056 |
|
|
1057 |
|
@param |
1058 |
|
|
1059 |
|
@param |
1060 |
|
|
1061 |
|
@return |
1062 |
|
|
|
|
| 54.5% |
Uncovered Elements: 5 (11) |
Complexity: 5 |
Complexity Density: 0.71 |
|
1063 |
10 |
public SequenceGroup intersect(AlignmentI alignment,... |
1064 |
|
Map<SequenceI, SequenceCollectionI> map) |
1065 |
|
{ |
1066 |
10 |
SequenceGroup sgroup = new SequenceGroup(this); |
1067 |
10 |
SequenceI[] insect = getSequencesInOrder(alignment); |
1068 |
10 |
sgroup.sequences = new ArrayList<>(); |
1069 |
10 |
for (int s = 0; insect != null && s < insect.length; s++) |
1070 |
|
{ |
1071 |
0 |
if (map == null || map.containsKey(insect[s])) |
1072 |
|
{ |
1073 |
0 |
sgroup.sequences.add(insect[s]); |
1074 |
|
} |
1075 |
|
} |
1076 |
10 |
return sgroup; |
1077 |
|
} |
1078 |
|
|
1079 |
|
|
1080 |
|
@return |
1081 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1082 |
262001 |
public boolean getShowNonconserved()... |
1083 |
|
{ |
1084 |
262001 |
return showNonconserved; |
1085 |
|
} |
1086 |
|
|
1087 |
|
|
1088 |
|
@param |
1089 |
|
|
1090 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1091 |
81 |
public void setShowNonconserved(boolean displayNonconserved)... |
1092 |
|
{ |
1093 |
81 |
this.showNonconserved = displayNonconserved; |
1094 |
|
} |
1095 |
|
|
1096 |
|
|
1097 |
|
|
1098 |
|
|
1099 |
|
|
1100 |
|
@param |
1101 |
|
|
|
|
| 75% |
Uncovered Elements: 1 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
1102 |
36 |
public void setConsensus(AlignmentAnnotation aan)... |
1103 |
|
{ |
1104 |
36 |
if (consensus == null) |
1105 |
|
{ |
1106 |
36 |
consensus = aan; |
1107 |
|
} |
1108 |
|
} |
1109 |
|
|
1110 |
|
|
1111 |
|
|
1112 |
|
@return |
1113 |
|
|
1114 |
|
|
|
|
| 40% |
Uncovered Elements: 9 (15) |
Complexity: 3 |
Complexity Density: 0.27 |
|
1115 |
384 |
public AlignmentAnnotation getConsensus()... |
1116 |
|
{ |
1117 |
|
|
1118 |
384 |
int aWidth = this.getWidth(); |
1119 |
|
|
1120 |
|
|
1121 |
|
|
1122 |
384 |
if (aWidth < 0) |
1123 |
|
{ |
1124 |
0 |
return null; |
1125 |
|
} |
1126 |
384 |
if (consensus == null) |
1127 |
|
{ |
1128 |
0 |
consensus = new AlignmentAnnotation("", "", new Annotation[1], 0f, |
1129 |
|
100f, AlignmentAnnotation.BAR_GRAPH); |
1130 |
0 |
consensus.hasText = true; |
1131 |
0 |
consensus.autoCalculated = true; |
1132 |
0 |
consensus.groupRef = this; |
1133 |
0 |
consensus.label = "Consensus for " + getName(); |
1134 |
0 |
consensus.description = "Percent Identity"; |
1135 |
|
} |
1136 |
384 |
return consensus; |
1137 |
|
} |
1138 |
|
|
1139 |
|
|
1140 |
|
|
1141 |
|
|
1142 |
|
|
1143 |
|
@param |
1144 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
1145 |
0 |
public void setConservationRow(AlignmentAnnotation aan)... |
1146 |
|
{ |
1147 |
0 |
if (conservation == null) |
1148 |
|
{ |
1149 |
0 |
conservation = aan; |
1150 |
|
} |
1151 |
|
} |
1152 |
|
|
1153 |
|
|
1154 |
|
|
1155 |
|
|
1156 |
|
@return |
1157 |
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 2 |
Complexity Density: 0.25 |
|
1158 |
0 |
public AlignmentAnnotation getConservationRow()... |
1159 |
|
{ |
1160 |
0 |
if (conservation == null) |
1161 |
|
{ |
1162 |
0 |
conservation = new AlignmentAnnotation("", "", new Annotation[1], 0f, |
1163 |
|
11f, AlignmentAnnotation.BAR_GRAPH); |
1164 |
|
} |
1165 |
|
|
1166 |
0 |
conservation.hasText = true; |
1167 |
0 |
conservation.autoCalculated = true; |
1168 |
0 |
conservation.groupRef = this; |
1169 |
0 |
conservation.label = "Conservation for " + getName(); |
1170 |
0 |
conservation.description = "Conservation for group " + getName() |
1171 |
|
+ " less than " + consPercGaps + "% gaps"; |
1172 |
0 |
return conservation; |
1173 |
|
} |
1174 |
|
|
1175 |
|
|
1176 |
|
|
1177 |
|
@return |
1178 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1179 |
0 |
public boolean hasAnnotationRows()... |
1180 |
|
{ |
1181 |
0 |
return consensus != null || conservation != null; |
1182 |
|
} |
1183 |
|
|
|
|
| 0% |
Uncovered Elements: 19 (19) |
Complexity: 6 |
Complexity Density: 0.55 |
|
1184 |
0 |
public SequenceI getConsensusSeq()... |
1185 |
|
{ |
1186 |
0 |
getConsensus(); |
1187 |
0 |
StringBuffer seqs = new StringBuffer(); |
1188 |
0 |
for (int i = 0; i < consensus.annotations.length; i++) |
1189 |
|
{ |
1190 |
0 |
if (consensus.annotations[i] != null) |
1191 |
|
{ |
1192 |
0 |
String desc = consensus.annotations[i].description; |
1193 |
0 |
if (desc.length() > 1 && desc.charAt(0) == '[') |
1194 |
|
{ |
1195 |
0 |
seqs.append(desc.charAt(1)); |
1196 |
|
} |
1197 |
|
else |
1198 |
|
{ |
1199 |
0 |
seqs.append(consensus.annotations[i].displayCharacter); |
1200 |
|
} |
1201 |
|
} |
1202 |
|
} |
1203 |
|
|
1204 |
0 |
SequenceI sq = new Sequence("Group" + getName() + " Consensus", |
1205 |
|
seqs.toString()); |
1206 |
0 |
sq.setDescription("Percentage Identity Consensus " |
1207 |
0 |
+ ((ignoreGapsInConsensus) ? " without gaps" : "")); |
1208 |
0 |
return sq; |
1209 |
|
} |
1210 |
|
|
|
|
| 50% |
Uncovered Elements: 3 (6) |
Complexity: 3 |
Complexity Density: 0.75 |
|
1211 |
64 |
public void setIgnoreGapsConsensus(boolean state)... |
1212 |
|
{ |
1213 |
64 |
if (this.ignoreGapsInConsensus != state && consensus != null) |
1214 |
|
{ |
1215 |
0 |
ignoreGapsInConsensus = state; |
1216 |
0 |
recalcConservation(); |
1217 |
|
} |
1218 |
64 |
ignoreGapsInConsensus = state; |
1219 |
|
} |
1220 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1221 |
20921 |
public boolean getIgnoreGapsConsensus()... |
1222 |
|
{ |
1223 |
20921 |
return ignoreGapsInConsensus; |
1224 |
|
} |
1225 |
|
|
1226 |
|
|
1227 |
|
@param |
1228 |
|
|
1229 |
|
|
|
|
| 50% |
Uncovered Elements: 3 (6) |
Complexity: 3 |
Complexity Density: 0.75 |
|
1230 |
73 |
public void setshowSequenceLogo(boolean showSequenceLogo)... |
1231 |
|
{ |
1232 |
|
|
1233 |
73 |
if (this.showSequenceLogo != showSequenceLogo && consensus != null) |
1234 |
|
{ |
1235 |
0 |
this.showSequenceLogo = showSequenceLogo; |
1236 |
0 |
recalcConservation(); |
1237 |
|
} |
1238 |
73 |
this.showSequenceLogo = showSequenceLogo; |
1239 |
|
} |
1240 |
|
|
1241 |
|
|
1242 |
|
|
1243 |
|
@param |
1244 |
|
|
1245 |
|
|
1246 |
|
|
|
|
| 50% |
Uncovered Elements: 3 (6) |
Complexity: 3 |
Complexity Density: 0.75 |
|
1247 |
73 |
public void setShowConsensusHistogram(boolean showConsHist)... |
1248 |
|
{ |
1249 |
|
|
1250 |
73 |
if (showConsensusHistogram != showConsHist && consensus != null) |
1251 |
|
{ |
1252 |
0 |
this.showConsensusHistogram = showConsHist; |
1253 |
0 |
recalcConservation(); |
1254 |
|
} |
1255 |
73 |
this.showConsensusHistogram = showConsHist; |
1256 |
|
} |
1257 |
|
|
1258 |
|
|
1259 |
|
@return |
1260 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1261 |
363 |
public boolean isShowConsensusHistogram()... |
1262 |
|
{ |
1263 |
363 |
return showConsensusHistogram; |
1264 |
|
} |
1265 |
|
|
1266 |
|
|
1267 |
|
|
1268 |
|
|
1269 |
|
@param |
1270 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1271 |
23 |
public void setNormaliseSequenceLogo(boolean norm)... |
1272 |
|
{ |
1273 |
23 |
normaliseSequenceLogo = norm; |
1274 |
|
} |
1275 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1276 |
363 |
public boolean isNormaliseSequenceLogo()... |
1277 |
|
{ |
1278 |
363 |
return normaliseSequenceLogo; |
1279 |
|
} |
1280 |
|
|
|
|
| 0% |
Uncovered Elements: 21 (21) |
Complexity: 5 |
Complexity Density: 0.38 |
|
1281 |
0 |
@Override... |
1282 |
|
|
1283 |
|
|
1284 |
|
|
1285 |
|
public AlignmentAnnotation[] getAlignmentAnnotation() |
1286 |
|
{ |
1287 |
|
|
1288 |
|
|
1289 |
0 |
ArrayList<AlignmentAnnotation> annot = new ArrayList<>(); |
1290 |
0 |
synchronized (sequences) |
1291 |
|
{ |
1292 |
0 |
for (SequenceI seq : sequences) |
1293 |
|
{ |
1294 |
0 |
AlignmentAnnotation[] aa = seq.getAnnotation(); |
1295 |
0 |
if (aa != null) |
1296 |
|
{ |
1297 |
0 |
for (AlignmentAnnotation al : aa) |
1298 |
|
{ |
1299 |
0 |
if (al.groupRef == this) |
1300 |
|
{ |
1301 |
0 |
annot.add(al); |
1302 |
|
} |
1303 |
|
} |
1304 |
|
} |
1305 |
|
} |
1306 |
0 |
if (consensus != null) |
1307 |
|
{ |
1308 |
0 |
annot.add(consensus); |
1309 |
|
} |
1310 |
0 |
if (conservation != null) |
1311 |
|
{ |
1312 |
0 |
annot.add(conservation); |
1313 |
|
} |
1314 |
|
} |
1315 |
0 |
return annot.toArray(new AlignmentAnnotation[0]); |
1316 |
|
} |
1317 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1318 |
0 |
@Override... |
1319 |
|
public Iterable<AlignmentAnnotation> findAnnotation(String calcId) |
1320 |
|
{ |
1321 |
0 |
return AlignmentAnnotation.findAnnotation( |
1322 |
|
Arrays.asList(getAlignmentAnnotation()), calcId); |
1323 |
|
} |
1324 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1325 |
0 |
@Override... |
1326 |
|
public Iterable<AlignmentAnnotation> findAnnotations(SequenceI seq, |
1327 |
|
String calcId, String label) |
1328 |
|
{ |
1329 |
0 |
return AlignmentAnnotation.findAnnotations( |
1330 |
|
Arrays.asList(getAlignmentAnnotation()), seq, calcId, label); |
1331 |
|
} |
1332 |
|
|
1333 |
|
|
1334 |
|
|
1335 |
|
|
1336 |
|
@param |
1337 |
|
@return |
1338 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1339 |
0 |
public boolean hasAnnotation(String calcId)... |
1340 |
|
{ |
1341 |
0 |
return AlignmentAnnotation |
1342 |
|
.hasAnnotation(Arrays.asList(getAlignmentAnnotation()), calcId); |
1343 |
|
} |
1344 |
|
|
1345 |
|
|
1346 |
|
|
1347 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
1348 |
12 |
public void clear()... |
1349 |
|
{ |
1350 |
12 |
synchronized (sequences) |
1351 |
|
{ |
1352 |
12 |
int before = sequences.size(); |
1353 |
12 |
sequences.clear(); |
1354 |
12 |
changeSupport.firePropertyChange(SEQ_GROUP_CHANGED, before, |
1355 |
|
sequences.size()); |
1356 |
|
} |
1357 |
|
} |
1358 |
|
|
1359 |
|
|
1360 |
|
|
1361 |
|
|
1362 |
|
|
1363 |
|
@param |
1364 |
|
|
1365 |
|
@param |
1366 |
|
|
1367 |
|
|
1368 |
|
@throws |
1369 |
|
|
1370 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
1371 |
112 |
public void setContext(AnnotatedCollectionI ctx, boolean defined)... |
1372 |
|
{ |
1373 |
112 |
setContext(ctx); |
1374 |
111 |
this.isDefined = defined; |
1375 |
|
} |
1376 |
|
|
1377 |
|
|
1378 |
|
|
1379 |
|
|
1380 |
|
@param |
1381 |
|
|
1382 |
|
@throws |
1383 |
|
|
1384 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (10) |
Complexity: 4 |
Complexity Density: 0.67 |
|
1385 |
146 |
public void setContext(AnnotatedCollectionI ctx)... |
1386 |
|
{ |
1387 |
146 |
AnnotatedCollectionI ref = ctx; |
1388 |
388 |
while (ref != null) |
1389 |
|
{ |
1390 |
245 |
if (ref == this || ref.getContext() == ctx) |
1391 |
|
{ |
1392 |
3 |
throw new IllegalArgumentException( |
1393 |
|
"Circular reference in SequenceGroup.context"); |
1394 |
|
} |
1395 |
242 |
ref = ref.getContext(); |
1396 |
|
} |
1397 |
143 |
this.context = ctx; |
1398 |
|
} |
1399 |
|
|
1400 |
|
|
1401 |
|
|
1402 |
|
|
1403 |
|
@see |
1404 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1405 |
106 |
@Override... |
1406 |
|
public AnnotatedCollectionI getContext() |
1407 |
|
{ |
1408 |
106 |
return context; |
1409 |
|
} |
1410 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1411 |
9 |
public boolean isDefined()... |
1412 |
|
{ |
1413 |
9 |
return isDefined; |
1414 |
|
} |
1415 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
1416 |
33 |
public void setColourScheme(ColourSchemeI scheme)... |
1417 |
|
{ |
1418 |
33 |
if (cs == null) |
1419 |
|
{ |
1420 |
1 |
cs = new ResidueShader(); |
1421 |
|
} |
1422 |
33 |
cs.setColourScheme(scheme); |
1423 |
|
} |
1424 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1425 |
2 |
public void setGroupColourScheme(ResidueShaderI scheme)... |
1426 |
|
{ |
1427 |
2 |
cs = scheme; |
1428 |
|
} |
1429 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 2 |
Complexity Density: 2 |
|
1430 |
62 |
public ColourSchemeI getColourScheme()... |
1431 |
|
{ |
1432 |
62 |
return cs == null ? null : cs.getColourScheme(); |
1433 |
|
} |
1434 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1435 |
264952 |
public ResidueShaderI getGroupColourScheme()... |
1436 |
|
{ |
1437 |
264952 |
return cs; |
1438 |
|
} |
1439 |
|
|
|
|
| 60% |
Uncovered Elements: 2 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
1440 |
48 |
@Override... |
1441 |
|
public boolean isNucleotide() |
1442 |
|
{ |
1443 |
48 |
if (context != null) |
1444 |
|
{ |
1445 |
48 |
return context.isNucleotide(); |
1446 |
|
} |
1447 |
0 |
return false; |
1448 |
|
} |
1449 |
|
|
1450 |
|
|
1451 |
|
@param |
1452 |
|
@return |
1453 |
|
|
1454 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1455 |
3 |
public boolean contains(SequenceI seq1)... |
1456 |
|
{ |
1457 |
3 |
return sequences.contains(seq1); |
1458 |
|
} |
1459 |
|
|
1460 |
|
|
1461 |
|
@param |
1462 |
|
@param |
1463 |
|
@return |
1464 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1465 |
15 |
public boolean contains(SequenceI seq, int apos)... |
1466 |
|
{ |
1467 |
15 |
return (startRes <= apos && endRes >= apos) && sequences.contains(seq); |
1468 |
|
} |
1469 |
|
} |