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 static org.testng.AssertJUnit.assertEquals; |
24 |
|
import static org.testng.AssertJUnit.assertFalse; |
25 |
|
import static org.testng.AssertJUnit.assertNotNull; |
26 |
|
import static org.testng.AssertJUnit.assertNotSame; |
27 |
|
import static org.testng.AssertJUnit.assertNull; |
28 |
|
import static org.testng.AssertJUnit.assertSame; |
29 |
|
import static org.testng.AssertJUnit.assertTrue; |
30 |
|
|
31 |
|
import jalview.analysis.AlignmentGenerator; |
32 |
|
import jalview.commands.EditCommand; |
33 |
|
import jalview.commands.EditCommand.Action; |
34 |
|
import jalview.datamodel.PDBEntry.Type; |
35 |
|
import jalview.gui.JvOptionPane; |
36 |
|
import jalview.util.MapList; |
37 |
|
|
38 |
|
import java.io.File; |
39 |
|
import java.util.ArrayList; |
40 |
|
import java.util.Arrays; |
41 |
|
import java.util.BitSet; |
42 |
|
import java.util.Iterator; |
43 |
|
import java.util.List; |
44 |
|
import java.util.Vector; |
45 |
|
|
46 |
|
import org.testng.Assert; |
47 |
|
import org.testng.annotations.BeforeClass; |
48 |
|
import org.testng.annotations.BeforeMethod; |
49 |
|
import org.testng.annotations.Test; |
50 |
|
|
51 |
|
import junit.extensions.PA; |
52 |
|
|
|
|
| 96.7% |
Uncovered Elements: 37 (1,126) |
Complexity: 52 |
Complexity Density: 0.05 |
|
53 |
|
public class SequenceTest |
54 |
|
{ |
55 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
56 |
1 |
@BeforeClass(alwaysRun = true)... |
57 |
|
public void setUpJvOptionPane() |
58 |
|
{ |
59 |
1 |
JvOptionPane.setInteractiveMode(false); |
60 |
1 |
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); |
61 |
|
} |
62 |
|
|
63 |
|
Sequence seq; |
64 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
65 |
43 |
@BeforeMethod(alwaysRun = true)... |
66 |
|
public void setUp() |
67 |
|
{ |
68 |
43 |
seq = new Sequence("FER1", "AKPNGVL"); |
69 |
|
} |
70 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (16) |
Complexity: 1 |
Complexity Density: 0.06 |
1PASS
|
|
71 |
1 |
@Test(groups = { "Functional" })... |
72 |
|
public void testInsertGapsAndGapmaps() |
73 |
|
{ |
74 |
1 |
SequenceI aseq = seq.deriveSequence(); |
75 |
1 |
aseq.insertCharAt(2, 3, '-'); |
76 |
1 |
aseq.insertCharAt(6, 3, '-'); |
77 |
1 |
assertEquals("Gap insertions not correct", "AK---P---NGVL", |
78 |
|
aseq.getSequenceAsString()); |
79 |
1 |
List<int[]> gapInt = aseq.getInsertions(); |
80 |
1 |
assertEquals("Gap interval 1 start wrong", 2, gapInt.get(0)[0]); |
81 |
1 |
assertEquals("Gap interval 1 end wrong", 4, gapInt.get(0)[1]); |
82 |
1 |
assertEquals("Gap interval 2 start wrong", 6, gapInt.get(1)[0]); |
83 |
1 |
assertEquals("Gap interval 2 end wrong", 8, gapInt.get(1)[1]); |
84 |
|
|
85 |
1 |
BitSet gapfield = aseq.getInsertionsAsBits(); |
86 |
1 |
BitSet expectedgaps = new BitSet(); |
87 |
1 |
expectedgaps.set(2, 5); |
88 |
1 |
expectedgaps.set(6, 9); |
89 |
|
|
90 |
1 |
assertEquals(6, expectedgaps.cardinality()); |
91 |
|
|
92 |
1 |
assertEquals("getInsertionsAsBits didn't mark expected number of gaps", |
93 |
|
6, gapfield.cardinality()); |
94 |
|
|
95 |
1 |
assertEquals("getInsertionsAsBits not correct.", expectedgaps, gapfield); |
96 |
|
} |
97 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
1PASS
|
|
98 |
1 |
@Test(groups = ("Functional"))... |
99 |
|
public void testIsProtein() |
100 |
|
{ |
101 |
|
|
102 |
1 |
assertTrue(new Sequence("prot", "ASDFASDFASDF").isProtein()); |
103 |
|
|
104 |
1 |
assertFalse(new Sequence("prot", "ACGTACGTACGT").isProtein()); |
105 |
|
|
106 |
1 |
SequenceI sq = new Sequence("prot", "ACGUACGUACGU"); |
107 |
1 |
assertFalse(sq.isProtein()); |
108 |
|
|
109 |
1 |
sq.setSequence("ASDFASDFADSF"); |
110 |
1 |
assertTrue(sq.isProtein()); |
111 |
|
} |
112 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
1PASS
|
|
113 |
1 |
@Test(groups = { "Functional" })... |
114 |
|
public void testGetAnnotation() |
115 |
|
{ |
116 |
|
|
117 |
1 |
assertNull(seq.getAnnotation()); |
118 |
1 |
AlignmentAnnotation ann = addAnnotation("label1", "desc1", "calcId1", |
119 |
|
1f); |
120 |
1 |
AlignmentAnnotation[] anns = seq.getAnnotation(); |
121 |
1 |
assertEquals(1, anns.length); |
122 |
1 |
assertSame(ann, anns[0]); |
123 |
|
|
124 |
|
|
125 |
1 |
seq.removeAlignmentAnnotation(ann); |
126 |
1 |
assertNull(seq.getAnnotation()); |
127 |
|
} |
128 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
1PASS
|
|
129 |
1 |
@Test(groups = { "Functional" })... |
130 |
|
public void testGetAnnotation_forLabel() |
131 |
|
{ |
132 |
1 |
AlignmentAnnotation ann1 = addAnnotation("label1", "desc1", "calcId1", |
133 |
|
1f); |
134 |
1 |
addAnnotation("label2", "desc2", "calcId2", 1f); |
135 |
1 |
AlignmentAnnotation ann3 = addAnnotation("label1", "desc3", "calcId3", |
136 |
|
1f); |
137 |
1 |
AlignmentAnnotation[] anns = seq.getAnnotation("label1"); |
138 |
1 |
assertEquals(2, anns.length); |
139 |
1 |
assertSame(ann1, anns[0]); |
140 |
1 |
assertSame(ann3, anns[1]); |
141 |
|
} |
142 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
143 |
10 |
private AlignmentAnnotation addAnnotation(String label,... |
144 |
|
String description, String calcId, float value) |
145 |
|
{ |
146 |
10 |
final AlignmentAnnotation annotation = new AlignmentAnnotation(label, |
147 |
|
description, value); |
148 |
10 |
annotation.setCalcId(calcId); |
149 |
10 |
seq.addAlignmentAnnotation(annotation); |
150 |
10 |
return annotation; |
151 |
|
} |
152 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (15) |
Complexity: 1 |
Complexity Density: 0.07 |
1PASS
|
|
153 |
1 |
@Test(groups = { "Functional" })... |
154 |
|
public void testGetAlignmentAnnotations_forCalcIdAndLabel() |
155 |
|
{ |
156 |
1 |
addAnnotation("label1", "desc1", "calcId1", 1f); |
157 |
1 |
AlignmentAnnotation ann2 = addAnnotation("label2", "desc2", "calcId2", |
158 |
|
1f); |
159 |
1 |
addAnnotation("label2", "desc3", "calcId3", 1f); |
160 |
1 |
AlignmentAnnotation ann4 = addAnnotation("label2", "desc3", "calcId2", |
161 |
|
1f); |
162 |
1 |
addAnnotation("label5", "desc3", null, 1f); |
163 |
1 |
addAnnotation(null, "desc3", "calcId3", 1f); |
164 |
|
|
165 |
1 |
List<AlignmentAnnotation> anns = seq.getAlignmentAnnotations("calcId2", |
166 |
|
"label2"); |
167 |
1 |
assertEquals(2, anns.size()); |
168 |
1 |
assertSame(ann2, anns.get(0)); |
169 |
1 |
assertSame(ann4, anns.get(1)); |
170 |
|
|
171 |
1 |
assertTrue(seq.getAlignmentAnnotations("calcId2", "label3").isEmpty()); |
172 |
1 |
assertTrue(seq.getAlignmentAnnotations("calcId3", "label5").isEmpty()); |
173 |
1 |
assertTrue(seq.getAlignmentAnnotations("calcId2", null).isEmpty()); |
174 |
1 |
assertTrue(seq.getAlignmentAnnotations(null, "label3").isEmpty()); |
175 |
1 |
assertTrue(seq.getAlignmentAnnotations(null, null).isEmpty()); |
176 |
|
} |
177 |
|
|
178 |
|
|
179 |
|
|
180 |
|
|
181 |
|
|
182 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (18) |
Complexity: 1 |
Complexity Density: 0.06 |
1PASS
|
|
183 |
1 |
@Test(groups = { "Functional" })... |
184 |
|
public void testAddAlignmentAnnotation() |
185 |
|
{ |
186 |
1 |
assertNull(seq.getAnnotation()); |
187 |
1 |
final AlignmentAnnotation annotation = new AlignmentAnnotation("a", |
188 |
|
"b", 2d); |
189 |
1 |
assertNull(annotation.sequenceRef); |
190 |
1 |
seq.addAlignmentAnnotation(annotation); |
191 |
1 |
assertSame(seq, annotation.sequenceRef); |
192 |
1 |
AlignmentAnnotation[] anns = seq.getAnnotation(); |
193 |
1 |
assertEquals(1, anns.length); |
194 |
1 |
assertSame(annotation, anns[0]); |
195 |
|
|
196 |
|
|
197 |
1 |
seq.addAlignmentAnnotation(annotation); |
198 |
1 |
anns = seq.getAnnotation(); |
199 |
1 |
assertEquals(1, anns.length); |
200 |
1 |
assertSame(annotation, anns[0]); |
201 |
|
|
202 |
|
|
203 |
1 |
final AlignmentAnnotation annotation2 = new AlignmentAnnotation("a", |
204 |
|
"b", 2d); |
205 |
1 |
seq.addAlignmentAnnotation(annotation2); |
206 |
1 |
anns = seq.getAnnotation(); |
207 |
1 |
assertEquals(2, anns.length); |
208 |
1 |
assertSame(annotation, anns[0]); |
209 |
1 |
assertSame(annotation2, anns[1]); |
210 |
|
} |
211 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 1 |
Complexity Density: 0.11 |
1PASS
|
|
212 |
1 |
@Test(groups = { "Functional" })... |
213 |
|
public void testGetStartGetEnd() |
214 |
|
{ |
215 |
1 |
SequenceI sq = new Sequence("test", "ABCDEF"); |
216 |
1 |
assertEquals(1, sq.getStart()); |
217 |
1 |
assertEquals(6, sq.getEnd()); |
218 |
|
|
219 |
1 |
sq = new Sequence("test", "--AB-C-DEF--"); |
220 |
1 |
assertEquals(1, sq.getStart()); |
221 |
1 |
assertEquals(6, sq.getEnd()); |
222 |
|
|
223 |
1 |
sq = new Sequence("test", "----"); |
224 |
1 |
assertEquals(1, sq.getStart()); |
225 |
1 |
assertEquals(0, sq.getEnd()); |
226 |
|
} |
227 |
|
|
228 |
|
|
229 |
|
|
230 |
|
|
231 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (37) |
Complexity: 1 |
Complexity Density: 0.03 |
1PASS
|
|
232 |
1 |
@Test(groups = { "Functional" })... |
233 |
|
public void testFindIndex() |
234 |
|
{ |
235 |
|
|
236 |
|
|
237 |
|
|
238 |
|
|
239 |
1 |
SequenceI sq = new Sequence("test", "ABCDEF"); |
240 |
1 |
assertEquals(0, sq.findIndex(0)); |
241 |
1 |
sq.sequenceChanged(); |
242 |
1 |
assertEquals(1, sq.findIndex(1)); |
243 |
1 |
sq.sequenceChanged(); |
244 |
1 |
assertEquals(5, sq.findIndex(5)); |
245 |
1 |
sq.sequenceChanged(); |
246 |
1 |
assertEquals(6, sq.findIndex(6)); |
247 |
1 |
sq.sequenceChanged(); |
248 |
1 |
assertEquals(6, sq.findIndex(9)); |
249 |
|
|
250 |
1 |
final String aligned = "-A--B-C-D-E-F--"; |
251 |
1 |
assertEquals(15, aligned.length()); |
252 |
1 |
sq = new Sequence("test/8-13", aligned); |
253 |
1 |
assertEquals(2, sq.findIndex(8)); |
254 |
1 |
sq.sequenceChanged(); |
255 |
1 |
assertEquals(5, sq.findIndex(9)); |
256 |
1 |
sq.sequenceChanged(); |
257 |
1 |
assertEquals(7, sq.findIndex(10)); |
258 |
|
|
259 |
|
|
260 |
1 |
sq.sequenceChanged(); |
261 |
1 |
assertEquals(0, sq.findIndex(0)); |
262 |
1 |
sq.sequenceChanged(); |
263 |
1 |
assertEquals(0, sq.findIndex(-1)); |
264 |
|
|
265 |
|
|
266 |
1 |
sq.sequenceChanged(); |
267 |
1 |
assertEquals(13, sq.findIndex(99)); |
268 |
|
|
269 |
|
|
270 |
|
|
271 |
|
|
272 |
|
|
273 |
1 |
sq = new Sequence("test/8-15", "A-B-C-"); |
274 |
1 |
assertEquals(6, sq.getLength()); |
275 |
1 |
sq.sequenceChanged(); |
276 |
1 |
assertEquals(sq.getLength(), sq.findIndex(14)); |
277 |
1 |
sq = new Sequence("test/8-99", "-A--B-C-D"); |
278 |
1 |
sq.sequenceChanged(); |
279 |
1 |
assertEquals(sq.getLength(), sq.findIndex(65)); |
280 |
|
|
281 |
|
|
282 |
|
|
283 |
|
|
284 |
|
|
285 |
1 |
sq = new Sequence("test/8-15", "-A-B-C-"); |
286 |
1 |
sq.sequenceChanged(); |
287 |
1 |
assertEquals(0, sq.findIndex(3)); |
288 |
1 |
sq = new Sequence("test/8-15", "A-B-C-"); |
289 |
1 |
sq.sequenceChanged(); |
290 |
1 |
assertEquals(0, sq.findIndex(2)); |
291 |
|
} |
292 |
|
|
293 |
|
|
294 |
|
|
295 |
|
|
296 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (97) |
Complexity: 1 |
Complexity Density: 0.01 |
1PASS
|
|
297 |
1 |
@Test(groups = { "Functional" })... |
298 |
|
public void testFindPosition() |
299 |
|
{ |
300 |
|
|
301 |
|
|
302 |
|
|
303 |
|
|
304 |
1 |
SequenceI sq = new Sequence("test/8-13", "ABCDEF"); |
305 |
1 |
assertEquals(8, sq.findPosition(0)); |
306 |
|
|
307 |
1 |
assertEquals("test:Pos8:Col1:startCol1:endCol0:tok0", |
308 |
|
PA.getValue(sq, "cursor").toString()); |
309 |
1 |
SequenceCursor cursor = (SequenceCursor) PA.getValue(sq, "cursor"); |
310 |
1 |
int token = (int) PA.getValue(sq, "changeCount"); |
311 |
1 |
assertEquals(new SequenceCursor(sq, 8, 1, token), cursor); |
312 |
|
|
313 |
1 |
sq.sequenceChanged(); |
314 |
|
|
315 |
|
|
316 |
|
|
317 |
|
|
318 |
|
|
319 |
1 |
assertEquals(13, sq.findPosition(5)); |
320 |
1 |
cursor = (SequenceCursor) PA.getValue(sq, "cursor"); |
321 |
1 |
assertEquals(++token, (int) PA.getValue(sq, "changeCount")); |
322 |
1 |
assertEquals(new SequenceCursor(sq, 13, 6, token), cursor); |
323 |
1 |
assertEquals("test:Pos13:Col6:startCol1:endCol6:tok1", |
324 |
|
PA.getValue(sq, "cursor").toString()); |
325 |
|
|
326 |
|
|
327 |
|
|
328 |
1 |
sq = new Sequence("test/8-11", "AB-C-D--"); |
329 |
1 |
token = (int) PA.getValue(sq, "changeCount"); |
330 |
1 |
assertEquals(8, sq.findPosition(0)); |
331 |
1 |
cursor = (SequenceCursor) PA.getValue(sq, "cursor"); |
332 |
1 |
assertEquals(new SequenceCursor(sq, 8, 1, token), cursor); |
333 |
1 |
assertEquals("test:Pos8:Col1:startCol1:endCol0:tok0", |
334 |
|
PA.getValue(sq, "cursor").toString()); |
335 |
|
|
336 |
1 |
sq.sequenceChanged(); |
337 |
1 |
assertEquals(9, sq.findPosition(1)); |
338 |
1 |
cursor = (SequenceCursor) PA.getValue(sq, "cursor"); |
339 |
1 |
assertEquals(new SequenceCursor(sq, 9, 2, ++token), cursor); |
340 |
1 |
assertEquals("test:Pos9:Col2:startCol1:endCol0:tok1", |
341 |
|
PA.getValue(sq, "cursor").toString()); |
342 |
|
|
343 |
1 |
sq.sequenceChanged(); |
344 |
|
|
345 |
|
|
346 |
1 |
assertEquals(10, sq.findPosition(2)); |
347 |
1 |
cursor = (SequenceCursor) PA.getValue(sq, "cursor"); |
348 |
1 |
assertEquals(new SequenceCursor(sq, 9, 2, ++token), cursor); |
349 |
1 |
assertEquals("test:Pos9:Col2:startCol1:endCol0:tok2", |
350 |
|
PA.getValue(sq, "cursor").toString()); |
351 |
|
|
352 |
1 |
sq.sequenceChanged(); |
353 |
1 |
assertEquals(10, sq.findPosition(3)); |
354 |
1 |
cursor = (SequenceCursor) PA.getValue(sq, "cursor"); |
355 |
1 |
assertEquals(new SequenceCursor(sq, 10, 4, ++token), cursor); |
356 |
1 |
assertEquals("test:Pos10:Col4:startCol1:endCol0:tok3", |
357 |
|
PA.getValue(sq, "cursor").toString()); |
358 |
|
|
359 |
1 |
sq.sequenceChanged(); |
360 |
|
|
361 |
|
|
362 |
1 |
assertEquals(11, sq.findPosition(4)); |
363 |
1 |
cursor = (SequenceCursor) PA.getValue(sq, "cursor"); |
364 |
1 |
assertEquals(new SequenceCursor(sq, 10, 4, ++token), cursor); |
365 |
1 |
assertEquals("test:Pos10:Col4:startCol1:endCol0:tok4", |
366 |
|
PA.getValue(sq, "cursor").toString()); |
367 |
|
|
368 |
1 |
sq.sequenceChanged(); |
369 |
1 |
assertEquals(11, sq.findPosition(5)); |
370 |
1 |
cursor = (SequenceCursor) PA.getValue(sq, "cursor"); |
371 |
1 |
assertEquals(new SequenceCursor(sq, 11, 6, ++token), cursor); |
372 |
|
|
373 |
1 |
assertEquals("test:Pos11:Col6:startCol1:endCol6:tok5", |
374 |
|
PA.getValue(sq, "cursor").toString()); |
375 |
|
|
376 |
1 |
sq.sequenceChanged(); |
377 |
|
|
378 |
1 |
assertEquals(12, sq.findPosition(6)); |
379 |
|
|
380 |
1 |
sq.sequenceChanged(); |
381 |
1 |
assertEquals(12, sq.findPosition(7)); |
382 |
|
|
383 |
|
|
384 |
|
|
385 |
|
|
386 |
1 |
sq = new Sequence("test/8-13", "--AB-C-DEF--"); |
387 |
1 |
assertEquals(8, sq.findPosition(0)); |
388 |
1 |
assertNull(PA.getValue(sq, "cursor")); |
389 |
|
|
390 |
1 |
sq.sequenceChanged(); |
391 |
1 |
assertEquals(8, sq.findPosition(1)); |
392 |
1 |
assertNull(PA.getValue(sq, "cursor")); |
393 |
|
|
394 |
1 |
sq.sequenceChanged(); |
395 |
1 |
assertEquals(8, sq.findPosition(2)); |
396 |
1 |
assertEquals("test:Pos8:Col3:startCol3:endCol0:tok2", |
397 |
|
PA.getValue(sq, "cursor").toString()); |
398 |
|
|
399 |
1 |
sq.sequenceChanged(); |
400 |
1 |
assertEquals(9, sq.findPosition(3)); |
401 |
1 |
assertEquals("test:Pos9:Col4:startCol3:endCol0:tok3", |
402 |
|
PA.getValue(sq, "cursor").toString()); |
403 |
|
|
404 |
1 |
sq.sequenceChanged(); |
405 |
|
|
406 |
|
|
407 |
1 |
assertEquals(10, sq.findPosition(4)); |
408 |
1 |
assertEquals("test:Pos9:Col4:startCol3:endCol0:tok4", |
409 |
|
PA.getValue(sq, "cursor").toString()); |
410 |
|
|
411 |
1 |
sq.sequenceChanged(); |
412 |
1 |
assertEquals(10, sq.findPosition(5)); |
413 |
1 |
assertEquals("test:Pos10:Col6:startCol3:endCol0:tok5", |
414 |
|
PA.getValue(sq, "cursor").toString()); |
415 |
|
|
416 |
1 |
sq.sequenceChanged(); |
417 |
|
|
418 |
|
|
419 |
1 |
assertEquals(11, sq.findPosition(6)); |
420 |
1 |
assertEquals("test:Pos10:Col6:startCol3:endCol0:tok6", |
421 |
|
PA.getValue(sq, "cursor").toString()); |
422 |
|
|
423 |
1 |
sq.sequenceChanged(); |
424 |
1 |
assertEquals(11, sq.findPosition(7)); |
425 |
1 |
assertEquals("test:Pos11:Col8:startCol3:endCol0:tok7", |
426 |
|
PA.getValue(sq, "cursor").toString()); |
427 |
|
|
428 |
1 |
sq.sequenceChanged(); |
429 |
1 |
assertEquals(12, sq.findPosition(8)); |
430 |
1 |
assertEquals("test:Pos12:Col9:startCol3:endCol0:tok8", |
431 |
|
PA.getValue(sq, "cursor").toString()); |
432 |
|
|
433 |
|
|
434 |
|
|
435 |
|
|
436 |
1 |
sq.sequenceChanged(); |
437 |
1 |
assertEquals(13, sq.findPosition(9)); |
438 |
1 |
assertEquals("test:Pos13:Col10:startCol3:endCol10:tok9", |
439 |
|
PA.getValue(sq, "cursor").toString()); |
440 |
|
|
441 |
1 |
sq.sequenceChanged(); |
442 |
1 |
assertEquals(14, sq.findPosition(10)); |
443 |
1 |
assertEquals("test:Pos13:Col10:startCol3:endCol10:tok10", |
444 |
|
PA.getValue(sq, "cursor").toString()); |
445 |
|
|
446 |
|
|
447 |
|
|
448 |
|
|
449 |
|
|
450 |
1 |
sq.sequenceChanged(); |
451 |
1 |
assertEquals(14, sq.findPosition(11)); |
452 |
1 |
assertEquals("test:Pos13:Col10:startCol3:endCol10:tok11", |
453 |
|
PA.getValue(sq, "cursor").toString()); |
454 |
|
|
455 |
1 |
sq.sequenceChanged(); |
456 |
1 |
assertEquals(14, sq.findPosition(99)); |
457 |
1 |
assertEquals("test:Pos13:Col10:startCol3:endCol10:tok12", |
458 |
|
PA.getValue(sq, "cursor").toString()); |
459 |
|
|
460 |
|
|
461 |
|
|
462 |
|
|
463 |
1 |
sq = new Sequence("test/8-13", "--AB-C-DEF"); |
464 |
1 |
assertEquals(13, sq.findPosition(9)); |
465 |
1 |
assertEquals("test:Pos13:Col10:startCol3:endCol10:tok0", |
466 |
|
PA.getValue(sq, "cursor").toString()); |
467 |
1 |
sq.sequenceChanged(); |
468 |
1 |
assertEquals(12, sq.findPosition(8)); |
469 |
1 |
cursor = (SequenceCursor) PA.getValue(sq, "cursor"); |
470 |
|
|
471 |
1 |
cursor = (SequenceCursor) PA.getValue(sq, "cursor"); |
472 |
1 |
assertEquals("test:Pos12:Col9:startCol3:endCol0:tok1", |
473 |
|
cursor.toString()); |
474 |
|
|
475 |
1 |
assertEquals(13, ((Sequence) sq).findPosition(10, cursor)); |
476 |
1 |
assertEquals(13, sq.findPosition(9)); |
477 |
|
|
478 |
1 |
assertEquals("test:Pos13:Col10:startCol3:endCol10:tok1", |
479 |
|
PA.getValue(sq, "cursor").toString()); |
480 |
|
} |
481 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (21) |
Complexity: 1 |
Complexity Density: 0.05 |
1PASS
|
|
482 |
1 |
@Test(groups = { "Functional" })... |
483 |
|
public void testDeleteChars() |
484 |
|
{ |
485 |
|
|
486 |
|
|
487 |
|
|
488 |
1 |
SequenceI sq = new Sequence("test", "ABCDEF"); |
489 |
1 |
assertNull(PA.getValue(sq, "datasetSequence")); |
490 |
1 |
assertEquals(1, sq.getStart()); |
491 |
1 |
assertEquals(6, sq.getEnd()); |
492 |
1 |
sq.deleteChars(2, 3); |
493 |
1 |
assertEquals("ABDEF", sq.getSequenceAsString()); |
494 |
1 |
assertEquals(1, sq.getStart()); |
495 |
1 |
assertEquals(5, sq.getEnd()); |
496 |
1 |
assertNull(PA.getValue(sq, "datasetSequence")); |
497 |
|
|
498 |
|
|
499 |
|
|
500 |
|
|
501 |
1 |
sq = new Sequence("test", "ABCDEF"); |
502 |
1 |
sq.deleteChars(0, 2); |
503 |
1 |
assertEquals("CDEF", sq.getSequenceAsString()); |
504 |
1 |
assertEquals(3, sq.getStart()); |
505 |
1 |
assertEquals(6, sq.getEnd()); |
506 |
1 |
assertNull(PA.getValue(sq, "datasetSequence")); |
507 |
|
|
508 |
|
|
509 |
|
|
510 |
|
|
511 |
1 |
sq = new Sequence("test", "ABCDEF"); |
512 |
1 |
sq.deleteChars(4, 6); |
513 |
1 |
assertEquals("ABCD", sq.getSequenceAsString()); |
514 |
1 |
assertEquals(1, sq.getStart()); |
515 |
1 |
assertEquals(4, sq.getEnd()); |
516 |
1 |
assertNull(PA.getValue(sq, "datasetSequence")); |
517 |
|
} |
518 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (65) |
Complexity: 1 |
Complexity Density: 0.02 |
1PASS
|
|
519 |
1 |
@Test(groups = { "Functional" })... |
520 |
|
public void testDeleteChars_withDbRefsAndFeatures() |
521 |
|
{ |
522 |
|
|
523 |
|
|
524 |
|
|
525 |
|
|
526 |
1 |
SequenceI sq = new Sequence("test", "ABCDEF"); |
527 |
1 |
sq.createDatasetSequence(); |
528 |
1 |
DBRefEntry dbr1 = new DBRefEntry("Uniprot", "0", "a123"); |
529 |
1 |
sq.addDBRef(dbr1); |
530 |
1 |
Object ds = PA.getValue(sq, "datasetSequence"); |
531 |
1 |
assertNotNull(ds); |
532 |
1 |
assertEquals(1, sq.getStart()); |
533 |
1 |
assertEquals(6, sq.getEnd()); |
534 |
1 |
sq.deleteChars(2, 3); |
535 |
1 |
assertEquals("ABDEF", sq.getSequenceAsString()); |
536 |
1 |
assertEquals(1, sq.getStart()); |
537 |
1 |
assertEquals(5, sq.getEnd()); |
538 |
1 |
Object newDs = PA.getValue(sq, "datasetSequence"); |
539 |
1 |
assertNotNull(newDs); |
540 |
1 |
assertNotSame(ds, newDs); |
541 |
1 |
assertNotNull(sq.getDBRefs()); |
542 |
1 |
assertEquals(1, sq.getDBRefs().length); |
543 |
1 |
assertNotSame(dbr1, sq.getDBRefs()[0]); |
544 |
1 |
assertEquals(dbr1, sq.getDBRefs()[0]); |
545 |
|
|
546 |
|
|
547 |
|
|
548 |
|
|
549 |
|
|
550 |
1 |
sq = new Sequence("test", "ABCDEF"); |
551 |
1 |
sq.createDatasetSequence(); |
552 |
1 |
SequenceFeature sf1 = new SequenceFeature("Cath", "desc", 2, 4, 2f, |
553 |
|
"CathGroup"); |
554 |
1 |
sq.addSequenceFeature(sf1); |
555 |
1 |
ds = PA.getValue(sq, "datasetSequence"); |
556 |
1 |
assertNotNull(ds); |
557 |
1 |
assertEquals(1, sq.getStart()); |
558 |
1 |
assertEquals(6, sq.getEnd()); |
559 |
1 |
sq.deleteChars(2, 4); |
560 |
1 |
assertEquals("ABEF", sq.getSequenceAsString()); |
561 |
1 |
assertEquals(1, sq.getStart()); |
562 |
1 |
assertEquals(4, sq.getEnd()); |
563 |
1 |
newDs = PA.getValue(sq, "datasetSequence"); |
564 |
1 |
assertNotNull(newDs); |
565 |
1 |
assertNotSame(ds, newDs); |
566 |
1 |
List<SequenceFeature> sfs = sq.getSequenceFeatures(); |
567 |
1 |
assertEquals(1, sfs.size()); |
568 |
1 |
assertNotSame(sf1, sfs.get(0)); |
569 |
1 |
assertEquals(sf1, sfs.get(0)); |
570 |
|
|
571 |
|
|
572 |
|
|
573 |
|
|
574 |
|
|
575 |
1 |
sq = new Sequence("test", "ABCDEF"); |
576 |
1 |
sq.createDatasetSequence(); |
577 |
1 |
ds = PA.getValue(sq, "datasetSequence"); |
578 |
1 |
sf1 = new SequenceFeature("Cath", "desc", 2, 4, 2f, "CathGroup"); |
579 |
1 |
sq.addSequenceFeature(sf1); |
580 |
1 |
sq.deleteChars(0, 2); |
581 |
1 |
assertEquals("CDEF", sq.getSequenceAsString()); |
582 |
1 |
assertEquals(3, sq.getStart()); |
583 |
1 |
assertEquals(6, sq.getEnd()); |
584 |
1 |
assertSame(ds, PA.getValue(sq, "datasetSequence")); |
585 |
1 |
sfs = sq.getSequenceFeatures(); |
586 |
1 |
assertNotNull(sfs); |
587 |
1 |
assertEquals(1, sfs.size()); |
588 |
1 |
assertSame(sf1, sfs.get(0)); |
589 |
|
|
590 |
|
|
591 |
|
|
592 |
|
|
593 |
|
|
594 |
1 |
sq = new Sequence("test", "ABCDEF"); |
595 |
1 |
sq.createDatasetSequence(); |
596 |
1 |
ds = PA.getValue(sq, "datasetSequence"); |
597 |
1 |
dbr1 = new DBRefEntry("Uniprot", "0", "a123"); |
598 |
1 |
sq.addDBRef(dbr1); |
599 |
1 |
sq.deleteChars(4, 6); |
600 |
1 |
assertEquals("ABCD", sq.getSequenceAsString()); |
601 |
1 |
assertEquals(1, sq.getStart()); |
602 |
1 |
assertEquals(4, sq.getEnd()); |
603 |
1 |
assertSame(ds, PA.getValue(sq, "datasetSequence")); |
604 |
1 |
assertNotNull(sq.getDBRefs()); |
605 |
1 |
assertEquals(1, sq.getDBRefs().length); |
606 |
1 |
assertSame(dbr1, sq.getDBRefs()[0]); |
607 |
|
} |
608 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
1PASS
|
|
609 |
1 |
@Test(groups = { "Functional" })... |
610 |
|
public void testInsertCharAt() |
611 |
|
{ |
612 |
|
|
613 |
1 |
SequenceI sq = new Sequence("test", "ABCDEF"); |
614 |
1 |
sq.insertCharAt(0, 'z'); |
615 |
1 |
assertEquals("zABCDEF", sq.getSequenceAsString()); |
616 |
1 |
sq.insertCharAt(2, 2, 'x'); |
617 |
1 |
assertEquals("zAxxBCDEF", sq.getSequenceAsString()); |
618 |
|
|
619 |
|
|
620 |
|
} |
621 |
|
|
622 |
|
|
623 |
|
|
624 |
|
|
625 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
1PASS
|
|
626 |
1 |
@Test(groups = { "Functional" })... |
627 |
|
public void testGapMap() |
628 |
|
{ |
629 |
1 |
SequenceI sq = new Sequence("test", "-A--B-CD-E--F-"); |
630 |
1 |
sq.createDatasetSequence(); |
631 |
1 |
assertEquals("[1, 4, 6, 7, 9, 12]", Arrays.toString(sq.gapMap())); |
632 |
|
} |
633 |
|
|
634 |
|
|
635 |
|
|
636 |
|
|
637 |
|
|
|
|
| 95.2% |
Uncovered Elements: 1 (21) |
Complexity: 2 |
Complexity Density: 0.1 |
1PASS
|
|
638 |
1 |
@Test(groups = { "Functional" })... |
639 |
|
public void testGetSequenceFeatures() |
640 |
|
{ |
641 |
1 |
SequenceI sq = new Sequence("test", "GATCAT"); |
642 |
1 |
sq.createDatasetSequence(); |
643 |
|
|
644 |
1 |
assertTrue(sq.getSequenceFeatures().isEmpty()); |
645 |
|
|
646 |
|
|
647 |
|
|
648 |
|
|
649 |
1 |
SequenceFeature sf = new SequenceFeature("Cath", "desc", 2, 4, 2f, null); |
650 |
1 |
sq.addSequenceFeature(sf); |
651 |
1 |
List<SequenceFeature> sfs = sq.getSequenceFeatures(); |
652 |
1 |
assertEquals(1, sfs.size()); |
653 |
1 |
assertSame(sf, sfs.get(0)); |
654 |
|
|
655 |
|
|
656 |
|
|
657 |
|
|
658 |
|
|
659 |
|
|
660 |
|
|
661 |
|
|
662 |
1 |
SequenceFeature sf2 = new SequenceFeature("Cath", "desc", 2, 4, 2f, |
663 |
|
null); |
664 |
1 |
sq.getDatasetSequence().addSequenceFeature(sf2); |
665 |
1 |
sfs = sq.getSequenceFeatures(); |
666 |
1 |
assertEquals(1, sfs.size()); |
667 |
1 |
assertSame(sf, sfs.get(0)); |
668 |
|
|
669 |
|
|
670 |
|
|
671 |
|
|
672 |
|
|
673 |
1 |
sq.setSequenceFeatures(null); |
674 |
1 |
assertTrue(sq.getDatasetSequence().getSequenceFeatures().isEmpty()); |
675 |
|
|
676 |
|
|
677 |
|
|
678 |
|
|
679 |
|
|
680 |
1 |
sq.getDatasetSequence().setSequenceFeatures(null); |
681 |
|
|
682 |
|
|
683 |
|
|
684 |
|
|
685 |
1 |
try |
686 |
|
{ |
687 |
1 |
sq.getDatasetSequence().setDatasetSequence(sq); |
688 |
0 |
Assert.fail("Expected Error to be raised when calling setDatasetSequence with self reference"); |
689 |
|
} catch (IllegalArgumentException e) |
690 |
|
{ |
691 |
|
|
692 |
1 |
assertTrue(e.getMessage().toLowerCase() |
693 |
|
.contains("implementation error")); |
694 |
|
} |
695 |
1 |
assertTrue(sq.getSequenceFeatures().isEmpty()); |
696 |
|
} |
697 |
|
|
698 |
|
|
699 |
|
|
700 |
|
|
701 |
|
|
702 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
1PASS
|
|
703 |
1 |
@Test(groups = { "Functional" })... |
704 |
|
public void testFindPositionMap() |
705 |
|
{ |
706 |
|
|
707 |
|
|
708 |
|
|
709 |
|
|
710 |
|
|
711 |
|
|
712 |
1 |
Sequence sq = new Sequence("TestSeq", "AB.C-D E."); |
713 |
1 |
int[] map = sq.findPositionMap(); |
714 |
1 |
assertEquals(Arrays.toString(new int[] { 1, 2, 3, 3, 4, 4, 5, 5, 6 }), |
715 |
|
Arrays.toString(map)); |
716 |
|
} |
717 |
|
|
718 |
|
|
719 |
|
|
720 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
1PASS
|
|
721 |
1 |
@Test(groups = { "Functional" })... |
722 |
|
public void testGetSubsequence() |
723 |
|
{ |
724 |
1 |
SequenceI sq = new Sequence("TestSeq", "ABCDEFG"); |
725 |
1 |
sq.createDatasetSequence(); |
726 |
|
|
727 |
|
|
728 |
1 |
SequenceI subseq = sq.getSubSequence(2, 4); |
729 |
|
|
730 |
1 |
assertEquals("CD", subseq.getSequenceAsString()); |
731 |
|
|
732 |
1 |
assertEquals(3, subseq.getStart()); |
733 |
1 |
assertEquals(4, subseq.getEnd()); |
734 |
|
|
735 |
1 |
assertSame(sq.getDatasetSequence(), subseq.getDatasetSequence()); |
736 |
|
} |
737 |
|
|
738 |
|
|
739 |
|
|
740 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (14) |
Complexity: 1 |
Complexity Density: 0.07 |
1PASS
|
|
741 |
1 |
@Test(groups = { "Functional" })... |
742 |
|
public void testCreateDatasetSequence() |
743 |
|
{ |
744 |
1 |
SequenceI sq = new Sequence("my", "ASDASD"); |
745 |
1 |
sq.addSequenceFeature(new SequenceFeature("type", "desc", 1, 10, 1f, |
746 |
|
"group")); |
747 |
1 |
sq.addDBRef(new DBRefEntry("source", "version", "accession")); |
748 |
1 |
assertNull(sq.getDatasetSequence()); |
749 |
1 |
assertNotNull(PA.getValue(sq, "sequenceFeatureStore")); |
750 |
1 |
assertNotNull(PA.getValue(sq, "dbrefs")); |
751 |
|
|
752 |
1 |
SequenceI rds = sq.createDatasetSequence(); |
753 |
1 |
assertNotNull(rds); |
754 |
1 |
assertNull(rds.getDatasetSequence()); |
755 |
1 |
assertSame(sq.getDatasetSequence(), rds); |
756 |
|
|
757 |
|
|
758 |
1 |
assertNull(PA.getValue(sq, "sequenceFeatureStore")); |
759 |
1 |
assertNull(PA.getValue(sq, "dbrefs")); |
760 |
1 |
assertNotNull(PA.getValue(rds, "sequenceFeatureStore")); |
761 |
1 |
assertNotNull(PA.getValue(rds, "dbrefs")); |
762 |
|
} |
763 |
|
|
764 |
|
|
765 |
|
|
766 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (64) |
Complexity: 1 |
Complexity Density: 0.02 |
1PASS
|
|
767 |
1 |
@Test(groups = { "Functional" })... |
768 |
|
public void testDeriveSequence_existingDataset() |
769 |
|
{ |
770 |
1 |
Sequence sq = new Sequence("Seq1", "CD"); |
771 |
1 |
sq.setDatasetSequence(new Sequence("Seq1", "ABCDEF")); |
772 |
1 |
sq.getDatasetSequence().addSequenceFeature( |
773 |
|
new SequenceFeature("", "", 1, 2, 0f, null)); |
774 |
1 |
sq.setStart(3); |
775 |
1 |
sq.setEnd(4); |
776 |
|
|
777 |
1 |
sq.setDescription("Test sequence description.."); |
778 |
1 |
sq.setVamsasId("TestVamsasId"); |
779 |
1 |
sq.addDBRef(new DBRefEntry("PDB", "version0", "1TST")); |
780 |
|
|
781 |
1 |
sq.addDBRef(new DBRefEntry("PDB", "version1", "1PDB")); |
782 |
1 |
sq.addDBRef(new DBRefEntry("PDB", "version2", "2PDB")); |
783 |
1 |
sq.addDBRef(new DBRefEntry("PDB", "version3", "3PDB")); |
784 |
1 |
sq.addDBRef(new DBRefEntry("PDB", "version4", "4PDB")); |
785 |
|
|
786 |
1 |
sq.addPDBId(new PDBEntry("1PDB", "A", Type.PDB, "filePath/test1")); |
787 |
1 |
sq.addPDBId(new PDBEntry("1PDB", "B", Type.PDB, "filePath/test1")); |
788 |
1 |
sq.addPDBId(new PDBEntry("2PDB", "A", Type.MMCIF, "filePath/test2")); |
789 |
1 |
sq.addPDBId(new PDBEntry("2PDB", "B", Type.MMCIF, "filePath/test2")); |
790 |
|
|
791 |
|
|
792 |
1 |
DBRefEntry pdb1pdb = new DBRefEntry("PDB", "version1", "1PDB"); |
793 |
1 |
DBRefEntry pdb2pdb = new DBRefEntry("PDB", "version2", "2PDB"); |
794 |
|
|
795 |
1 |
List<DBRefEntry> primRefs = Arrays.asList(new DBRefEntry[] { pdb1pdb, |
796 |
|
pdb2pdb }); |
797 |
|
|
798 |
1 |
sq.getDatasetSequence().addDBRef(pdb1pdb); |
799 |
1 |
sq.getDatasetSequence().addDBRef(pdb2pdb); |
800 |
1 |
sq.getDatasetSequence().addDBRef( |
801 |
|
new DBRefEntry("PDB", "version3", "3PDB")); |
802 |
1 |
sq.getDatasetSequence().addDBRef( |
803 |
|
new DBRefEntry("PDB", "version4", "4PDB")); |
804 |
|
|
805 |
1 |
PDBEntry pdbe1a = new PDBEntry("1PDB", "A", Type.PDB, "filePath/test1"); |
806 |
1 |
PDBEntry pdbe1b = new PDBEntry("1PDB", "B", Type.PDB, "filePath/test1"); |
807 |
1 |
PDBEntry pdbe2a = new PDBEntry("2PDB", "A", Type.MMCIF, |
808 |
|
"filePath/test2"); |
809 |
1 |
PDBEntry pdbe2b = new PDBEntry("2PDB", "B", Type.MMCIF, |
810 |
|
"filePath/test2"); |
811 |
1 |
sq.getDatasetSequence().addPDBId(pdbe1a); |
812 |
1 |
sq.getDatasetSequence().addPDBId(pdbe1b); |
813 |
1 |
sq.getDatasetSequence().addPDBId(pdbe2a); |
814 |
1 |
sq.getDatasetSequence().addPDBId(pdbe2b); |
815 |
|
|
816 |
|
|
817 |
|
|
818 |
|
|
819 |
1 |
Assert.assertEquals(sq.getDatasetSequence().getAllPDBEntries(), Arrays |
820 |
|
.asList(new PDBEntry[] { pdbe1a, pdbe1b, pdbe2a, pdbe2b }), |
821 |
|
"PDB Entries were not found on dataset sequence."); |
822 |
|
|
823 |
|
|
824 |
|
|
825 |
|
|
826 |
1 |
Assert.assertEquals(pdbe1a, |
827 |
|
sq.getDatasetSequence().getPDBEntry("1PDB"), |
828 |
|
"PDB Entry '1PDB' not found on dataset sequence via getPDBEntry."); |
829 |
1 |
ArrayList<Annotation> annotsList = new ArrayList<>(); |
830 |
1 |
System.out.println(">>>>>> " + sq.getSequenceAsString().length()); |
831 |
1 |
annotsList.add(new Annotation("A", "A", 'X', 0.1f)); |
832 |
1 |
annotsList.add(new Annotation("A", "A", 'X', 0.1f)); |
833 |
1 |
Annotation[] annots = annotsList.toArray(new Annotation[0]); |
834 |
1 |
sq.addAlignmentAnnotation(new AlignmentAnnotation("Test annot", |
835 |
|
"Test annot description", annots)); |
836 |
1 |
sq.getDatasetSequence().addAlignmentAnnotation( |
837 |
|
new AlignmentAnnotation("Test annot", "Test annot description", |
838 |
|
annots)); |
839 |
1 |
Assert.assertEquals(sq.getDescription(), "Test sequence description.."); |
840 |
1 |
Assert.assertEquals(sq.getDBRefs().length, 5); |
841 |
|
|
842 |
1 |
Assert.assertEquals(sq.getAllPDBEntries().size(), 4); |
843 |
1 |
Assert.assertNotNull(sq.getAnnotation()); |
844 |
1 |
Assert.assertEquals(sq.getAnnotation()[0].annotations.length, 2); |
845 |
1 |
Assert.assertEquals(sq.getDatasetSequence().getDBRefs().length, 5); |
846 |
|
|
847 |
|
|
848 |
1 |
Assert.assertEquals(sq.getDatasetSequence().getAllPDBEntries().size(), |
849 |
|
4); |
850 |
1 |
Assert.assertNotNull(sq.getDatasetSequence().getAnnotation()); |
851 |
|
|
852 |
1 |
Sequence derived = (Sequence) sq.deriveSequence(); |
853 |
|
|
854 |
1 |
Assert.assertEquals(derived.getDescription(), |
855 |
|
"Test sequence description.."); |
856 |
1 |
Assert.assertEquals(derived.getDBRefs().length, 5); |
857 |
1 |
Assert.assertEquals(derived.getAllPDBEntries().size(), 4); |
858 |
1 |
Assert.assertNotNull(derived.getAnnotation()); |
859 |
1 |
Assert.assertEquals(derived.getAnnotation()[0].annotations.length, 2); |
860 |
1 |
Assert.assertEquals(derived.getDatasetSequence().getDBRefs().length, 5); |
861 |
1 |
Assert.assertEquals(derived.getDatasetSequence().getAllPDBEntries() |
862 |
|
.size(), 4); |
863 |
1 |
Assert.assertNotNull(derived.getDatasetSequence().getAnnotation()); |
864 |
|
|
865 |
1 |
assertEquals("CD", derived.getSequenceAsString()); |
866 |
1 |
assertSame(sq.getDatasetSequence(), derived.getDatasetSequence()); |
867 |
|
|
868 |
|
|
869 |
1 |
assertNotNull(sq.getSequenceFeatures()); |
870 |
1 |
assertEquals(sq.getSequenceFeatures(), derived.getSequenceFeatures()); |
871 |
|
|
872 |
|
|
873 |
|
|
874 |
|
|
875 |
|
|
876 |
|
|
877 |
1 |
assertEquals(primRefs, sq.getPrimaryDBRefs()); |
878 |
1 |
assertEquals(primRefs, sq.getDatasetSequence().getPrimaryDBRefs()); |
879 |
|
|
880 |
1 |
assertEquals(sq.getPrimaryDBRefs(), derived.getPrimaryDBRefs()); |
881 |
|
|
882 |
|
} |
883 |
|
|
884 |
|
|
885 |
|
|
886 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
1PASS
|
|
887 |
1 |
@Test(groups = { "Functional" })... |
888 |
|
public void testDeriveSequence_noDatasetUngapped() |
889 |
|
{ |
890 |
1 |
SequenceI sq = new Sequence("Seq1", "ABCDEF"); |
891 |
1 |
assertEquals(1, sq.getStart()); |
892 |
1 |
assertEquals(6, sq.getEnd()); |
893 |
1 |
SequenceI derived = sq.deriveSequence(); |
894 |
1 |
assertEquals("ABCDEF", derived.getSequenceAsString()); |
895 |
1 |
assertEquals("ABCDEF", derived.getDatasetSequence() |
896 |
|
.getSequenceAsString()); |
897 |
|
} |
898 |
|
|
899 |
|
|
900 |
|
|
901 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0.14 |
1PASS
|
|
902 |
1 |
@Test(groups = { "Functional" })... |
903 |
|
public void testDeriveSequence_noDatasetGapped() |
904 |
|
{ |
905 |
1 |
SequenceI sq = new Sequence("Seq1", "AB-C.D EF"); |
906 |
1 |
assertEquals(1, sq.getStart()); |
907 |
1 |
assertEquals(6, sq.getEnd()); |
908 |
1 |
assertNull(sq.getDatasetSequence()); |
909 |
1 |
SequenceI derived = sq.deriveSequence(); |
910 |
1 |
assertEquals("AB-C.D EF", derived.getSequenceAsString()); |
911 |
1 |
assertEquals("ABCDEF", derived.getDatasetSequence() |
912 |
|
.getSequenceAsString()); |
913 |
|
} |
914 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (13) |
Complexity: 1 |
Complexity Density: 0.08 |
1PASS
|
|
915 |
1 |
@Test(groups = { "Functional" })... |
916 |
|
public void testCopyConstructor_noDataset() |
917 |
|
{ |
918 |
1 |
SequenceI seq1 = new Sequence("Seq1", "AB-C.D EF"); |
919 |
1 |
seq1.setDescription("description"); |
920 |
1 |
seq1.addAlignmentAnnotation(new AlignmentAnnotation("label", "desc", |
921 |
|
1.3d)); |
922 |
1 |
seq1.addSequenceFeature(new SequenceFeature("type", "desc", 22, 33, |
923 |
|
12.4f, "group")); |
924 |
1 |
seq1.addPDBId(new PDBEntry("1A70", "B", Type.PDB, "File")); |
925 |
1 |
seq1.addDBRef(new DBRefEntry("EMBL", "1.2", "AZ12345")); |
926 |
|
|
927 |
1 |
SequenceI copy = new Sequence(seq1); |
928 |
|
|
929 |
1 |
assertNull(copy.getDatasetSequence()); |
930 |
|
|
931 |
1 |
verifyCopiedSequence(seq1, copy); |
932 |
|
|
933 |
|
|
934 |
|
|
935 |
|
|
936 |
|
|
937 |
|
|
938 |
|
|
939 |
1 |
DBRefEntry[] dbrefs = copy.getDBRefs(); |
940 |
1 |
assertEquals(1, dbrefs.length); |
941 |
1 |
assertFalse(dbrefs[0] == seq1.getDBRefs()[0]); |
942 |
1 |
assertTrue(dbrefs[0].equals(seq1.getDBRefs()[0])); |
943 |
|
} |
944 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (14) |
Complexity: 1 |
Complexity Density: 0.07 |
1PASS
|
|
945 |
1 |
@Test(groups = { "Functional" })... |
946 |
|
public void testCopyConstructor_withDataset() |
947 |
|
{ |
948 |
1 |
SequenceI seq1 = new Sequence("Seq1", "AB-C.D EF"); |
949 |
1 |
seq1.createDatasetSequence(); |
950 |
1 |
seq1.setDescription("description"); |
951 |
1 |
seq1.addAlignmentAnnotation(new AlignmentAnnotation("label", "desc", |
952 |
|
1.3d)); |
953 |
|
|
954 |
|
|
955 |
1 |
seq1.addSequenceFeature(new SequenceFeature("type", "desc", 22, 33, |
956 |
|
12.4f, "group")); |
957 |
1 |
seq1.addPDBId(new PDBEntry("1A70", "B", Type.PDB, "File")); |
958 |
|
|
959 |
1 |
seq1.getDatasetSequence().addDBRef( |
960 |
|
new DBRefEntry("EMBL", "1.2", "AZ12345")); |
961 |
|
|
962 |
1 |
SequenceI copy = new Sequence(seq1); |
963 |
|
|
964 |
1 |
assertNotNull(copy.getDatasetSequence()); |
965 |
1 |
assertSame(copy.getDatasetSequence(), seq1.getDatasetSequence()); |
966 |
|
|
967 |
1 |
verifyCopiedSequence(seq1, copy); |
968 |
|
|
969 |
|
|
970 |
|
|
971 |
1 |
DBRefEntry[] dbrefs = copy.getDBRefs(); |
972 |
1 |
assertEquals(1, dbrefs.length); |
973 |
1 |
assertSame(dbrefs[0], seq1.getDBRefs()[0]); |
974 |
|
} |
975 |
|
|
976 |
|
|
977 |
|
|
978 |
|
|
979 |
|
@param |
980 |
|
@param |
981 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (23) |
Complexity: 3 |
Complexity Density: 0.14 |
|
982 |
2 |
protected void verifyCopiedSequence(SequenceI seq1, SequenceI copy)... |
983 |
|
{ |
984 |
|
|
985 |
2 |
assertEquals(copy.getName(), seq1.getName()); |
986 |
2 |
assertEquals(copy.getDescription(), seq1.getDescription()); |
987 |
2 |
assertEquals(copy.getStart(), seq1.getStart()); |
988 |
2 |
assertEquals(copy.getEnd(), seq1.getEnd()); |
989 |
2 |
assertEquals(copy.getSequenceAsString(), seq1.getSequenceAsString()); |
990 |
|
|
991 |
|
|
992 |
2 |
AlignmentAnnotation[] anns = copy.getAnnotation(); |
993 |
2 |
assertEquals(1, anns.length); |
994 |
2 |
assertFalse(anns[0] == seq1.getAnnotation()[0]); |
995 |
2 |
assertEquals(anns[0].label, seq1.getAnnotation()[0].label); |
996 |
2 |
assertEquals(anns[0].description, seq1.getAnnotation()[0].description); |
997 |
2 |
assertEquals(anns[0].score, seq1.getAnnotation()[0].score); |
998 |
|
|
999 |
|
|
1000 |
2 |
List<SequenceFeature> sfs = copy.getSequenceFeatures(); |
1001 |
2 |
assertEquals(1, sfs.size()); |
1002 |
2 |
if (seq1.getDatasetSequence() != null |
1003 |
|
&& copy.getDatasetSequence() == seq1.getDatasetSequence()) |
1004 |
|
{ |
1005 |
1 |
assertSame(sfs.get(0), seq1.getSequenceFeatures().get(0)); |
1006 |
|
} |
1007 |
|
else |
1008 |
|
{ |
1009 |
1 |
assertNotSame(sfs.get(0), seq1.getSequenceFeatures().get(0)); |
1010 |
|
} |
1011 |
2 |
assertEquals(sfs.get(0), seq1.getSequenceFeatures().get(0)); |
1012 |
|
|
1013 |
|
|
1014 |
2 |
Vector<PDBEntry> pdbs = copy.getAllPDBEntries(); |
1015 |
2 |
assertEquals(1, pdbs.size()); |
1016 |
2 |
assertFalse(pdbs.get(0) == seq1.getAllPDBEntries().get(0)); |
1017 |
2 |
assertTrue(pdbs.get(0).equals(seq1.getAllPDBEntries().get(0))); |
1018 |
|
} |
1019 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
1PASS
|
|
1020 |
1 |
@Test(groups = "Functional")... |
1021 |
|
public void testGetCharAt() |
1022 |
|
{ |
1023 |
1 |
SequenceI sq = new Sequence("", "abcde"); |
1024 |
1 |
assertEquals('a', sq.getCharAt(0)); |
1025 |
1 |
assertEquals('e', sq.getCharAt(4)); |
1026 |
1 |
assertEquals(' ', sq.getCharAt(5)); |
1027 |
1 |
assertEquals(' ', sq.getCharAt(-1)); |
1028 |
|
} |
1029 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (12) |
Complexity: 1 |
Complexity Density: 0.08 |
1PASS
|
|
1030 |
1 |
@Test(groups = { "Functional" })... |
1031 |
|
public void testAddSequenceFeatures() |
1032 |
|
{ |
1033 |
1 |
SequenceI sq = new Sequence("", "abcde"); |
1034 |
|
|
1035 |
1 |
assertFalse(sq.addSequenceFeature(new SequenceFeature(null, "desc", 4, |
1036 |
|
8, 0f, null))); |
1037 |
1 |
assertTrue(sq.addSequenceFeature(new SequenceFeature("Cath", "desc", 4, |
1038 |
|
8, 0f, null))); |
1039 |
|
|
1040 |
1 |
assertFalse(sq.addSequenceFeature(new SequenceFeature("Cath", "desc", |
1041 |
|
4, 8, 0f, null))); |
1042 |
|
|
1043 |
1 |
assertTrue(sq.addSequenceFeature(new SequenceFeature("Scop", "desc", 4, |
1044 |
|
8, 0f, null))); |
1045 |
1 |
assertTrue(sq.addSequenceFeature(new SequenceFeature("Cath", |
1046 |
|
"description", 4, 8, 0f, null))); |
1047 |
1 |
assertTrue(sq.addSequenceFeature(new SequenceFeature("Cath", "desc", 3, |
1048 |
|
8, 0f, null))); |
1049 |
1 |
assertTrue(sq.addSequenceFeature(new SequenceFeature("Cath", "desc", 4, |
1050 |
|
9, 0f, null))); |
1051 |
1 |
assertTrue(sq.addSequenceFeature(new SequenceFeature("Cath", "desc", 4, |
1052 |
|
8, 1f, null))); |
1053 |
1 |
assertTrue(sq.addSequenceFeature(new SequenceFeature("Cath", "desc", 4, |
1054 |
|
8, Float.NaN, null))); |
1055 |
1 |
assertTrue(sq.addSequenceFeature(new SequenceFeature("Cath", "desc", 4, |
1056 |
|
8, 0f, "Metal"))); |
1057 |
1 |
assertEquals(8, sq.getFeatures().getAllFeatures().size()); |
1058 |
|
} |
1059 |
|
|
1060 |
|
|
1061 |
|
|
1062 |
|
|
1063 |
|
@see |
1064 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (40) |
Complexity: 1 |
Complexity Density: 0.03 |
1PASS
|
|
1065 |
1 |
@Test(groups = { "Functional" })... |
1066 |
|
public void testAddDBRef() |
1067 |
|
{ |
1068 |
1 |
SequenceI sq = new Sequence("", "abcde"); |
1069 |
1 |
assertNull(sq.getDBRefs()); |
1070 |
1 |
DBRefEntry dbref = new DBRefEntry("Uniprot", "1", "P00340"); |
1071 |
1 |
sq.addDBRef(dbref); |
1072 |
1 |
assertEquals(1, sq.getDBRefs().length); |
1073 |
1 |
assertSame(dbref, sq.getDBRefs()[0]); |
1074 |
|
|
1075 |
|
|
1076 |
|
|
1077 |
|
|
1078 |
1 |
DBRefEntry dbref2 = new DBRefEntry("Uniprot", "2", "P00340"); |
1079 |
1 |
sq.addDBRef(dbref2); |
1080 |
1 |
assertEquals(2, sq.getDBRefs().length); |
1081 |
1 |
assertSame(dbref, sq.getDBRefs()[0]); |
1082 |
1 |
assertSame(dbref2, sq.getDBRefs()[1]); |
1083 |
|
|
1084 |
|
|
1085 |
|
|
1086 |
|
|
1087 |
1 |
sq.addDBRef(new DBRefEntry("UNIPROT", "1", "p00340")); |
1088 |
1 |
assertEquals(2, sq.getDBRefs().length); |
1089 |
|
|
1090 |
|
|
1091 |
|
|
1092 |
|
|
1093 |
1 |
DBRefEntry dbref3 = new DBRefEntry("UniRef", "1", "p00340"); |
1094 |
1 |
sq.addDBRef(dbref3); |
1095 |
1 |
assertEquals(3, sq.getDBRefs().length); |
1096 |
1 |
assertSame(dbref3, sq.getDBRefs()[2]); |
1097 |
|
|
1098 |
|
|
1099 |
|
|
1100 |
|
|
1101 |
1 |
DBRefEntry dbref4 = new DBRefEntry("UniRef", "1", "p00341"); |
1102 |
1 |
sq.addDBRef(dbref4); |
1103 |
1 |
assertEquals(4, sq.getDBRefs().length); |
1104 |
1 |
assertSame(dbref4, sq.getDBRefs()[3]); |
1105 |
|
|
1106 |
|
|
1107 |
|
|
1108 |
|
|
1109 |
1 |
DBRefEntry dbref5 = new DBRefEntry("UniRef", "1", "p00341"); |
1110 |
1 |
Mapping map = new Mapping(new MapList(new int[] { 1, 3 }, new int[] { |
1111 |
|
1, 1 }, 3, 1)); |
1112 |
1 |
dbref5.setMap(map); |
1113 |
1 |
sq.addDBRef(dbref5); |
1114 |
1 |
assertEquals(4, sq.getDBRefs().length); |
1115 |
1 |
assertSame(dbref4, sq.getDBRefs()[3]); |
1116 |
1 |
assertSame(map, dbref4.getMap()); |
1117 |
|
|
1118 |
|
|
1119 |
|
|
1120 |
|
|
1121 |
1 |
dbref2.setVersion("0"); |
1122 |
1 |
DBRefEntry dbref6 = new DBRefEntry(dbref2.getSource(), "3", |
1123 |
|
dbref2.getAccessionId()); |
1124 |
1 |
sq.addDBRef(dbref6); |
1125 |
1 |
assertEquals(4, sq.getDBRefs().length); |
1126 |
1 |
assertSame(dbref2, sq.getDBRefs()[1]); |
1127 |
1 |
assertEquals("3", dbref2.getVersion()); |
1128 |
|
|
1129 |
|
|
1130 |
|
|
1131 |
|
|
1132 |
1 |
dbref3.setVersion("Uniprot:0"); |
1133 |
1 |
DBRefEntry dbref7 = new DBRefEntry(dbref3.getSource(), "3", |
1134 |
|
dbref3.getAccessionId()); |
1135 |
1 |
sq.addDBRef(dbref7); |
1136 |
1 |
assertEquals(4, sq.getDBRefs().length); |
1137 |
1 |
assertSame(dbref3, sq.getDBRefs()[2]); |
1138 |
1 |
assertEquals("3", dbref2.getVersion()); |
1139 |
|
} |
1140 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (37) |
Complexity: 1 |
Complexity Density: 0.03 |
1PASS
|
|
1141 |
1 |
@Test(groups = { "Functional" })... |
1142 |
|
public void testGetPrimaryDBRefs_peptide() |
1143 |
|
{ |
1144 |
1 |
SequenceI sq = new Sequence("aseq", "ASDFKYLMQPRST", 10, 22); |
1145 |
|
|
1146 |
|
|
1147 |
1 |
List<DBRefEntry> primaryDBRefs = sq.getPrimaryDBRefs(); |
1148 |
1 |
assertTrue(primaryDBRefs.isEmpty()); |
1149 |
|
|
1150 |
|
|
1151 |
1 |
sq.setDBRefs(new DBRefEntry[] {}); |
1152 |
1 |
primaryDBRefs = sq.getPrimaryDBRefs(); |
1153 |
1 |
assertTrue(primaryDBRefs.isEmpty()); |
1154 |
|
|
1155 |
|
|
1156 |
1 |
DBRefEntry upentry1 = new DBRefEntry("UNIPROT", "0", "Q04760"); |
1157 |
1 |
sq.addDBRef(upentry1); |
1158 |
|
|
1159 |
|
|
1160 |
1 |
DBRefEntry upentry2 = new DBRefEntry("UNIPROT", "0", "Q04762"); |
1161 |
1 |
upentry2.setMap(new Mapping(null, new MapList(new int[] { 10, 22 }, |
1162 |
|
new int[] { 10, 22 }, 1, 1))); |
1163 |
1 |
sq.addDBRef(upentry2); |
1164 |
|
|
1165 |
|
|
1166 |
1 |
DBRefEntry upentry3 = new DBRefEntry("UNIPROT", "0", "Q04763"); |
1167 |
1 |
upentry3.setMap(new Mapping(null, new MapList(new int[] { 8, 24 }, |
1168 |
|
new int[] { 8, 24 }, 1, 1))); |
1169 |
1 |
sq.addDBRef(upentry3); |
1170 |
|
|
1171 |
|
|
1172 |
1 |
DBRefEntry upentry4 = new DBRefEntry("UNIPROT", "0", "Q04764"); |
1173 |
1 |
upentry4.setMap(new Mapping(null, new MapList(new int[] { 10, 18 }, |
1174 |
|
new int[] { 10, 18 }, 1, 1))); |
1175 |
1 |
sq.addDBRef(upentry4); |
1176 |
|
|
1177 |
|
|
1178 |
1 |
DBRefEntry upentry5 = new DBRefEntry("UNIPROT", "0", "Q04765"); |
1179 |
1 |
upentry5.setMap(new Mapping(null, new MapList(new int[] { 12, 22 }, |
1180 |
|
new int[] { 12, 22 }, 1, 1))); |
1181 |
1 |
sq.addDBRef(upentry5); |
1182 |
|
|
1183 |
|
|
1184 |
1 |
DBRefEntry upentry6 = new DBRefEntry("UNIPROT", "0", "Q04766"); |
1185 |
1 |
upentry6.setMap(new Mapping(null, new MapList(new int[] { 12, 18 }, |
1186 |
|
new int[] { 112, 118 }, 1, 1))); |
1187 |
1 |
sq.addDBRef(upentry6); |
1188 |
|
|
1189 |
|
|
1190 |
1 |
DBRefEntry upentry7 = new DBRefEntry("Pfam", "0", "PF00903"); |
1191 |
1 |
sq.addDBRef(upentry7); |
1192 |
|
|
1193 |
|
|
1194 |
1 |
DBRefEntry pdbentry = new DBRefEntry("PDB", "0", "1qip"); |
1195 |
1 |
sq.addDBRef(pdbentry); |
1196 |
|
|
1197 |
|
|
1198 |
1 |
sq.addDBRef(new DBRefEntry("PDB", "0", "1AAA")); |
1199 |
|
|
1200 |
|
|
1201 |
1 |
sq.addDBRef(new DBRefEntry("PDB", "0", "1DDD")); |
1202 |
|
|
1203 |
|
|
1204 |
|
|
1205 |
|
|
1206 |
1 |
sq.addPDBId(new PDBEntry("1QIP", null, Type.PDB, new File("/blah") |
1207 |
|
.toString())); |
1208 |
|
|
1209 |
|
|
1210 |
1 |
sq.addPDBId(new PDBEntry("1AAA", null, null, null)); |
1211 |
|
|
1212 |
1 |
primaryDBRefs = sq.getPrimaryDBRefs(); |
1213 |
1 |
assertEquals(4, primaryDBRefs.size()); |
1214 |
1 |
assertTrue("Couldn't find simple primary reference (UNIPROT)", |
1215 |
|
primaryDBRefs.contains(upentry1)); |
1216 |
1 |
assertTrue("Couldn't find mapped primary reference (UNIPROT)", |
1217 |
|
primaryDBRefs.contains(upentry2)); |
1218 |
1 |
assertTrue("Couldn't find mapped context reference (UNIPROT)", |
1219 |
|
primaryDBRefs.contains(upentry3)); |
1220 |
1 |
assertTrue("Couldn't find expected PDB primary reference", |
1221 |
|
primaryDBRefs.contains(pdbentry)); |
1222 |
|
} |
1223 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (17) |
Complexity: 1 |
Complexity Density: 0.06 |
1PASS
|
|
1224 |
1 |
@Test(groups = { "Functional" })... |
1225 |
|
public void testGetPrimaryDBRefs_nucleotide() |
1226 |
|
{ |
1227 |
1 |
SequenceI sq = new Sequence("aseq", "TGATCACTCGACTAGCATCAGCATA", 10, 34); |
1228 |
|
|
1229 |
|
|
1230 |
1 |
DBRefEntry dbr1 = new DBRefEntry("ENSEMBL", "0", "ENSG1234"); |
1231 |
1 |
sq.addDBRef(dbr1); |
1232 |
|
|
1233 |
|
|
1234 |
1 |
DBRefEntry dbr2 = new DBRefEntry("ENSEMBL", "0", "ENST1234"); |
1235 |
1 |
dbr2.setMap(new Mapping(null, new MapList(new int[] { 15, 25 }, |
1236 |
|
new int[] { 1, 11 }, 1, 1))); |
1237 |
1 |
sq.addDBRef(dbr2); |
1238 |
|
|
1239 |
|
|
1240 |
1 |
DBRefEntry dbr3 = new DBRefEntry("EMBL", "0", "J1234"); |
1241 |
1 |
dbr3.setMap(new Mapping(null, new MapList(new int[] { 10, 34 }, |
1242 |
|
new int[] { 10, 34 }, 1, 1))); |
1243 |
1 |
sq.addDBRef(dbr3); |
1244 |
|
|
1245 |
|
|
1246 |
1 |
DBRefEntry dbr4 = new DBRefEntry("CCDS", "0", "J1234"); |
1247 |
1 |
sq.addDBRef(dbr4); |
1248 |
|
|
1249 |
|
|
1250 |
1 |
DBRefEntry dbr5 = new DBRefEntry("UNIPROT", "0", "Q87654"); |
1251 |
1 |
sq.addDBRef(dbr5); |
1252 |
|
|
1253 |
1 |
List<DBRefEntry> primaryDBRefs = sq.getPrimaryDBRefs(); |
1254 |
1 |
assertEquals(2, primaryDBRefs.size()); |
1255 |
1 |
assertTrue(primaryDBRefs.contains(dbr1)); |
1256 |
1 |
assertTrue(primaryDBRefs.contains(dbr3)); |
1257 |
|
} |
1258 |
|
|
1259 |
|
|
1260 |
|
|
1261 |
|
|
1262 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (17) |
Complexity: 1 |
Complexity Density: 0.06 |
1PASS
|
|
1263 |
1 |
@Test(groups = { "Functional" })... |
1264 |
|
public void testUpdatePDBIds() |
1265 |
|
{ |
1266 |
1 |
PDBEntry pdbe1 = new PDBEntry("3A6S", null, null, null); |
1267 |
1 |
seq.addPDBId(pdbe1); |
1268 |
1 |
seq.addDBRef(new DBRefEntry("Ensembl", "8", "ENST1234")); |
1269 |
1 |
seq.addDBRef(new DBRefEntry("PDB", "0", "1A70")); |
1270 |
1 |
seq.addDBRef(new DBRefEntry("PDB", "0", "4BQGa")); |
1271 |
1 |
seq.addDBRef(new DBRefEntry("PDB", "0", "3a6sB")); |
1272 |
|
|
1273 |
1 |
seq.addDBRef(new DBRefEntry("PDB", "0", "2GIS7")); |
1274 |
|
|
1275 |
1 |
seq.updatePDBIds(); |
1276 |
1 |
List<PDBEntry> pdbIds = seq.getAllPDBEntries(); |
1277 |
1 |
assertEquals(4, pdbIds.size()); |
1278 |
1 |
assertSame(pdbe1, pdbIds.get(0)); |
1279 |
|
|
1280 |
1 |
assertEquals("B", pdbe1.getChainCode()); |
1281 |
1 |
assertEquals("1A70", pdbIds.get(1).getId()); |
1282 |
|
|
1283 |
1 |
assertEquals("4BQG", pdbIds.get(2).getId()); |
1284 |
1 |
assertEquals("a", pdbIds.get(2).getChainCode()); |
1285 |
1 |
assertEquals("2GIS7", pdbIds.get(3).getId()); |
1286 |
1 |
assertNull(pdbIds.get(3).getChainCode()); |
1287 |
|
} |
1288 |
|
|
1289 |
|
|
1290 |
|
|
1291 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (33) |
Complexity: 1 |
Complexity Density: 0.03 |
1PASS
|
|
1292 |
1 |
@Test(groups = { "Functional" })... |
1293 |
|
public void testAddPDBId() |
1294 |
|
{ |
1295 |
1 |
PDBEntry pdbe = new PDBEntry("3A6S", null, null, null); |
1296 |
1 |
seq.addPDBId(pdbe); |
1297 |
1 |
assertEquals(1, seq.getAllPDBEntries().size()); |
1298 |
1 |
assertSame(pdbe, seq.getPDBEntry("3A6S")); |
1299 |
1 |
assertSame(pdbe, seq.getPDBEntry("3a6s")); |
1300 |
|
|
1301 |
|
|
1302 |
1 |
seq.addPDBId(pdbe); |
1303 |
1 |
assertEquals(1, seq.getAllPDBEntries().size()); |
1304 |
1 |
assertSame(pdbe, seq.getPDBEntry("3A6S")); |
1305 |
|
|
1306 |
|
|
1307 |
1 |
seq.addPDBId(new PDBEntry("3A6S", null, null, null)); |
1308 |
1 |
assertEquals(1, seq.getAllPDBEntries().size()); |
1309 |
1 |
assertSame(pdbe, seq.getPDBEntry("3A6S")); |
1310 |
|
|
1311 |
|
|
1312 |
1 |
PDBEntry pdbe2 = new PDBEntry("1A70", null, null, null); |
1313 |
1 |
seq.addPDBId(pdbe2); |
1314 |
1 |
assertEquals(2, seq.getAllPDBEntries().size()); |
1315 |
1 |
assertSame(pdbe, seq.getAllPDBEntries().get(0)); |
1316 |
1 |
assertSame(pdbe2, seq.getAllPDBEntries().get(1)); |
1317 |
|
|
1318 |
|
|
1319 |
1 |
PDBEntry pdbe3 = new PDBEntry("3a6s", "A", Type.PDB, "filepath"); |
1320 |
1 |
seq.addPDBId(pdbe3); |
1321 |
1 |
assertEquals(2, seq.getAllPDBEntries().size()); |
1322 |
1 |
assertSame(pdbe, seq.getAllPDBEntries().get(0)); |
1323 |
1 |
assertEquals("3A6S", pdbe.getId()); |
1324 |
1 |
assertEquals("A", pdbe.getChainCode()); |
1325 |
1 |
assertEquals(Type.PDB.toString(), pdbe.getType()); |
1326 |
1 |
assertEquals("filepath", pdbe.getFile()); |
1327 |
1 |
assertSame(pdbe2, seq.getAllPDBEntries().get(1)); |
1328 |
|
|
1329 |
|
|
1330 |
1 |
PDBEntry pdbe4 = new PDBEntry("3a6s", "A", Type.PDB, "filepath2"); |
1331 |
1 |
seq.addPDBId(pdbe4); |
1332 |
1 |
assertEquals(3, seq.getAllPDBEntries().size()); |
1333 |
1 |
assertSame(pdbe4, seq.getAllPDBEntries().get(2)); |
1334 |
|
|
1335 |
|
|
1336 |
1 |
PDBEntry pdbe5 = new PDBEntry("3a6s", "B", Type.PDB, "filepath"); |
1337 |
1 |
seq.addPDBId(pdbe5); |
1338 |
1 |
assertEquals(4, seq.getAllPDBEntries().size()); |
1339 |
1 |
assertSame(pdbe5, seq.getAllPDBEntries().get(3)); |
1340 |
|
} |
1341 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1PASS
|
|
1342 |
1 |
@Test(... |
1343 |
|
groups = { "Functional" }, |
1344 |
|
expectedExceptions = { IllegalArgumentException.class }) |
1345 |
|
public void testSetDatasetSequence_toSelf() |
1346 |
|
{ |
1347 |
1 |
seq.setDatasetSequence(seq); |
1348 |
|
} |
1349 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
1PASS
|
|
1350 |
1 |
@Test(... |
1351 |
|
groups = { "Functional" }, |
1352 |
|
expectedExceptions = { IllegalArgumentException.class }) |
1353 |
|
public void testSetDatasetSequence_cascading() |
1354 |
|
{ |
1355 |
1 |
SequenceI seq2 = new Sequence("Seq2", "xyz"); |
1356 |
1 |
seq2.createDatasetSequence(); |
1357 |
1 |
seq.setDatasetSequence(seq2); |
1358 |
|
} |
1359 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (34) |
Complexity: 1 |
Complexity Density: 0.03 |
1PASS
|
|
1360 |
1 |
@Test(groups = { "Functional" })... |
1361 |
|
public void testFindFeatures() |
1362 |
|
{ |
1363 |
1 |
SequenceI sq = new Sequence("test/8-16", "-ABC--DEF--GHI--"); |
1364 |
1 |
sq.createDatasetSequence(); |
1365 |
|
|
1366 |
1 |
assertTrue(sq.findFeatures(1, 99).isEmpty()); |
1367 |
|
|
1368 |
|
|
1369 |
1 |
SequenceFeature sf0 = new SequenceFeature("Cath", "desc", 0, 0, 2f, |
1370 |
|
null); |
1371 |
1 |
sq.addSequenceFeature(sf0); |
1372 |
|
|
1373 |
1 |
SequenceFeature sfBCD = new SequenceFeature("Cath", "desc", 9, 11, 2f, |
1374 |
|
null); |
1375 |
1 |
sq.addSequenceFeature(sfBCD); |
1376 |
|
|
1377 |
1 |
SequenceFeature sfDE = new SequenceFeature("Cath", "desc", 11, 12, 2f, |
1378 |
|
null); |
1379 |
1 |
sq.addSequenceFeature(sfDE); |
1380 |
|
|
1381 |
1 |
SequenceFeature sfContactBH = new SequenceFeature("Disulphide bond", |
1382 |
|
"desc", 9, 15, 2f, null); |
1383 |
1 |
sq.addSequenceFeature(sfContactBH); |
1384 |
|
|
1385 |
1 |
SequenceFeature sfContactFG = new SequenceFeature("Disulfide Bond", |
1386 |
|
"desc", 13, 14, 2f, null); |
1387 |
1 |
sq.addSequenceFeature(sfContactFG); |
1388 |
|
|
1389 |
1 |
SequenceFeature sfI = new SequenceFeature("Disulfide Bond", |
1390 |
|
"desc", 16, 16, null); |
1391 |
1 |
sq.addSequenceFeature(sfI); |
1392 |
|
|
1393 |
|
|
1394 |
1 |
List<SequenceFeature> found = sq.findFeatures(1, 2); |
1395 |
1 |
assertTrue(found.isEmpty()); |
1396 |
|
|
1397 |
|
|
1398 |
1 |
found = sq.findFeatures(1, 6); |
1399 |
1 |
assertEquals(2, found.size()); |
1400 |
1 |
assertTrue(found.contains(sfBCD)); |
1401 |
1 |
assertTrue(found.contains(sfContactBH)); |
1402 |
|
|
1403 |
|
|
1404 |
1 |
found = sq.findFeatures(5, 6); |
1405 |
1 |
assertEquals(1, found.size()); |
1406 |
1 |
assertTrue(found.contains(sfBCD)); |
1407 |
|
|
1408 |
|
|
1409 |
1 |
found = sq.findFeatures(7, 10); |
1410 |
1 |
assertEquals(3, found.size()); |
1411 |
1 |
assertTrue(found.contains(sfBCD)); |
1412 |
1 |
assertTrue(found.contains(sfDE)); |
1413 |
1 |
assertTrue(found.contains(sfContactFG)); |
1414 |
|
|
1415 |
|
|
1416 |
1 |
found = sq.findFeatures(10, 11); |
1417 |
1 |
assertEquals(0, found.size()); |
1418 |
|
|
1419 |
|
|
1420 |
1 |
found = sq.findFeatures(14, 14); |
1421 |
1 |
assertEquals(1, found.size()); |
1422 |
1 |
assertTrue(found.contains(sfI)); |
1423 |
|
} |
1424 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (38) |
Complexity: 1 |
Complexity Density: 0.03 |
1PASS
|
|
1425 |
1 |
@Test(groups = { "Functional" })... |
1426 |
|
public void testFindIndex_withCursor() |
1427 |
|
{ |
1428 |
1 |
Sequence sq = new Sequence("test/8-13", "-A--BCD-EF--"); |
1429 |
|
|
1430 |
|
|
1431 |
1 |
assertEquals(10, sq.findIndex(13, new SequenceCursor(sq, 8, 2, 0))); |
1432 |
1 |
SequenceCursor cursor = (SequenceCursor) PA.getValue(sq, "cursor"); |
1433 |
1 |
assertEquals(13, cursor.residuePosition); |
1434 |
1 |
assertEquals(10, cursor.columnPosition); |
1435 |
|
|
1436 |
|
|
1437 |
1 |
assertEquals(2, sq.findIndex(8, new SequenceCursor(sq, 13, 10, 0))); |
1438 |
1 |
cursor = (SequenceCursor) PA.getValue(sq, "cursor"); |
1439 |
1 |
assertEquals(8, cursor.residuePosition); |
1440 |
1 |
assertEquals(2, cursor.columnPosition); |
1441 |
|
|
1442 |
|
|
1443 |
1 |
assertEquals(6, sq.findIndex(10, new SequenceCursor(sq, 10, 6, 0))); |
1444 |
1 |
SequenceCursor cursor2 = (SequenceCursor) PA.getValue(sq, "cursor"); |
1445 |
1 |
assertSame(cursor2, cursor); |
1446 |
|
|
1447 |
|
|
1448 |
|
|
1449 |
|
|
1450 |
|
|
1451 |
|
|
1452 |
1 |
sq = new Sequence("test/8-99", "-A--B-C-D-E-F--"); |
1453 |
1 |
assertEquals(7, sq.findIndex(10)); |
1454 |
1 |
cursor = (SequenceCursor) PA.getValue(sq, "cursor"); |
1455 |
1 |
assertEquals(10, cursor.residuePosition); |
1456 |
1 |
assertEquals(7, cursor.columnPosition); |
1457 |
1 |
assertEquals(sq.getLength(), sq.findIndex(65)); |
1458 |
1 |
cursor2 = (SequenceCursor) PA.getValue(sq, "cursor"); |
1459 |
1 |
assertSame(cursor, cursor2); |
1460 |
|
|
1461 |
1 |
sq = new Sequence("test/8-99", "-A--B-C-D-E-F"); |
1462 |
1 |
sq.findIndex(10); |
1463 |
1 |
cursor = (SequenceCursor) PA.getValue(sq, "cursor"); |
1464 |
1 |
assertEquals(sq.getLength(), sq.findIndex(65)); |
1465 |
1 |
cursor2 = (SequenceCursor) PA.getValue(sq, "cursor"); |
1466 |
1 |
assertSame(cursor, cursor2); |
1467 |
|
|
1468 |
|
|
1469 |
|
|
1470 |
|
|
1471 |
|
|
1472 |
1 |
sq = new Sequence("test/8-15", "-A-B-C-"); |
1473 |
1 |
sq.findIndex(10); |
1474 |
1 |
cursor = (SequenceCursor) PA.getValue(sq, "cursor"); |
1475 |
1 |
assertEquals(0, sq.findIndex(3)); |
1476 |
1 |
cursor2 = (SequenceCursor) PA.getValue(sq, "cursor"); |
1477 |
1 |
assertSame(cursor, cursor2); |
1478 |
|
|
1479 |
1 |
sq = new Sequence("test/8-15", "A-B-C-"); |
1480 |
1 |
sq.findIndex(10); |
1481 |
1 |
cursor = (SequenceCursor) PA.getValue(sq, "cursor"); |
1482 |
1 |
assertEquals(0, sq.findIndex(2)); |
1483 |
1 |
cursor2 = (SequenceCursor) PA.getValue(sq, "cursor"); |
1484 |
1 |
assertSame(cursor, cursor2); |
1485 |
|
} |
1486 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (21) |
Complexity: 1 |
Complexity Density: 0.05 |
1PASS
|
|
1487 |
1 |
@Test(groups = { "Functional" })... |
1488 |
|
public void testFindPosition_withCursor() |
1489 |
|
{ |
1490 |
1 |
Sequence sq = new Sequence("test/8-13", "-A--BCD-EF--"); |
1491 |
|
|
1492 |
|
|
1493 |
1 |
assertEquals(13, sq.findPosition(10, new SequenceCursor(sq, 8, 2, 0))); |
1494 |
1 |
assertEquals("test:Pos13:Col10:startCol0:endCol10:tok0", |
1495 |
|
PA.getValue(sq, "cursor").toString()); |
1496 |
|
|
1497 |
|
|
1498 |
1 |
assertEquals(8, sq.findPosition(2, new SequenceCursor(sq, 13, 10, 0))); |
1499 |
1 |
assertEquals("test:Pos8:Col2:startCol2:endCol10:tok0", |
1500 |
|
PA.getValue(sq, "cursor").toString()); |
1501 |
|
|
1502 |
|
|
1503 |
1 |
assertEquals(10, sq.findPosition(6, new SequenceCursor(sq, 10, 6, 0))); |
1504 |
1 |
assertEquals("test:Pos10:Col6:startCol0:endCol0:tok0", |
1505 |
|
PA.getValue(sq, "cursor").toString()); |
1506 |
|
|
1507 |
|
|
1508 |
|
|
1509 |
|
|
1510 |
|
|
1511 |
1 |
assertEquals(9, sq.findPosition(3, new SequenceCursor(sq, 11, 7, 0))); |
1512 |
1 |
assertEquals("test:Pos9:Col5:startCol0:endCol0:tok0", |
1513 |
|
PA.getValue(sq, "cursor").toString()); |
1514 |
|
|
1515 |
|
|
1516 |
|
|
1517 |
1 |
assertEquals(12, sq.findPosition(8, new SequenceCursor(sq, 11, 7, 0))); |
1518 |
1 |
assertEquals("test:Pos11:Col7:startCol0:endCol0:tok0", |
1519 |
|
PA.getValue(sq, "cursor").toString()); |
1520 |
|
|
1521 |
|
|
1522 |
|
|
1523 |
|
|
1524 |
1 |
assertEquals(14, sq.findPosition(12, new SequenceCursor(sq, 9, 5, 0))); |
1525 |
1 |
assertEquals("test:Pos13:Col10:startCol0:endCol10:tok0", |
1526 |
|
PA.getValue(sq, "cursor").toString()); |
1527 |
|
|
1528 |
|
|
1529 |
|
|
1530 |
|
|
1531 |
|
|
1532 |
|
|
1533 |
1 |
assertEquals(14, sq.findPosition(99, new SequenceCursor(sq, 8, 2, 0))); |
1534 |
1 |
assertEquals("test:Pos13:Col10:startCol0:endCol10:tok0", |
1535 |
|
PA.getValue(sq, "cursor").toString()); |
1536 |
|
|
1537 |
|
|
1538 |
|
|
1539 |
|
|
1540 |
1 |
sq = new Sequence("test/8-13", "-A--BCD-EF"); |
1541 |
|
|
1542 |
1 |
assertEquals(10, sq.findPosition(6, new SequenceCursor(sq, 8, 2, 0))); |
1543 |
1 |
SequenceCursor cursor = (SequenceCursor) PA.getValue(sq, "cursor"); |
1544 |
1 |
assertEquals("test:Pos10:Col6:startCol0:endCol0:tok0", |
1545 |
|
cursor.toString()); |
1546 |
|
|
1547 |
|
|
1548 |
1 |
assertEquals(14, sq.findPosition(99, cursor)); |
1549 |
1 |
assertEquals("test:Pos13:Col10:startCol0:endCol10:tok0", |
1550 |
|
PA.getValue(sq, "cursor").toString()); |
1551 |
|
} |
1552 |
|
|
|
|
| 0% |
Uncovered Elements: 21 (21) |
Complexity: 1 |
Complexity Density: 0.05 |
1PASS
|
|
1553 |
0 |
@Test... |
1554 |
|
public void testIsValidCursor() |
1555 |
|
{ |
1556 |
0 |
Sequence sq = new Sequence("Seq", "ABC--DE-F", 8, 13); |
1557 |
0 |
assertFalse(sq.isValidCursor(null)); |
1558 |
|
|
1559 |
|
|
1560 |
|
|
1561 |
|
|
1562 |
|
|
1563 |
0 |
int changeCount = (int) PA.getValue(sq, "changeCount"); |
1564 |
0 |
SequenceCursor cursor = new SequenceCursor(sq, 13, 1, changeCount); |
1565 |
0 |
assertTrue(sq.isValidCursor(cursor)); |
1566 |
|
|
1567 |
|
|
1568 |
|
|
1569 |
|
|
1570 |
0 |
cursor = new SequenceCursor(sq, 13, -1, changeCount); |
1571 |
0 |
assertFalse(sq.isValidCursor(cursor)); |
1572 |
0 |
cursor = new SequenceCursor(sq, 13, 10, changeCount); |
1573 |
0 |
assertFalse(sq.isValidCursor(cursor)); |
1574 |
0 |
cursor = new SequenceCursor(sq, 7, 8, changeCount); |
1575 |
0 |
assertFalse(sq.isValidCursor(cursor)); |
1576 |
0 |
cursor = new SequenceCursor(sq, 14, 2, changeCount); |
1577 |
0 |
assertFalse(sq.isValidCursor(cursor)); |
1578 |
|
|
1579 |
|
|
1580 |
|
|
1581 |
|
|
1582 |
0 |
cursor = new SequenceCursor(null, 13, 1, changeCount); |
1583 |
0 |
assertFalse(sq.isValidCursor(cursor)); |
1584 |
0 |
cursor = new SequenceCursor(new Sequence("Seq", "abc"), 13, 1, |
1585 |
|
changeCount); |
1586 |
0 |
assertFalse(sq.isValidCursor(cursor)); |
1587 |
|
|
1588 |
|
|
1589 |
|
|
1590 |
|
|
1591 |
0 |
cursor = new SequenceCursor(sq, 13, 1, changeCount + 1); |
1592 |
0 |
assertFalse(sq.isValidCursor(cursor)); |
1593 |
0 |
cursor = new SequenceCursor(sq, 13, 1, changeCount - 1); |
1594 |
0 |
assertFalse(sq.isValidCursor(cursor)); |
1595 |
|
} |
1596 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (28) |
Complexity: 1 |
Complexity Density: 0.04 |
1PASS
|
|
1597 |
1 |
@Test(groups = { "Functional" })... |
1598 |
|
public void testFindPosition_withCursorAndEdits() |
1599 |
|
{ |
1600 |
1 |
Sequence sq = new Sequence("test/8-13", "-A--BCD-EF--"); |
1601 |
|
|
1602 |
|
|
1603 |
1 |
assertEquals(13, sq.findPosition(10, new SequenceCursor(sq, 8, 2, 0))); |
1604 |
1 |
int token = (int) PA.getValue(sq, "changeCount"); |
1605 |
1 |
SequenceCursor cursor = (SequenceCursor) PA.getValue(sq, "cursor"); |
1606 |
1 |
assertEquals(new SequenceCursor(sq, 13, 10, token), cursor); |
1607 |
|
|
1608 |
|
|
1609 |
|
|
1610 |
|
|
1611 |
1 |
sq.setSequence("-A-BCD-EF---"); |
1612 |
1 |
assertEquals(8, sq.getStart()); |
1613 |
1 |
assertEquals(11, sq.findPosition(5)); |
1614 |
|
|
1615 |
1 |
cursor = (SequenceCursor) PA.getValue(sq, "cursor"); |
1616 |
1 |
assertEquals(new SequenceCursor(sq, 11, 6, ++token), cursor); |
1617 |
|
|
1618 |
|
|
1619 |
|
|
1620 |
|
|
1621 |
1 |
sq.deleteChars(2, 5); |
1622 |
1 |
assertEquals("-AD-EF---", sq.getSequenceAsString()); |
1623 |
1 |
assertEquals(8, sq.getStart()); |
1624 |
1 |
assertEquals(10, sq.findPosition(4)); |
1625 |
|
|
1626 |
1 |
cursor = (SequenceCursor) PA.getValue(sq, "cursor"); |
1627 |
1 |
assertEquals(new SequenceCursor(sq, 10, 5, ++token), cursor); |
1628 |
|
|
1629 |
|
|
1630 |
|
|
1631 |
|
|
1632 |
|
|
1633 |
1 |
SequenceI[] seqs = new SequenceI[] { sq }; |
1634 |
1 |
AlignmentI al = new Alignment(seqs); |
1635 |
1 |
new EditCommand().appendEdit(Action.INSERT_GAP, seqs, 3, 2, al, true); |
1636 |
1 |
assertEquals("-AD---EF---", sq.getSequenceAsString()); |
1637 |
1 |
assertEquals(10, sq.findPosition(4)); |
1638 |
|
|
1639 |
1 |
cursor = (SequenceCursor) PA.getValue(sq, "cursor"); |
1640 |
1 |
assertEquals(new SequenceCursor(sq, 9, 3, ++token), cursor); |
1641 |
|
|
1642 |
|
|
1643 |
|
|
1644 |
|
|
1645 |
|
|
1646 |
1 |
sq.insertCharAt(4, 2, 'C'); |
1647 |
1 |
assertEquals("-AD-CC--EF---", sq.getSequenceAsString()); |
1648 |
1 |
assertEquals(13, sq.findPosition(9)); |
1649 |
|
|
1650 |
1 |
cursor = (SequenceCursor) PA.getValue(sq, "cursor"); |
1651 |
1 |
assertEquals(new SequenceCursor(sq, 13, 10, ++token), cursor); |
1652 |
|
} |
1653 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 1 |
Complexity Density: 0.11 |
1PASS
|
|
1654 |
1 |
@Test(groups = { "Functional" })... |
1655 |
|
public void testGetSequence() |
1656 |
|
{ |
1657 |
1 |
String seqstring = "-A--BCD-EF--"; |
1658 |
1 |
Sequence sq = new Sequence("test/8-13", seqstring); |
1659 |
1 |
sq.createDatasetSequence(); |
1660 |
1 |
assertTrue(Arrays.equals(sq.getSequence(), seqstring.toCharArray())); |
1661 |
1 |
assertTrue(Arrays.equals(sq.getDatasetSequence().getSequence(), |
1662 |
|
"ABCDEF".toCharArray())); |
1663 |
|
|
1664 |
|
|
1665 |
1 |
char[] theSeq = (char[]) PA.getValue(sq, "sequence"); |
1666 |
1 |
assertNotSame(theSeq, sq.getSequence()); |
1667 |
1 |
theSeq = (char[]) PA.getValue(sq.getDatasetSequence(), "sequence"); |
1668 |
1 |
assertNotSame(theSeq, sq.getDatasetSequence().getSequence()); |
1669 |
|
} |
1670 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (15) |
Complexity: 1 |
Complexity Density: 0.07 |
1PASS
|
|
1671 |
1 |
@Test(groups = { "Functional" })... |
1672 |
|
public void testReplace() |
1673 |
|
{ |
1674 |
1 |
String seqstring = "-A--BCD-EF--"; |
1675 |
1 |
SequenceI sq = new Sequence("test/8-13", seqstring); |
1676 |
1 |
assertEquals(0, PA.getValue(sq, "changeCount")); |
1677 |
|
|
1678 |
1 |
assertEquals(0, sq.replace('A', 'A')); |
1679 |
1 |
assertEquals(seqstring, sq.getSequenceAsString()); |
1680 |
1 |
assertEquals(0, PA.getValue(sq, "changeCount")); |
1681 |
|
|
1682 |
1 |
assertEquals(0, sq.replace('X', 'Y')); |
1683 |
1 |
assertEquals(seqstring, sq.getSequenceAsString()); |
1684 |
1 |
assertEquals(0, PA.getValue(sq, "changeCount")); |
1685 |
|
|
1686 |
1 |
assertEquals(1, sq.replace('A', 'K')); |
1687 |
1 |
assertEquals("-K--BCD-EF--", sq.getSequenceAsString()); |
1688 |
1 |
assertEquals(1, PA.getValue(sq, "changeCount")); |
1689 |
|
|
1690 |
1 |
assertEquals(6, sq.replace('-', '.')); |
1691 |
1 |
assertEquals(".K..BCD.EF..", sq.getSequenceAsString()); |
1692 |
1 |
assertEquals(2, PA.getValue(sq, "changeCount")); |
1693 |
|
} |
1694 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (22) |
Complexity: 1 |
Complexity Density: 0.05 |
1PASS
|
|
1695 |
1 |
@Test(groups = { "Functional" })... |
1696 |
|
public void testFindPositions() |
1697 |
|
{ |
1698 |
1 |
SequenceI sq = new Sequence("test/8-13", "-ABC---DE-F--"); |
1699 |
|
|
1700 |
|
|
1701 |
|
|
1702 |
|
|
1703 |
1 |
assertNull(sq.findPositions(6, 5)); |
1704 |
1 |
assertNull(sq.findPositions(0, 5)); |
1705 |
1 |
assertNull(sq.findPositions(-1, 5)); |
1706 |
|
|
1707 |
|
|
1708 |
|
|
1709 |
|
|
1710 |
1 |
assertNull(sq.findPositions(1, 1)); |
1711 |
1 |
assertNull(sq.findPositions(5, 5)); |
1712 |
1 |
assertNull(sq.findPositions(5, 6)); |
1713 |
1 |
assertNull(sq.findPositions(5, 7)); |
1714 |
|
|
1715 |
|
|
1716 |
|
|
1717 |
|
|
1718 |
1 |
assertEquals(new Range(8, 8), sq.findPositions(2, 2)); |
1719 |
1 |
assertEquals(new Range(8, 9), sq.findPositions(2, 3)); |
1720 |
1 |
assertEquals(new Range(8, 10), sq.findPositions(2, 4)); |
1721 |
1 |
assertEquals(new Range(9, 10), sq.findPositions(3, 4)); |
1722 |
|
|
1723 |
|
|
1724 |
|
|
1725 |
|
|
1726 |
1 |
assertEquals(new Range(8, 10), sq.findPositions(1, 4)); |
1727 |
1 |
assertEquals(new Range(11, 12), sq.findPositions(6, 9)); |
1728 |
|
|
1729 |
|
|
1730 |
|
|
1731 |
|
|
1732 |
1 |
assertEquals(new Range(10, 10), sq.findPositions(4, 5)); |
1733 |
1 |
assertEquals(new Range(9, 13), sq.findPositions(3, 11)); |
1734 |
|
|
1735 |
|
|
1736 |
|
|
1737 |
|
|
1738 |
1 |
assertEquals(new Range(10, 11), sq.findPositions(4, 8)); |
1739 |
1 |
assertEquals(new Range(8, 13), sq.findPositions(2, 11)); |
1740 |
|
|
1741 |
|
|
1742 |
|
|
1743 |
|
|
1744 |
1 |
assertEquals(new Range(8, 10), sq.findPositions(1, 5)); |
1745 |
1 |
assertEquals(new Range(11, 12), sq.findPositions(5, 10)); |
1746 |
1 |
assertEquals(new Range(8, 13), sq.findPositions(1, 13)); |
1747 |
1 |
assertEquals(new Range(8, 13), sq.findPositions(1, 99)); |
1748 |
|
} |
1749 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 1 |
Complexity Density: 0.12 |
1PASS
|
|
1750 |
1 |
@Test(groups = { "Functional" })... |
1751 |
|
public void testGapBitset() |
1752 |
|
{ |
1753 |
1 |
SequenceI sq = new Sequence("test/8-13", "-ABC---DE-F--"); |
1754 |
1 |
BitSet bs = sq.gapBitset(); |
1755 |
1 |
BitSet expected = new BitSet(); |
1756 |
1 |
expected.set(0); |
1757 |
1 |
expected.set(4, 7); |
1758 |
1 |
expected.set(9); |
1759 |
1 |
expected.set(11, 13); |
1760 |
|
|
1761 |
1 |
assertTrue(bs.equals(expected)); |
1762 |
|
|
1763 |
|
} |
1764 |
|
|
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 1 |
Complexity Density: 0.08 |
1PASS
|
|
1765 |
0 |
public void testFindFeatures_largeEndPos()... |
1766 |
|
{ |
1767 |
|
|
1768 |
|
|
1769 |
|
|
1770 |
0 |
SequenceI sq = new Sequence("test", "-ABC--DEF--", 1, 20); |
1771 |
0 |
sq.createDatasetSequence(); |
1772 |
|
|
1773 |
0 |
assertTrue(sq.findFeatures(1, 9).isEmpty()); |
1774 |
|
|
1775 |
0 |
assertTrue(sq.findFeatures(1, 15).isEmpty()); |
1776 |
|
|
1777 |
|
|
1778 |
0 |
SequenceFeature sfBCD = new SequenceFeature("Cath", "desc", 2, 4, 2f, |
1779 |
|
null); |
1780 |
0 |
sq.addSequenceFeature(sfBCD); |
1781 |
|
|
1782 |
|
|
1783 |
0 |
List<SequenceFeature> found = sq.findFeatures(1, 2); |
1784 |
0 |
assertTrue(found.isEmpty()); |
1785 |
|
|
1786 |
|
|
1787 |
0 |
found = sq.findFeatures(1, 6); |
1788 |
0 |
assertEquals(1, found.size()); |
1789 |
0 |
assertTrue(found.contains(sfBCD)); |
1790 |
|
|
1791 |
|
|
1792 |
0 |
found = sq.findFeatures(10, 11); |
1793 |
0 |
assertEquals(0, found.size()); |
1794 |
|
} |
1795 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (58) |
Complexity: 1 |
Complexity Density: 0.02 |
1PASS
|
|
1796 |
1 |
@Test(groups = { "Functional" })... |
1797 |
|
public void testSetName() |
1798 |
|
{ |
1799 |
1 |
SequenceI sq = new Sequence("test", "-ABC---DE-F--"); |
1800 |
1 |
assertEquals("test", sq.getName()); |
1801 |
1 |
assertEquals(1, sq.getStart()); |
1802 |
1 |
assertEquals(6, sq.getEnd()); |
1803 |
|
|
1804 |
1 |
sq.setName("testing"); |
1805 |
1 |
assertEquals("testing", sq.getName()); |
1806 |
|
|
1807 |
1 |
sq.setName("test/8-10"); |
1808 |
1 |
assertEquals("test", sq.getName()); |
1809 |
1 |
assertEquals(8, sq.getStart()); |
1810 |
1 |
assertEquals(13, sq.getEnd()); |
1811 |
|
|
1812 |
1 |
sq.setName("testing/7-99"); |
1813 |
1 |
assertEquals("testing", sq.getName()); |
1814 |
1 |
assertEquals(7, sq.getStart()); |
1815 |
1 |
assertEquals(99, sq.getEnd()); |
1816 |
|
|
1817 |
1 |
sq.setName("/2-3"); |
1818 |
1 |
assertEquals("", sq.getName()); |
1819 |
1 |
assertEquals(2, sq.getStart()); |
1820 |
1 |
assertEquals(7, sq.getEnd()); |
1821 |
|
|
1822 |
1 |
sq.setName("test/"); |
1823 |
1 |
assertEquals("test/", sq.getName()); |
1824 |
1 |
assertEquals(2, sq.getStart()); |
1825 |
1 |
assertEquals(7, sq.getEnd()); |
1826 |
|
|
1827 |
1 |
sq.setName("test/6-13/7-99"); |
1828 |
1 |
assertEquals("test/6-13", sq.getName()); |
1829 |
1 |
assertEquals(7, sq.getStart()); |
1830 |
1 |
assertEquals(99, sq.getEnd()); |
1831 |
|
|
1832 |
1 |
sq.setName("test/0-5"); |
1833 |
1 |
assertEquals("test/0-5", sq.getName()); |
1834 |
1 |
assertEquals(7, sq.getStart()); |
1835 |
1 |
assertEquals(99, sq.getEnd()); |
1836 |
|
|
1837 |
1 |
sq.setName("test/a-5"); |
1838 |
1 |
assertEquals("test/a-5", sq.getName()); |
1839 |
1 |
assertEquals(7, sq.getStart()); |
1840 |
1 |
assertEquals(99, sq.getEnd()); |
1841 |
|
|
1842 |
1 |
sq.setName("test/6-5"); |
1843 |
1 |
assertEquals("test/6-5", sq.getName()); |
1844 |
1 |
assertEquals(7, sq.getStart()); |
1845 |
1 |
assertEquals(99, sq.getEnd()); |
1846 |
|
|
1847 |
1 |
sq.setName("test/5"); |
1848 |
1 |
assertEquals("test/5", sq.getName()); |
1849 |
1 |
assertEquals(7, sq.getStart()); |
1850 |
1 |
assertEquals(99, sq.getEnd()); |
1851 |
|
|
1852 |
1 |
sq.setName("test/-5"); |
1853 |
1 |
assertEquals("test/-5", sq.getName()); |
1854 |
1 |
assertEquals(7, sq.getStart()); |
1855 |
1 |
assertEquals(99, sq.getEnd()); |
1856 |
|
|
1857 |
1 |
sq.setName("test/5-"); |
1858 |
1 |
assertEquals("test/5-", sq.getName()); |
1859 |
1 |
assertEquals(7, sq.getStart()); |
1860 |
1 |
assertEquals(99, sq.getEnd()); |
1861 |
|
|
1862 |
1 |
sq.setName("test/5-6-7"); |
1863 |
1 |
assertEquals("test/5-6-7", sq.getName()); |
1864 |
1 |
assertEquals(7, sq.getStart()); |
1865 |
1 |
assertEquals(99, sq.getEnd()); |
1866 |
|
|
1867 |
1 |
sq.setName(null); |
1868 |
1 |
assertEquals("", sq.getName()); |
1869 |
1 |
assertEquals(7, sq.getStart()); |
1870 |
1 |
assertEquals(99, sq.getEnd()); |
1871 |
|
} |
1872 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 1 |
Complexity Density: 0.11 |
1PASS
|
|
1873 |
1 |
@Test(groups = { "Functional" })... |
1874 |
|
public void testCheckValidRange() |
1875 |
|
{ |
1876 |
1 |
Sequence sq = new Sequence("test/7-12", "-ABC---DE-F--"); |
1877 |
1 |
assertEquals(7, sq.getStart()); |
1878 |
1 |
assertEquals(12, sq.getEnd()); |
1879 |
|
|
1880 |
|
|
1881 |
|
|
1882 |
|
|
1883 |
1 |
PA.setValue(sq, "end", 2); |
1884 |
1 |
sq.checkValidRange(); |
1885 |
1 |
assertEquals(12, sq.getEnd()); |
1886 |
|
|
1887 |
|
|
1888 |
|
|
1889 |
|
|
1890 |
1 |
PA.setValue(sq, "end", 22); |
1891 |
1 |
sq.checkValidRange(); |
1892 |
1 |
assertEquals(22, sq.getEnd()); |
1893 |
|
} |
1894 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (49) |
Complexity: 1 |
Complexity Density: 0.02 |
1PASS
|
|
1895 |
1 |
@Test(groups = { "Functional" })... |
1896 |
|
public void testDeleteChars_withGaps() |
1897 |
|
{ |
1898 |
|
|
1899 |
|
|
1900 |
|
|
1901 |
1 |
SequenceI sq = new Sequence("test/8-10", "A-B-C"); |
1902 |
1 |
sq.createDatasetSequence(); |
1903 |
1 |
assertEquals("ABC", sq.getDatasetSequence().getSequenceAsString()); |
1904 |
1 |
sq.deleteChars(1, 2); |
1905 |
1 |
assertEquals("AB-C", sq.getSequenceAsString()); |
1906 |
1 |
assertEquals(8, sq.getStart()); |
1907 |
1 |
assertEquals(10, sq.getEnd()); |
1908 |
1 |
assertEquals("ABC", sq.getDatasetSequence().getSequenceAsString()); |
1909 |
|
|
1910 |
|
|
1911 |
|
|
1912 |
|
|
1913 |
1 |
sq = new Sequence("test/8-10", "A-B-C"); |
1914 |
1 |
sq.createDatasetSequence(); |
1915 |
1 |
sq.deleteChars(0, 3); |
1916 |
1 |
assertEquals("-C", sq.getSequenceAsString()); |
1917 |
1 |
assertEquals(10, sq.getStart()); |
1918 |
1 |
assertEquals(10, sq.getEnd()); |
1919 |
1 |
assertEquals("ABC", sq.getDatasetSequence().getSequenceAsString()); |
1920 |
|
|
1921 |
|
|
1922 |
|
|
1923 |
|
|
1924 |
1 |
sq = new Sequence("test/8-10", "A-B-C"); |
1925 |
1 |
sq.createDatasetSequence(); |
1926 |
1 |
sq.deleteChars(2, 5); |
1927 |
1 |
assertEquals("A-", sq.getSequenceAsString()); |
1928 |
1 |
assertEquals(8, sq.getStart()); |
1929 |
1 |
assertEquals(8, sq.getEnd()); |
1930 |
1 |
assertEquals("ABC", sq.getDatasetSequence().getSequenceAsString()); |
1931 |
|
|
1932 |
|
|
1933 |
|
|
1934 |
|
|
1935 |
|
|
1936 |
1 |
sq = new Sequence("test/8-10", "A-B-C"); |
1937 |
1 |
sq.createDatasetSequence(); |
1938 |
1 |
sq.deleteChars(1, 3); |
1939 |
1 |
assertEquals("A-C", sq.getSequenceAsString()); |
1940 |
1 |
assertEquals(8, sq.getStart()); |
1941 |
1 |
assertEquals(9, sq.getEnd()); |
1942 |
1 |
assertEquals("AC", sq.getDatasetSequence().getSequenceAsString()); |
1943 |
1 |
assertEquals(8, sq.getDatasetSequence().getStart()); |
1944 |
1 |
assertEquals(9, sq.getDatasetSequence().getEnd()); |
1945 |
|
|
1946 |
|
|
1947 |
|
|
1948 |
|
|
1949 |
1 |
sq = new Sequence("test/8-10", "A-B-C"); |
1950 |
1 |
sq.createDatasetSequence(); |
1951 |
1 |
sq.deleteChars(1, 4); |
1952 |
1 |
assertEquals("AC", sq.getSequenceAsString()); |
1953 |
1 |
assertEquals(8, sq.getStart()); |
1954 |
1 |
assertEquals(9, sq.getEnd()); |
1955 |
1 |
assertEquals("AC", sq.getDatasetSequence().getSequenceAsString()); |
1956 |
1 |
assertEquals(8, sq.getDatasetSequence().getStart()); |
1957 |
1 |
assertEquals(9, sq.getDatasetSequence().getEnd()); |
1958 |
|
|
1959 |
|
|
1960 |
|
|
1961 |
|
|
1962 |
1 |
sq = new Sequence("test/8-10", "A-B-C"); |
1963 |
1 |
sq.createDatasetSequence(); |
1964 |
1 |
sq.deleteChars(2, 3); |
1965 |
1 |
assertEquals("A--C", sq.getSequenceAsString()); |
1966 |
1 |
assertEquals(8, sq.getStart()); |
1967 |
1 |
assertEquals(9, sq.getEnd()); |
1968 |
1 |
assertEquals("AC", sq.getDatasetSequence().getSequenceAsString()); |
1969 |
1 |
assertEquals(8, sq.getDatasetSequence().getStart()); |
1970 |
1 |
assertEquals(9, sq.getDatasetSequence().getEnd()); |
1971 |
|
} |
1972 |
|
|
1973 |
|
|
1974 |
|
|
1975 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (102) |
Complexity: 1 |
Complexity Density: 0.01 |
1PASS
|
|
1976 |
1 |
@Test(groups = { "Functional" })... |
1977 |
|
public void testLocateVisibleStartofSequence() |
1978 |
|
{ |
1979 |
|
|
1980 |
1 |
AlignmentGenerator gen = new AlignmentGenerator(false); |
1981 |
1 |
AlignmentI al = gen.generate(50, 20, 123, 5, 5); |
1982 |
|
|
1983 |
1 |
HiddenColumns cs = al.getHiddenColumns(); |
1984 |
1 |
ColumnSelection colsel = new ColumnSelection(); |
1985 |
|
|
1986 |
1 |
SequenceI seq = new Sequence("RefSeq", "-A-SD-ASD--E---"); |
1987 |
1 |
assertEquals(2, seq.findIndex(seq.getStart())); |
1988 |
|
|
1989 |
|
|
1990 |
1 |
assertEquals(seq.findIndex(seq.getStart()) - 1, |
1991 |
|
seq.firstResidueOutsideIterator(cs.iterator())); |
1992 |
|
|
1993 |
|
|
1994 |
1 |
colsel.hideSelectedColumns(13, al.getHiddenColumns()); |
1995 |
1 |
assertEquals(seq.findIndex(seq.getStart()) - 1, |
1996 |
|
seq.firstResidueOutsideIterator(cs.iterator())); |
1997 |
|
|
1998 |
1 |
cs.revealAllHiddenColumns(colsel); |
1999 |
|
|
2000 |
|
|
2001 |
1 |
colsel.hideSelectedColumns(0, al.getHiddenColumns()); |
2002 |
1 |
assertEquals(seq.findIndex(seq.getStart()) - 2, |
2003 |
|
cs.absoluteToVisibleColumn( |
2004 |
|
seq.firstResidueOutsideIterator(cs.iterator()))); |
2005 |
|
|
2006 |
1 |
cs.revealAllHiddenColumns(colsel); |
2007 |
|
|
2008 |
1 |
cs.hideColumns(1, 3); |
2009 |
1 |
cs.hideColumns(6, 11); |
2010 |
|
|
2011 |
1 |
Iterator<int[]> it = cs.getVisContigsIterator(0, 6, false); |
2012 |
|
|
2013 |
1 |
assertEquals("-D", seq.getSequenceStringFromIterator(it)); |
2014 |
|
|
2015 |
|
|
2016 |
|
|
2017 |
1 |
assertEquals(4, seq.firstResidueOutsideIterator(cs.iterator())); |
2018 |
1 |
cs.revealAllHiddenColumns(colsel); |
2019 |
|
|
2020 |
|
|
2021 |
|
|
2022 |
1 |
cs.hideColumns(1, 11); |
2023 |
1 |
assertEquals(0, seq.firstResidueOutsideIterator(cs.iterator())); |
2024 |
|
|
2025 |
1 |
cs.revealAllHiddenColumns(colsel); |
2026 |
1 |
cs.hideColumns(0, 15); |
2027 |
1 |
assertEquals(0, seq.firstResidueOutsideIterator(cs.iterator())); |
2028 |
|
|
2029 |
1 |
SequenceI seq2 = new Sequence("RefSeq2", "-------A-SD-ASD--E---"); |
2030 |
|
|
2031 |
1 |
cs.revealAllHiddenColumns(colsel); |
2032 |
1 |
cs.hideColumns(7, 17); |
2033 |
1 |
assertEquals(0, seq2.firstResidueOutsideIterator(cs.iterator())); |
2034 |
|
|
2035 |
1 |
cs.revealAllHiddenColumns(colsel); |
2036 |
1 |
cs.hideColumns(3, 17); |
2037 |
1 |
assertEquals(0, seq2.firstResidueOutsideIterator(cs.iterator())); |
2038 |
|
|
2039 |
1 |
cs.revealAllHiddenColumns(colsel); |
2040 |
1 |
cs.hideColumns(3, 19); |
2041 |
1 |
assertEquals(0, seq2.firstResidueOutsideIterator(cs.iterator())); |
2042 |
|
|
2043 |
1 |
cs.revealAllHiddenColumns(colsel); |
2044 |
1 |
cs.hideColumns(0, 0); |
2045 |
1 |
assertEquals(1, seq.firstResidueOutsideIterator(cs.iterator())); |
2046 |
|
|
2047 |
1 |
cs.revealAllHiddenColumns(colsel); |
2048 |
1 |
cs.hideColumns(0, 1); |
2049 |
1 |
assertEquals(3, seq.firstResidueOutsideIterator(cs.iterator())); |
2050 |
|
|
2051 |
1 |
cs.revealAllHiddenColumns(colsel); |
2052 |
1 |
cs.hideColumns(0, 2); |
2053 |
1 |
assertEquals(3, seq.firstResidueOutsideIterator(cs.iterator())); |
2054 |
|
|
2055 |
1 |
cs.revealAllHiddenColumns(colsel); |
2056 |
1 |
cs.hideColumns(1, 1); |
2057 |
1 |
assertEquals(3, seq.firstResidueOutsideIterator(cs.iterator())); |
2058 |
|
|
2059 |
1 |
cs.revealAllHiddenColumns(colsel); |
2060 |
1 |
cs.hideColumns(1, 2); |
2061 |
1 |
assertEquals(3, seq.firstResidueOutsideIterator(cs.iterator())); |
2062 |
|
|
2063 |
1 |
cs.revealAllHiddenColumns(colsel); |
2064 |
1 |
cs.hideColumns(1, 3); |
2065 |
1 |
assertEquals(4, seq.firstResidueOutsideIterator(cs.iterator())); |
2066 |
|
|
2067 |
1 |
cs.revealAllHiddenColumns(colsel); |
2068 |
1 |
cs.hideColumns(0, 2); |
2069 |
1 |
cs.hideColumns(5, 6); |
2070 |
1 |
assertEquals(3, seq.firstResidueOutsideIterator(cs.iterator())); |
2071 |
|
|
2072 |
1 |
cs.revealAllHiddenColumns(colsel); |
2073 |
1 |
cs.hideColumns(0, 2); |
2074 |
1 |
cs.hideColumns(5, 6); |
2075 |
1 |
cs.hideColumns(9, 10); |
2076 |
1 |
assertEquals(3, seq.firstResidueOutsideIterator(cs.iterator())); |
2077 |
|
|
2078 |
1 |
cs.revealAllHiddenColumns(colsel); |
2079 |
1 |
cs.hideColumns(0, 2); |
2080 |
1 |
cs.hideColumns(7, 11); |
2081 |
1 |
assertEquals(3, seq.firstResidueOutsideIterator(cs.iterator())); |
2082 |
|
|
2083 |
1 |
cs.revealAllHiddenColumns(colsel); |
2084 |
1 |
cs.hideColumns(2, 4); |
2085 |
1 |
cs.hideColumns(7, 11); |
2086 |
1 |
assertEquals(1, seq.firstResidueOutsideIterator(cs.iterator())); |
2087 |
|
|
2088 |
1 |
cs.revealAllHiddenColumns(colsel); |
2089 |
1 |
cs.hideColumns(2, 4); |
2090 |
1 |
cs.hideColumns(7, 12); |
2091 |
1 |
assertEquals(1, seq.firstResidueOutsideIterator(cs.iterator())); |
2092 |
|
|
2093 |
1 |
cs.revealAllHiddenColumns(colsel); |
2094 |
1 |
cs.hideColumns(1, 11); |
2095 |
1 |
assertEquals(0, seq.firstResidueOutsideIterator(cs.iterator())); |
2096 |
|
|
2097 |
1 |
cs.revealAllHiddenColumns(colsel); |
2098 |
1 |
cs.hideColumns(0, 12); |
2099 |
1 |
assertEquals(0, seq.firstResidueOutsideIterator(cs.iterator())); |
2100 |
|
|
2101 |
1 |
cs.revealAllHiddenColumns(colsel); |
2102 |
1 |
cs.hideColumns(0, 4); |
2103 |
1 |
cs.hideColumns(6, 12); |
2104 |
1 |
assertEquals(0, seq.firstResidueOutsideIterator(cs.iterator())); |
2105 |
|
|
2106 |
1 |
cs.revealAllHiddenColumns(colsel); |
2107 |
1 |
cs.hideColumns(0, 1); |
2108 |
1 |
cs.hideColumns(3, 12); |
2109 |
1 |
assertEquals(0, seq.firstResidueOutsideIterator(cs.iterator())); |
2110 |
|
|
2111 |
1 |
cs.revealAllHiddenColumns(colsel); |
2112 |
1 |
cs.hideColumns(3, 14); |
2113 |
1 |
cs.hideColumns(17, 19); |
2114 |
1 |
assertEquals(0, seq2.firstResidueOutsideIterator(cs.iterator())); |
2115 |
|
|
2116 |
1 |
cs.revealAllHiddenColumns(colsel); |
2117 |
1 |
cs.hideColumns(3, 7); |
2118 |
1 |
cs.hideColumns(9, 14); |
2119 |
1 |
cs.hideColumns(17, 19); |
2120 |
1 |
assertEquals(0, seq2.firstResidueOutsideIterator(cs.iterator())); |
2121 |
|
|
2122 |
1 |
cs.revealAllHiddenColumns(colsel); |
2123 |
1 |
cs.hideColumns(0, 1); |
2124 |
1 |
cs.hideColumns(3, 4); |
2125 |
1 |
cs.hideColumns(6, 8); |
2126 |
1 |
cs.hideColumns(10, 12); |
2127 |
1 |
assertEquals(0, seq.firstResidueOutsideIterator(cs.iterator())); |
2128 |
|
|
2129 |
|
} |
2130 |
|
} |