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.util.Comparison; |
24 |
|
import jalview.util.MapList; |
25 |
|
|
26 |
|
import java.util.Iterator; |
27 |
|
import java.util.NoSuchElementException; |
28 |
|
import java.util.Vector; |
29 |
|
|
|
|
| 70.5% |
Uncovered Elements: 70 (237) |
Complexity: 77 |
Complexity Density: 0.64 |
|
30 |
|
public class Mapping |
31 |
|
{ |
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
@author |
37 |
|
|
38 |
|
|
|
|
| 92% |
Uncovered Elements: 7 (88) |
Complexity: 24 |
Complexity Density: 0.44 |
|
39 |
|
public class AlignedCodonIterator implements Iterator<AlignedCodon> |
40 |
|
{ |
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
private final char gap; |
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
private final SequenceI alignedSeq; |
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
private int start; |
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
private int alignedColumn = 0; |
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
private int alignedBases = 0; |
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
private Iterator<int[]> fromRanges; |
70 |
|
|
71 |
|
|
72 |
|
|
73 |
|
|
74 |
|
private Iterator<int[]> toRanges; |
75 |
|
|
76 |
|
|
77 |
|
|
78 |
|
|
79 |
|
private int[] currentFromRange = null; |
80 |
|
|
81 |
|
|
82 |
|
|
83 |
|
|
84 |
|
private int[] currentToRange = null; |
85 |
|
|
86 |
|
|
87 |
|
|
88 |
|
|
89 |
|
private int fromPosition = 0; |
90 |
|
|
91 |
|
|
92 |
|
|
93 |
|
|
94 |
|
private int toPosition = 0; |
95 |
|
|
96 |
|
|
97 |
|
|
98 |
|
|
99 |
|
@param |
100 |
|
|
101 |
|
@param |
102 |
|
|
|
|
| 86.7% |
Uncovered Elements: 2 (15) |
Complexity: 3 |
Complexity Density: 0.27 |
|
103 |
15 |
public AlignedCodonIterator(SequenceI seq, char gapChar)... |
104 |
|
{ |
105 |
15 |
this.alignedSeq = seq; |
106 |
15 |
this.start = seq.getStart(); |
107 |
15 |
this.gap = gapChar; |
108 |
15 |
fromRanges = map.getFromRanges().iterator(); |
109 |
15 |
toRanges = map.getToRanges().iterator(); |
110 |
15 |
if (fromRanges.hasNext()) |
111 |
|
{ |
112 |
15 |
currentFromRange = fromRanges.next(); |
113 |
15 |
fromPosition = currentFromRange[0]; |
114 |
|
} |
115 |
15 |
if (toRanges.hasNext()) |
116 |
|
{ |
117 |
15 |
currentToRange = toRanges.next(); |
118 |
15 |
toPosition = currentToRange[0]; |
119 |
|
} |
120 |
|
} |
121 |
|
|
122 |
|
|
123 |
|
|
124 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 4 |
Complexity Density: 0.8 |
|
125 |
97 |
@Override... |
126 |
|
public boolean hasNext() |
127 |
|
{ |
128 |
97 |
if (fromRanges.hasNext()) |
129 |
|
{ |
130 |
13 |
return true; |
131 |
|
} |
132 |
84 |
if (currentFromRange == null || fromPosition >= currentFromRange[1]) |
133 |
|
{ |
134 |
14 |
return false; |
135 |
|
} |
136 |
70 |
return true; |
137 |
|
} |
138 |
|
|
139 |
|
|
140 |
|
|
141 |
|
|
142 |
|
@throws |
143 |
|
|
144 |
|
@throws |
145 |
|
|
146 |
|
|
|
|
| 77.8% |
Uncovered Elements: 2 (9) |
Complexity: 2 |
Complexity Density: 0.29 |
|
147 |
49 |
@Override... |
148 |
|
public AlignedCodon next() throws IncompleteCodonException |
149 |
|
{ |
150 |
49 |
if (!hasNext()) |
151 |
|
{ |
152 |
0 |
throw new NoSuchElementException(); |
153 |
|
} |
154 |
|
|
155 |
49 |
int[] codon = getNextCodon(); |
156 |
48 |
int[] alignedCodon = getAlignedCodon(codon); |
157 |
|
|
158 |
48 |
String peptide = getPeptide(); |
159 |
48 |
int peptideCol = toPosition - 1 - Mapping.this.to.getStart(); |
160 |
48 |
return new AlignedCodon(alignedCodon[0], alignedCodon[1], |
161 |
|
alignedCodon[2], peptide, peptideCol); |
162 |
|
} |
163 |
|
|
164 |
|
|
165 |
|
|
166 |
|
|
167 |
|
|
168 |
|
@return |
169 |
|
@throws |
170 |
|
|
171 |
|
|
|
|
| 85.7% |
Uncovered Elements: 2 (14) |
Complexity: 3 |
Complexity Density: 0.3 |
|
172 |
49 |
private String getPeptide()... |
173 |
|
{ |
174 |
|
|
175 |
|
|
176 |
49 |
if (toPosition <= currentToRange[1]) |
177 |
|
{ |
178 |
48 |
SequenceI seq = Mapping.this.to; |
179 |
48 |
char pep = seq.getCharAt(toPosition - seq.getStart()); |
180 |
48 |
toPosition++; |
181 |
48 |
return String.valueOf(pep); |
182 |
|
} |
183 |
1 |
if (!toRanges.hasNext()) |
184 |
|
{ |
185 |
0 |
throw new NoSuchElementException( |
186 |
|
"Ran out of peptide at position " + toPosition); |
187 |
|
} |
188 |
1 |
currentToRange = toRanges.next(); |
189 |
1 |
toPosition = currentToRange[0]; |
190 |
1 |
return getPeptide(); |
191 |
|
} |
192 |
|
|
193 |
|
|
194 |
|
|
195 |
|
|
196 |
|
@throws |
197 |
|
|
198 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (16) |
Complexity: 4 |
Complexity Density: 0.4 |
|
199 |
49 |
private int[] getNextCodon()... |
200 |
|
{ |
201 |
49 |
int[] codon = new int[3]; |
202 |
49 |
int codonbase = 0; |
203 |
|
|
204 |
211 |
while (codonbase < 3) |
205 |
|
{ |
206 |
163 |
if (fromPosition <= currentFromRange[1]) |
207 |
|
{ |
208 |
|
|
209 |
|
|
210 |
|
|
211 |
146 |
codon[codonbase++] = fromPosition++; |
212 |
|
} |
213 |
|
else |
214 |
|
{ |
215 |
|
|
216 |
|
|
217 |
|
|
218 |
17 |
if (!fromRanges.hasNext()) |
219 |
|
{ |
220 |
1 |
throw new IncompleteCodonException(); |
221 |
|
} |
222 |
16 |
currentFromRange = fromRanges.next(); |
223 |
16 |
fromPosition = currentFromRange[0]; |
224 |
|
} |
225 |
|
} |
226 |
48 |
return codon; |
227 |
|
} |
228 |
|
|
229 |
|
|
230 |
|
|
231 |
|
|
232 |
|
|
233 |
|
|
234 |
|
@param |
235 |
|
@return |
236 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
237 |
48 |
private int[] getAlignedCodon(int[] codon)... |
238 |
|
{ |
239 |
48 |
int[] aligned = new int[codon.length]; |
240 |
192 |
for (int i = 0; i < codon.length; i++) |
241 |
|
{ |
242 |
144 |
aligned[i] = getAlignedColumn(codon[i]); |
243 |
|
} |
244 |
48 |
return aligned; |
245 |
|
} |
246 |
|
|
247 |
|
|
248 |
|
|
249 |
|
|
250 |
|
|
251 |
|
@param |
252 |
|
@return |
253 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (11) |
Complexity: 5 |
Complexity Density: 0.71 |
|
254 |
144 |
private int getAlignedColumn(int sequencePos)... |
255 |
|
{ |
256 |
|
|
257 |
|
|
258 |
|
|
259 |
144 |
int truePos = sequencePos - (start - 1); |
260 |
144 |
int length = alignedSeq.getLength(); |
261 |
365 |
while (alignedBases < truePos && alignedColumn < length) |
262 |
|
{ |
263 |
221 |
char c = alignedSeq.getCharAt(alignedColumn++); |
264 |
221 |
if (c != gap && !Comparison.isGap(c)) |
265 |
|
{ |
266 |
172 |
alignedBases++; |
267 |
|
} |
268 |
|
} |
269 |
144 |
return alignedColumn - 1; |
270 |
|
} |
271 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
272 |
0 |
@Override... |
273 |
|
public void remove() |
274 |
|
{ |
275 |
|
|
276 |
|
} |
277 |
|
|
278 |
|
} |
279 |
|
|
280 |
|
|
281 |
|
|
282 |
|
|
283 |
|
|
284 |
|
|
285 |
|
MapList map = null; |
286 |
|
|
287 |
|
|
288 |
|
|
289 |
|
|
290 |
|
SequenceI to = null; |
291 |
|
|
292 |
|
|
293 |
|
|
294 |
|
|
295 |
|
private String mappedFromId; |
296 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
297 |
663 |
public Mapping(MapList map)... |
298 |
|
{ |
299 |
663 |
super(); |
300 |
663 |
this.map = map; |
301 |
|
} |
302 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
303 |
450 |
public Mapping(SequenceI to, MapList map)... |
304 |
|
{ |
305 |
450 |
this(map); |
306 |
450 |
this.to = to; |
307 |
|
} |
308 |
|
|
309 |
|
|
310 |
|
|
311 |
|
|
312 |
|
@param |
313 |
|
|
314 |
|
@param |
315 |
|
|
316 |
|
@param |
317 |
|
|
318 |
|
|
319 |
|
@param |
320 |
|
|
321 |
|
@param |
322 |
|
|
323 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
324 |
12 |
public Mapping(SequenceI to, int[] exon, int[] is, int i, int j)... |
325 |
|
{ |
326 |
12 |
this(to, new MapList(exon, is, i, j)); |
327 |
|
} |
328 |
|
|
329 |
|
|
330 |
|
|
331 |
|
|
332 |
|
|
333 |
|
@param |
334 |
|
|
|
|
| 77.8% |
Uncovered Elements: 2 (9) |
Complexity: 4 |
Complexity Density: 0.8 |
|
335 |
8 |
public Mapping(Mapping map2)... |
336 |
|
{ |
337 |
8 |
if (map2 != this && map2 != null) |
338 |
|
{ |
339 |
8 |
if (map2.map != null) |
340 |
|
{ |
341 |
8 |
map = new MapList(map2.map); |
342 |
|
} |
343 |
8 |
to = map2.to; |
344 |
8 |
mappedFromId = map2.mappedFromId; |
345 |
|
} |
346 |
|
} |
347 |
|
|
348 |
|
|
349 |
|
@return |
350 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
351 |
772 |
public MapList getMap()... |
352 |
|
{ |
353 |
772 |
return map; |
354 |
|
} |
355 |
|
|
356 |
|
|
357 |
|
@param |
358 |
|
|
359 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
360 |
2 |
public void setMap(MapList map)... |
361 |
|
{ |
362 |
2 |
this.map = map; |
363 |
|
} |
364 |
|
|
365 |
|
|
366 |
|
|
367 |
|
|
368 |
|
@param |
369 |
|
@return |
370 |
|
@see |
371 |
|
|
|
|
| 72.7% |
Uncovered Elements: 6 (22) |
Complexity: 12 |
Complexity Density: 1 |
|
372 |
39 |
@Override... |
373 |
|
public boolean equals(Object o) |
374 |
|
{ |
375 |
39 |
if (o == null || !(o instanceof Mapping)) |
376 |
|
{ |
377 |
0 |
return false; |
378 |
|
} |
379 |
39 |
Mapping other = (Mapping) o; |
380 |
39 |
if (other == this) |
381 |
|
{ |
382 |
6 |
return true; |
383 |
|
} |
384 |
33 |
if (other.to != to) |
385 |
|
{ |
386 |
27 |
return false; |
387 |
|
} |
388 |
6 |
if ((map != null && other.map == null) |
389 |
|
|| (map == null && other.map != null)) |
390 |
|
{ |
391 |
0 |
return false; |
392 |
|
} |
393 |
6 |
if ((map == null && other.map == null) || map.equals(other.map)) |
394 |
|
{ |
395 |
0 |
return true; |
396 |
|
} |
397 |
6 |
return false; |
398 |
|
} |
399 |
|
|
400 |
|
|
401 |
|
|
402 |
|
|
|
|
| 75% |
Uncovered Elements: 2 (8) |
Complexity: 3 |
Complexity Density: 0.75 |
|
403 |
2 |
@Override... |
404 |
|
public int hashCode() |
405 |
|
{ |
406 |
2 |
int hashCode = (this.to == null ? 1 : this.to.hashCode()); |
407 |
2 |
if (this.map != null) |
408 |
|
{ |
409 |
2 |
hashCode = hashCode * 31 + this.map.hashCode(); |
410 |
|
} |
411 |
|
|
412 |
2 |
return hashCode; |
413 |
|
} |
414 |
|
|
415 |
|
|
416 |
|
|
417 |
|
|
418 |
|
|
419 |
|
@param |
420 |
|
@return |
421 |
|
|
|
|
| 88.9% |
Uncovered Elements: 1 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
422 |
4782 |
public int getPosition(int mpos)... |
423 |
|
{ |
424 |
4782 |
if (map != null) |
425 |
|
{ |
426 |
4782 |
int[] mp = map.shiftTo(mpos); |
427 |
4782 |
if (mp != null) |
428 |
|
{ |
429 |
4768 |
return mp[0]; |
430 |
|
} |
431 |
|
} |
432 |
14 |
return mpos; |
433 |
|
} |
434 |
|
|
435 |
|
|
436 |
|
|
437 |
|
|
438 |
|
@param |
439 |
|
|
440 |
|
@return |
441 |
|
|
442 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
443 |
0 |
public int[] getWord(int mpos)... |
444 |
|
{ |
445 |
0 |
if (map != null) |
446 |
|
{ |
447 |
0 |
return map.getToWord(mpos); |
448 |
|
} |
449 |
0 |
return null; |
450 |
|
} |
451 |
|
|
452 |
|
|
453 |
|
|
454 |
|
|
455 |
|
|
|
|
| 60% |
Uncovered Elements: 2 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
456 |
57 |
public int getWidth()... |
457 |
|
{ |
458 |
57 |
if (map != null) |
459 |
|
{ |
460 |
57 |
return map.getFromRatio(); |
461 |
|
} |
462 |
0 |
return 1; |
463 |
|
} |
464 |
|
|
465 |
|
|
466 |
|
|
467 |
|
|
468 |
|
@return |
469 |
|
|
|
|
| 60% |
Uncovered Elements: 2 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
470 |
57 |
public int getMappedWidth()... |
471 |
|
{ |
472 |
57 |
if (map != null) |
473 |
|
{ |
474 |
57 |
return map.getToRatio(); |
475 |
|
} |
476 |
0 |
return 1; |
477 |
|
} |
478 |
|
|
479 |
|
|
480 |
|
|
481 |
|
|
482 |
|
|
483 |
|
@param |
484 |
|
@return |
485 |
|
|
|
|
| 88.9% |
Uncovered Elements: 1 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
486 |
9 |
public int getMappedPosition(int pos)... |
487 |
|
{ |
488 |
9 |
if (map != null) |
489 |
|
{ |
490 |
9 |
int[] mp = map.shiftFrom(pos); |
491 |
9 |
if (mp != null) |
492 |
|
{ |
493 |
4 |
return mp[0]; |
494 |
|
} |
495 |
|
} |
496 |
5 |
return pos; |
497 |
|
} |
498 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
499 |
0 |
public int[] getMappedWord(int pos)... |
500 |
|
{ |
501 |
0 |
if (map != null) |
502 |
|
{ |
503 |
0 |
int[] mp = map.shiftFrom(pos); |
504 |
0 |
if (mp != null) |
505 |
|
{ |
506 |
0 |
return new int[] { mp[0], mp[0] + mp[2] * (map.getToRatio() - 1) }; |
507 |
|
} |
508 |
|
} |
509 |
0 |
return null; |
510 |
|
} |
511 |
|
|
512 |
|
|
513 |
|
|
514 |
|
|
515 |
|
|
516 |
|
@param |
517 |
|
@return |
518 |
|
|
|
|
| 70% |
Uncovered Elements: 6 (20) |
Complexity: 5 |
Complexity Density: 0.42 |
|
519 |
1572 |
public SequenceFeature[] locateFeature(SequenceFeature f)... |
520 |
|
{ |
521 |
1572 |
if (true) |
522 |
|
{ |
523 |
1572 |
if (map != null) |
524 |
|
{ |
525 |
1572 |
int[] frange = map.locateInFrom(f.getBegin(), f.getEnd()); |
526 |
1572 |
if (frange == null) |
527 |
|
{ |
528 |
|
|
529 |
0 |
return null; |
530 |
|
} |
531 |
1572 |
SequenceFeature[] vf = new SequenceFeature[frange.length / 2]; |
532 |
3144 |
for (int i = 0, v = 0; i < frange.length; i += 2, v++) |
533 |
|
{ |
534 |
1572 |
vf[v] = new SequenceFeature(f, frange[i], frange[i + 1], |
535 |
|
f.getFeatureGroup(), f.getScore()); |
536 |
1572 |
if (frange.length > 2) |
537 |
|
{ |
538 |
0 |
vf[v].setDescription(f.getDescription() + "\nPart " + (v + 1)); |
539 |
|
} |
540 |
|
} |
541 |
1572 |
return vf; |
542 |
|
} |
543 |
|
} |
544 |
|
|
545 |
|
|
546 |
0 |
return new SequenceFeature[] { f }; |
547 |
|
} |
548 |
|
|
549 |
|
|
550 |
|
|
551 |
|
|
552 |
|
|
553 |
|
@param |
554 |
|
@param |
555 |
|
@return |
556 |
|
|
557 |
|
|
|
|
| 46.4% |
Uncovered Elements: 15 (28) |
Complexity: 9 |
Complexity Density: 0.75 |
|
558 |
3 |
public int[] locateRange(int from, int to)... |
559 |
|
{ |
560 |
3 |
if (map != null) |
561 |
|
{ |
562 |
3 |
if (from <= to) |
563 |
|
{ |
564 |
3 |
from = (map.getToLowest() < from) ? from : map.getToLowest(); |
565 |
3 |
to = (map.getToHighest() > to) ? to : map.getToHighest(); |
566 |
3 |
if (from > to) |
567 |
|
{ |
568 |
0 |
return null; |
569 |
|
} |
570 |
|
} |
571 |
|
else |
572 |
|
{ |
573 |
0 |
from = (map.getToHighest() > from) ? from : map.getToHighest(); |
574 |
0 |
to = (map.getToLowest() < to) ? to : map.getToLowest(); |
575 |
0 |
if (from < to) |
576 |
|
{ |
577 |
0 |
return null; |
578 |
|
} |
579 |
|
} |
580 |
3 |
return map.locateInFrom(from, to); |
581 |
|
} |
582 |
0 |
return new int[] { from, to }; |
583 |
|
} |
584 |
|
|
585 |
|
|
586 |
|
|
587 |
|
|
588 |
|
|
589 |
|
@param |
590 |
|
@param |
591 |
|
@return |
592 |
|
|
|
|
| 46.4% |
Uncovered Elements: 15 (28) |
Complexity: 9 |
Complexity Density: 0.75 |
|
593 |
12 |
public int[] locateMappedRange(int from, int to)... |
594 |
|
{ |
595 |
12 |
if (map != null) |
596 |
|
{ |
597 |
|
|
598 |
12 |
if (from <= to) |
599 |
|
{ |
600 |
12 |
from = (map.getFromLowest() < from) ? from : map.getFromLowest(); |
601 |
12 |
to = (map.getFromHighest() > to) ? to : map.getFromHighest(); |
602 |
12 |
if (from > to) |
603 |
|
{ |
604 |
0 |
return null; |
605 |
|
} |
606 |
|
} |
607 |
|
else |
608 |
|
{ |
609 |
0 |
from = (map.getFromHighest() > from) ? from : map.getFromHighest(); |
610 |
0 |
to = (map.getFromLowest() < to) ? to : map.getFromLowest(); |
611 |
0 |
if (from < to) |
612 |
|
{ |
613 |
0 |
return null; |
614 |
|
} |
615 |
|
} |
616 |
12 |
return map.locateInTo(from, to); |
617 |
|
} |
618 |
0 |
return new int[] { from, to }; |
619 |
|
} |
620 |
|
|
621 |
|
|
622 |
|
|
623 |
|
|
624 |
|
|
625 |
|
@param |
626 |
|
@return |
627 |
|
|
|
|
| 95.1% |
Uncovered Elements: 2 (41) |
Complexity: 8 |
Complexity Density: 0.3 |
|
628 |
2 |
public Mapping intersectVisContigs(int[] viscontigs)... |
629 |
|
{ |
630 |
2 |
Mapping copy = new Mapping(this); |
631 |
2 |
if (map != null) |
632 |
|
{ |
633 |
2 |
int vpos = 0; |
634 |
2 |
int apos = 0; |
635 |
2 |
Vector toRange = new Vector(); |
636 |
2 |
Vector fromRange = new Vector(); |
637 |
5 |
for (int vc = 0; vc < viscontigs.length; vc += 2) |
638 |
|
{ |
639 |
|
|
640 |
3 |
int[] mpr = locateMappedRange(1 + viscontigs[vc], |
641 |
|
viscontigs[vc + 1] - 1); |
642 |
3 |
if (mpr != null) |
643 |
|
{ |
644 |
6 |
for (int m = 0; m < mpr.length; m += 2) |
645 |
|
{ |
646 |
3 |
toRange.addElement(new int[] { mpr[m], mpr[m + 1] }); |
647 |
3 |
int[] xpos = locateRange(mpr[m], mpr[m + 1]); |
648 |
9 |
for (int x = 0; x < xpos.length; x += 2) |
649 |
|
{ |
650 |
6 |
fromRange.addElement(new int[] { xpos[x], xpos[x + 1] }); |
651 |
|
} |
652 |
|
} |
653 |
|
} |
654 |
|
} |
655 |
2 |
int[] from = new int[fromRange.size() * 2]; |
656 |
2 |
int[] to = new int[toRange.size() * 2]; |
657 |
2 |
int[] r; |
658 |
8 |
for (int f = 0, fSize = fromRange.size(); f < fSize; f++) |
659 |
|
{ |
660 |
6 |
r = (int[]) fromRange.elementAt(f); |
661 |
6 |
from[f * 2] = r[0]; |
662 |
6 |
from[f * 2 + 1] = r[1]; |
663 |
|
} |
664 |
5 |
for (int f = 0, fSize = toRange.size(); f < fSize; f++) |
665 |
|
{ |
666 |
3 |
r = (int[]) toRange.elementAt(f); |
667 |
3 |
to[f * 2] = r[0]; |
668 |
3 |
to[f * 2 + 1] = r[1]; |
669 |
|
} |
670 |
2 |
copy.setMap( |
671 |
|
new MapList(from, to, map.getFromRatio(), map.getToRatio())); |
672 |
|
} |
673 |
2 |
return copy; |
674 |
|
} |
675 |
|
|
676 |
|
|
677 |
|
|
678 |
|
|
679 |
|
@return |
680 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
681 |
597 |
public SequenceI getTo()... |
682 |
|
{ |
683 |
597 |
return to; |
684 |
|
} |
685 |
|
|
686 |
|
|
687 |
|
|
688 |
|
|
689 |
|
@param |
690 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
691 |
182 |
public void setTo(SequenceI tto)... |
692 |
|
{ |
693 |
182 |
to = tto; |
694 |
|
} |
695 |
|
|
696 |
|
|
697 |
|
|
698 |
|
|
699 |
|
|
700 |
|
@param |
701 |
|
|
702 |
|
@param |
703 |
|
@return |
704 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
705 |
15 |
public Iterator<AlignedCodon> getCodonIterator(SequenceI seq,... |
706 |
|
char gapChar) |
707 |
|
{ |
708 |
15 |
return new AlignedCodonIterator(seq, gapChar); |
709 |
|
} |
710 |
|
|
711 |
|
|
712 |
|
|
713 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 2 |
Complexity Density: 2 |
|
714 |
2 |
@Override... |
715 |
|
public String toString() |
716 |
|
{ |
717 |
2 |
return String.format("%s %s", this.map.toString(), |
718 |
2 |
this.to == null ? "" : this.to.getName()); |
719 |
|
} |
720 |
|
|
721 |
|
|
722 |
|
|
723 |
|
|
724 |
|
@return |
725 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
726 |
12 |
public String getMappedFromId()... |
727 |
|
{ |
728 |
12 |
return mappedFromId; |
729 |
|
} |
730 |
|
|
731 |
|
|
732 |
|
|
733 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
734 |
382 |
public void setMappedFromId(String mappedFromId)... |
735 |
|
{ |
736 |
382 |
this.mappedFromId = mappedFromId; |
737 |
|
} |
738 |
|
|
739 |
|
} |