forked from biopython/biopython
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_Ace.py
1840 lines (1743 loc) · 115 KB
/
test_Ace.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import os
import sys
import unittest
from Bio.Sequencing import Ace
class AceTestOne(unittest.TestCase):
def setUp(self):
self.handle = open("Ace/contig1.ace")
def tearDown(self):
self.handle.close()
def test_check_ACEParser(self):
"""Test to check that ACEParser can parse the whole file into one record."""
record = Ace.read(self.handle)
self.assertEqual(record.ncontigs, 2)
self.assertEqual(record.nreads, 16)
self.assertEqual(len(record.wa), 1)
self.assertEqual(record.wa[0].tag_type, "phrap_params")
self.assertEqual(record.wa[0].program, "phrap")
self.assertEqual(record.wa[0].date, "040203:114710")
self.assertEqual(record.wa[0].info, ['phrap 304_nuclsu.fasta.screen -new_ace -retain_duplicates', 'phrap version 0.990329'])
self.assertEqual(len(record.contigs), 2)
self.assertEqual(len(record.contigs[0].reads), 2)
self.assertEqual(record.contigs[0].name, "Contig1")
self.assertEqual(record.contigs[0].nbases, 856)
self.assertEqual(record.contigs[0].nreads, 2)
self.assertEqual(record.contigs[0].nsegments, 31)
self.assertEqual(record.contigs[0].uorc, 'U')
center = len(record.contigs[0].sequence)//2
self.assertEqual(record.contigs[0].sequence[:10], "aatacgGGAT")
self.assertEqual(record.contigs[0].sequence[center-5:center+5], "ACATCATCTG")
self.assertEqual(record.contigs[0].sequence[-10:], "cATCTAGtac")
center = len(record.contigs[0].quality)//2
self.assertEqual(record.contigs[0].quality[:10], [0, 0, 0, 0, 0, 0, 22, 23, 25, 28])
self.assertEqual(record.contigs[0].quality[center-5:center+5], [90, 90, 90, 90, 90, 90, 90, 90, 90, 90])
self.assertEqual(record.contigs[0].quality[-10:], [15, 22, 30, 24, 28, 22, 21, 15, 19, 0])
self.assertEqual(len(record.contigs[0].af), 2)
self.assertEqual(record.contigs[0].af[1].name, "BL060c3-LR0R.b.ab1")
self.assertEqual(record.contigs[0].af[1].coru, "U")
self.assertEqual(record.contigs[0].af[1].padded_start, 1)
self.assertEqual(len(record.contigs[0].bs), 31)
self.assertEqual(record.contigs[0].bs[15].name, "BL060c3-LR5.g.ab1")
self.assertEqual(record.contigs[0].bs[15].padded_start, 434)
self.assertEqual(record.contigs[0].bs[15].padded_end, 438)
self.assertEqual(record.contigs[0].bs[30].name, "BL060c3-LR0R.b.ab1")
self.assertEqual(record.contigs[0].bs[30].padded_start, 823)
self.assertEqual(record.contigs[0].bs[30].padded_end, 856)
self.assertEqual(len(record.contigs[0].ct), 1)
self.assertEqual(record.contigs[0].ct[0].name, "Contig1")
self.assertEqual(record.contigs[0].ct[0].tag_type, "repeat")
self.assertEqual(record.contigs[0].ct[0].program, "phrap")
self.assertEqual(record.contigs[0].ct[0].padded_start, 52)
self.assertEqual(record.contigs[0].ct[0].padded_end, 53)
self.assertEqual(record.contigs[0].ct[0].date, "555456:555432")
self.assertEqual(record.contigs[0].ct[0].info, ['This is the forst line of comment for c1', 'and this the second for c1'])
self.assertEqual(record.contigs[0].wa, None)
self.assertEqual(len(record.contigs[0].reads), 2)
self.assertEqual(record.contigs[0].reads[0].rd.name, "BL060c3-LR5.g.ab1")
self.assertEqual(record.contigs[0].reads[0].rd.padded_bases, 868)
self.assertEqual(record.contigs[0].reads[0].rd.info_items, 0)
self.assertEqual(record.contigs[0].reads[0].rd.read_tags, 0)
center = len(record.contigs[0].reads[0].rd.sequence)//2
self.assertEqual(record.contigs[0].reads[0].rd.sequence[:10], "tagcgaggaa")
self.assertEqual(record.contigs[0].reads[0].rd.sequence[center-5:center+5], "CCGAGGCCAA")
self.assertEqual(record.contigs[0].reads[0].rd.sequence[-10:], "gaaccatcag")
self.assertEqual(record.contigs[0].reads[0].qa.qual_clipping_start, 80)
self.assertEqual(record.contigs[0].reads[0].qa.qual_clipping_end, 853)
self.assertEqual(record.contigs[0].reads[0].qa.align_clipping_start, 22)
self.assertEqual(record.contigs[0].reads[0].qa.align_clipping_end, 856)
self.assertEqual(record.contigs[0].reads[0].ds, None)
self.assertEqual(len(record.contigs[0].reads[0].rt), 4)
self.assertEqual(record.contigs[0].reads[0].rt[0].name, "BL060c3-LR5.g.ab1")
self.assertEqual(record.contigs[0].reads[0].rt[0].tag_type, "matchElsewhereHighQual")
self.assertEqual(record.contigs[0].reads[0].rt[0].program, "phrap")
self.assertEqual(record.contigs[0].reads[0].rt[0].padded_start, 590)
self.assertEqual(record.contigs[0].reads[0].rt[0].padded_end, 607)
self.assertEqual(record.contigs[0].reads[0].rt[0].date, "040217:110357")
self.assertEqual(record.contigs[0].reads[0].rt[1].name, "BL060c3-LR5.g.ab1")
self.assertEqual(record.contigs[0].reads[0].rt[1].tag_type, "matchElsewhereHighQual")
self.assertEqual(record.contigs[0].reads[0].rt[1].program, "phrap")
self.assertEqual(record.contigs[0].reads[0].rt[1].padded_start, 617)
self.assertEqual(record.contigs[0].reads[0].rt[1].padded_end, 631)
self.assertEqual(record.contigs[0].reads[0].rt[1].date, "040217:110357")
self.assertEqual(record.contigs[0].reads[0].rt[2].name, "BL060c3-LR5.g.ab1")
self.assertEqual(record.contigs[0].reads[0].rt[2].tag_type, "matchElsewhereHighQual")
self.assertEqual(record.contigs[0].reads[0].rt[2].program, "phrap")
self.assertEqual(record.contigs[0].reads[0].rt[2].padded_start, 617)
self.assertEqual(record.contigs[0].reads[0].rt[2].padded_end, 631)
self.assertEqual(record.contigs[0].reads[0].rt[2].date, "040217:110357")
self.assertEqual(record.contigs[0].reads[0].rt[3].name, "BL060c3-LR5.g.ab1")
self.assertEqual(record.contigs[0].reads[0].rt[3].tag_type, "matchElsewhereHighQual")
self.assertEqual(record.contigs[0].reads[0].rt[3].program, "phrap")
self.assertEqual(record.contigs[0].reads[0].rt[3].padded_start, 617)
self.assertEqual(record.contigs[0].reads[0].rt[3].padded_end, 631)
self.assertEqual(record.contigs[0].reads[0].rt[3].date, "040217:110357")
self.assertEqual(len(record.contigs[0].reads[0].wr), 1)
self.assertEqual(record.contigs[0].reads[0].wr[0].name, "BL060c3-LR5.g.ab1")
self.assertEqual(record.contigs[0].reads[0].wr[0].aligned, "unaligned")
self.assertEqual(record.contigs[0].reads[0].wr[0].program, "phrap")
self.assertEqual(record.contigs[0].reads[0].wr[0].date, "040217:110357")
self.assertEqual(record.contigs[0].reads[1].rd.name, "BL060c3-LR0R.b.ab1")
self.assertEqual(record.contigs[0].reads[1].rd.padded_bases, 856)
self.assertEqual(record.contigs[0].reads[1].rd.info_items, 0)
self.assertEqual(record.contigs[0].reads[1].rd.read_tags, 0)
center = len(record.contigs[0].reads[1].rd.sequence)//2
self.assertEqual(record.contigs[0].reads[1].rd.sequence[:10], "aatacgGGAT")
self.assertEqual(record.contigs[0].reads[1].rd.sequence[center-5:center+5], "ACATCATCTG")
self.assertEqual(record.contigs[0].reads[1].rd.sequence[-10:], "cATCTAGtac")
self.assertEqual(record.contigs[0].reads[1].qa.qual_clipping_start, 7)
self.assertEqual(record.contigs[0].reads[1].qa.qual_clipping_end, 778)
self.assertEqual(record.contigs[0].reads[1].qa.align_clipping_start, 1)
self.assertEqual(record.contigs[0].reads[1].qa.align_clipping_end, 856)
self.assertEqual(record.contigs[0].reads[1].ds, None)
self.assertEqual(record.contigs[0].reads[1].rt, None)
self.assertEqual(record.contigs[0].reads[1].wr, None)
self.assertEqual(len(record.contigs[1].reads), 14)
self.assertEqual(record.contigs[1].name, "Contig2")
self.assertEqual(record.contigs[1].nbases, 3296)
self.assertEqual(record.contigs[1].nreads, 14)
self.assertEqual(record.contigs[1].nsegments, 214)
self.assertEqual(record.contigs[1].uorc, 'U')
center = len(record.contigs[1].sequence) // 2
self.assertEqual(record.contigs[1].sequence[:10], "cacggatgat")
self.assertEqual(record.contigs[1].sequence[center-5:center+5], "TTTGAATATT")
self.assertEqual(record.contigs[1].sequence[-10:], "Atccttgtag")
center = len(record.contigs[1].quality) // 2
self.assertEqual(record.contigs[1].quality[:10], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
self.assertEqual(record.contigs[1].quality[center-5:center+5], [90, 90, 90, 90, 90, 90, 90, 90, 90, 90])
self.assertEqual(record.contigs[1].quality[-10:], [24, 0, 0, 0, 0, 0, 0, 0, 0, 0])
self.assertEqual(len(record.contigs[1].af), 14)
self.assertEqual(record.contigs[1].af[7].name, "BL060-LR3R.b.ab1")
self.assertEqual(record.contigs[1].af[7].coru, "C")
self.assertEqual(record.contigs[1].af[7].padded_start, 1601)
self.assertEqual(record.contigs[1].af[13].name, "BL060c2-LR0R.b.ab1")
self.assertEqual(record.contigs[1].af[13].coru, "C")
self.assertEqual(record.contigs[1].af[13].padded_start, 2445)
self.assertEqual(len(record.contigs[1].bs), 214)
self.assertEqual(record.contigs[1].bs[107].name, "BL060-c1-LR3R.b.ab1")
self.assertEqual(record.contigs[1].bs[107].padded_start, 2286)
self.assertEqual(record.contigs[1].bs[107].padded_end, 2292)
self.assertEqual(record.contigs[1].bs[213].name, "BL060c2-LR0R.b.ab1")
self.assertEqual(record.contigs[1].bs[213].padded_start, 3236)
self.assertEqual(record.contigs[1].bs[213].padded_end, 3296)
self.assertEqual(len(record.contigs[1].ct), 1)
self.assertEqual(record.contigs[1].ct[0].name, "Contig2")
self.assertEqual(record.contigs[1].ct[0].tag_type, "repeat")
self.assertEqual(record.contigs[1].ct[0].program, "phrap")
self.assertEqual(record.contigs[1].ct[0].padded_start, 42)
self.assertEqual(record.contigs[1].ct[0].padded_end, 43)
self.assertEqual(record.contigs[1].ct[0].date, "123456:765432")
self.assertEqual(record.contigs[1].ct[0].info, ['This is the forst line of comment for c2', 'and this the second for c2'])
self.assertEqual(len(record.contigs[1].wa), 1)
self.assertEqual(record.contigs[1].wa[0].tag_type, "phrap_params")
self.assertEqual(record.contigs[1].wa[0].program, "phrap")
self.assertEqual(record.contigs[1].wa[0].date, "040203:114710")
self.assertEqual(record.contigs[1].wa[0].info, ['phrap 304_nuclsu.fasta.screen -new_ace -retain_duplicates', 'phrap version 0.990329'])
self.assertEqual(len(record.contigs[1].reads), 14)
# Read 0
self.assertEqual(record.contigs[1].reads[0].rd.name, "BL060-c1-LR12.g.ab1")
self.assertEqual(record.contigs[1].reads[0].rd.padded_bases, 862)
self.assertEqual(record.contigs[1].reads[0].rd.info_items, 0)
self.assertEqual(record.contigs[1].reads[0].rd.read_tags, 0)
center = len(record.contigs[1].reads[0].rd.sequence)//2
self.assertEqual(record.contigs[1].reads[0].rd.sequence[:10], "cacggatgat")
self.assertEqual(record.contigs[1].reads[0].rd.sequence[center-5:center+5], "GTTCTCGTTG")
self.assertEqual(record.contigs[1].reads[0].rd.sequence[-10:], "CGTTTACCcg")
self.assertEqual(record.contigs[1].reads[0].qa.qual_clipping_start, 81)
self.assertEqual(record.contigs[1].reads[0].qa.qual_clipping_end, 842)
self.assertEqual(record.contigs[1].reads[0].qa.align_clipping_start, 1)
self.assertEqual(record.contigs[1].reads[0].qa.align_clipping_end, 862)
self.assertEqual(record.contigs[1].reads[0].ds.chromat_file, "BL060-c1-LR12.g.ab1")
self.assertEqual(record.contigs[1].reads[0].ds.phd_file, "BL060-c1-LR12.g.ab1.phd.1")
self.assertEqual(record.contigs[1].reads[0].ds.time, "Tue Feb 3 11:01:16 2004")
self.assertEqual(record.contigs[1].reads[0].ds.chem, "term")
self.assertEqual(record.contigs[1].reads[0].ds.dye, "big")
self.assertEqual(record.contigs[1].reads[0].ds.template, "")
self.assertEqual(record.contigs[1].reads[0].ds.direction, "")
self.assertEqual(record.contigs[1].reads[0].rt, None)
self.assertEqual(record.contigs[1].reads[0].wr, None)
# Read 1
self.assertEqual(record.contigs[1].reads[1].rd.name, "BL060-c1-LR11.g.ab1")
self.assertEqual(record.contigs[1].reads[1].rd.padded_bases, 880)
self.assertEqual(record.contigs[1].reads[1].rd.info_items, 0)
self.assertEqual(record.contigs[1].reads[1].rd.read_tags, 0)
center = len(record.contigs[1].reads[1].rd.sequence)//2
self.assertEqual(record.contigs[1].reads[1].rd.sequence[:10], "ctttctgacC")
self.assertEqual(record.contigs[1].reads[1].rd.sequence[center-5:center+5], "CTGTGGTTTC")
self.assertEqual(record.contigs[1].reads[1].rd.sequence[-10:], "cggagttacg")
self.assertEqual(record.contigs[1].reads[1].qa.qual_clipping_start, 11)
self.assertEqual(record.contigs[1].reads[1].qa.qual_clipping_end, 807)
self.assertEqual(record.contigs[1].reads[1].qa.align_clipping_start, 8)
self.assertEqual(record.contigs[1].reads[1].qa.align_clipping_end, 880)
self.assertEqual(record.contigs[1].reads[1].ds.chromat_file, "BL060-c1-LR11.g.ab1")
self.assertEqual(record.contigs[1].reads[1].ds.phd_file, "BL060-c1-LR11.g.ab1.phd.1")
self.assertEqual(record.contigs[1].reads[1].ds.time, "Tue Feb 3 11:01:16 2004")
self.assertEqual(record.contigs[1].reads[1].ds.chem, "term")
self.assertEqual(record.contigs[1].reads[1].ds.dye, "big")
self.assertEqual(record.contigs[1].reads[1].ds.template, "")
self.assertEqual(record.contigs[1].reads[1].ds.direction, "")
self.assertEqual(len(record.contigs[1].reads[1].rt), 0)
self.assertEqual(record.contigs[1].reads[1].wr, None)
# Read 2
self.assertEqual(record.contigs[1].reads[2].rd.name, "BL060-c1-LR9.g.ab1")
self.assertEqual(record.contigs[1].reads[2].rd.padded_bases, 864)
self.assertEqual(record.contigs[1].reads[2].rd.info_items, 0)
self.assertEqual(record.contigs[1].reads[2].rd.read_tags, 0)
center = len(record.contigs[1].reads[2].rd.sequence)//2
self.assertEqual(record.contigs[1].reads[2].rd.sequence[:10], "cacccaCTTT")
self.assertEqual(record.contigs[1].reads[2].rd.sequence[center-5:center+5], "ACCAAACATT")
self.assertEqual(record.contigs[1].reads[2].rd.sequence[-10:], "GGTAGCACgc")
self.assertEqual(record.contigs[1].reads[2].qa.qual_clipping_start, 7)
self.assertEqual(record.contigs[1].reads[2].qa.qual_clipping_end, 840)
self.assertEqual(record.contigs[1].reads[2].qa.align_clipping_start, 4)
self.assertEqual(record.contigs[1].reads[2].qa.align_clipping_end, 864)
self.assertEqual(record.contigs[1].reads[2].ds.chromat_file, "BL060-c1-LR9.g.ab1")
self.assertEqual(record.contigs[1].reads[2].ds.phd_file, "BL060-c1-LR9.g.ab1.phd.1")
self.assertEqual(record.contigs[1].reads[2].ds.time, "Tue Feb 3 11:01:16 2004")
self.assertEqual(record.contigs[1].reads[2].ds.chem, "term")
self.assertEqual(record.contigs[1].reads[2].ds.dye, "big")
self.assertEqual(record.contigs[1].reads[2].ds.template, "")
self.assertEqual(record.contigs[1].reads[2].ds.direction, "")
self.assertEqual(record.contigs[1].reads[2].rt, None)
self.assertEqual(record.contigs[1].reads[2].wr, None)
# Read 3
self.assertEqual(record.contigs[1].reads[3].rd.name, "BL060-c1-LR17R.b.ab1")
self.assertEqual(record.contigs[1].reads[3].rd.padded_bases, 863)
self.assertEqual(record.contigs[1].reads[3].rd.info_items, 0)
self.assertEqual(record.contigs[1].reads[3].rd.read_tags, 0)
center = len(record.contigs[1].reads[3].rd.sequence)//2
self.assertEqual(record.contigs[1].reads[3].rd.sequence[:10], "ctaattggcc")
self.assertEqual(record.contigs[1].reads[3].rd.sequence[center-5:center+5], "GGAACCTTTC")
self.assertEqual(record.contigs[1].reads[3].rd.sequence[-10:], "CAACCTgact")
self.assertEqual(record.contigs[1].reads[3].qa.qual_clipping_start, 63)
self.assertEqual(record.contigs[1].reads[3].qa.qual_clipping_end, 857)
self.assertEqual(record.contigs[1].reads[3].qa.align_clipping_start, 1)
self.assertEqual(record.contigs[1].reads[3].qa.align_clipping_end, 861)
self.assertEqual(record.contigs[1].reads[3].ds.chromat_file, "BL060-c1-LR17R.b.ab1")
self.assertEqual(record.contigs[1].reads[3].ds.phd_file, "BL060-c1-LR17R.b.ab1.phd.1")
self.assertEqual(record.contigs[1].reads[3].ds.time, "Tue Feb 3 11:01:16 2004")
self.assertEqual(record.contigs[1].reads[3].ds.chem, "term")
self.assertEqual(record.contigs[1].reads[3].ds.dye, "big")
self.assertEqual(record.contigs[1].reads[3].ds.template, "")
self.assertEqual(record.contigs[1].reads[3].ds.direction, "")
self.assertEqual(record.contigs[1].reads[3].rt, [])
self.assertEqual(record.contigs[1].reads[3].wr, None)
# Read 4
self.assertEqual(record.contigs[1].reads[4].rd.name, "BL060-LR8.5.g.ab1")
self.assertEqual(record.contigs[1].reads[4].rd.padded_bases, 877)
self.assertEqual(record.contigs[1].reads[4].rd.info_items, 0)
self.assertEqual(record.contigs[1].reads[4].rd.read_tags, 0)
center = len(record.contigs[1].reads[4].rd.sequence)//2
self.assertEqual(record.contigs[1].reads[4].rd.sequence[:10], "tgCTGCGGTT")
self.assertEqual(record.contigs[1].reads[4].rd.sequence[center-5:center+5], "GGCAGTTTCA")
self.assertEqual(record.contigs[1].reads[4].rd.sequence[-10:], "tactcataaa")
self.assertEqual(record.contigs[1].reads[4].qa.qual_clipping_start, 13)
self.assertEqual(record.contigs[1].reads[4].qa.qual_clipping_end, 729)
self.assertEqual(record.contigs[1].reads[4].qa.align_clipping_start, 1)
self.assertEqual(record.contigs[1].reads[4].qa.align_clipping_end, 877)
self.assertEqual(record.contigs[1].reads[4].ds.chromat_file, "BL060-LR8.5.g.ab1")
self.assertEqual(record.contigs[1].reads[4].ds.phd_file, "BL060-LR8.5.g.ab1.phd.1")
self.assertEqual(record.contigs[1].reads[4].ds.time, "Fri Nov 14 09:46:03 2003")
self.assertEqual(record.contigs[1].reads[4].ds.chem, "term")
self.assertEqual(record.contigs[1].reads[4].ds.dye, "big")
self.assertEqual(record.contigs[1].reads[4].ds.template, "")
self.assertEqual(record.contigs[1].reads[4].ds.direction, "")
self.assertEqual(record.contigs[1].reads[4].rt, None)
self.assertEqual(record.contigs[1].reads[4].wr, None)
# Read 5
self.assertEqual(record.contigs[1].reads[5].rd.name, "BL060-LR3R.b.ab1")
self.assertEqual(record.contigs[1].reads[5].rd.padded_bases, 874)
self.assertEqual(record.contigs[1].reads[5].rd.info_items, 0)
self.assertEqual(record.contigs[1].reads[5].rd.read_tags, 0)
center = len(record.contigs[1].reads[5].rd.sequence)//2
self.assertEqual(record.contigs[1].reads[5].rd.sequence[:10], "ctCTTAGGAT")
self.assertEqual(record.contigs[1].reads[5].rd.sequence[center-5:center+5], "AACTCACATT")
self.assertEqual(record.contigs[1].reads[5].rd.sequence[-10:], "*CACCCAAac")
self.assertEqual(record.contigs[1].reads[5].qa.qual_clipping_start, 65)
self.assertEqual(record.contigs[1].reads[5].qa.qual_clipping_end, 874)
self.assertEqual(record.contigs[1].reads[5].qa.align_clipping_start, 1)
self.assertEqual(record.contigs[1].reads[5].qa.align_clipping_end, 874)
self.assertEqual(record.contigs[1].reads[5].ds.chromat_file, "BL060-LR3R.b.ab1")
self.assertEqual(record.contigs[1].reads[5].ds.phd_file, "BL060-LR3R.b.ab1.phd.1")
self.assertEqual(record.contigs[1].reads[5].ds.time, "Fri Nov 14 09:46:03 2003")
self.assertEqual(record.contigs[1].reads[5].ds.chem, "term")
self.assertEqual(record.contigs[1].reads[5].ds.dye, "big")
self.assertEqual(record.contigs[1].reads[5].ds.template, "")
self.assertEqual(record.contigs[1].reads[5].ds.direction, "")
self.assertEqual(record.contigs[1].reads[5].rt, None)
self.assertEqual(record.contigs[1].reads[5].wr, None)
# Read 6
self.assertEqual(record.contigs[1].reads[6].rd.name, "BL060-c1-LR3R.b.ab1")
self.assertEqual(record.contigs[1].reads[6].rd.padded_bases, 864)
self.assertEqual(record.contigs[1].reads[6].rd.info_items, 0)
self.assertEqual(record.contigs[1].reads[6].rd.read_tags, 0)
center = len(record.contigs[1].reads[6].rd.sequence)//2
self.assertEqual(record.contigs[1].reads[6].rd.sequence[:10], "CCaTGTCCAA")
self.assertEqual(record.contigs[1].reads[6].rd.sequence[center-5:center+5], "AAGGGTT*CA")
self.assertEqual(record.contigs[1].reads[6].rd.sequence[-10:], "ACACTCGCga")
self.assertEqual(record.contigs[1].reads[6].qa.qual_clipping_start, 73)
self.assertEqual(record.contigs[1].reads[6].qa.qual_clipping_end, 862)
self.assertEqual(record.contigs[1].reads[6].qa.align_clipping_start, 1)
self.assertEqual(record.contigs[1].reads[6].qa.align_clipping_end, 863)
self.assertEqual(record.contigs[1].reads[6].ds.chromat_file, "BL060-c1-LR3R.b.ab1")
self.assertEqual(record.contigs[1].reads[6].ds.phd_file, "BL060-c1-LR3R.b.ab1.phd.1")
self.assertEqual(record.contigs[1].reads[6].ds.time, "Tue Feb 3 11:01:16 2004")
self.assertEqual(record.contigs[1].reads[6].ds.chem, "term")
self.assertEqual(record.contigs[1].reads[6].ds.dye, "big")
self.assertEqual(record.contigs[1].reads[6].ds.template, "")
self.assertEqual(record.contigs[1].reads[6].ds.direction, "")
self.assertEqual(record.contigs[1].reads[6].rt, None)
self.assertEqual(record.contigs[1].reads[6].wr, None)
# Read 7
self.assertEqual(record.contigs[1].reads[7].rd.name, "BL060-LR3R.b.ab1")
self.assertEqual(record.contigs[1].reads[7].rd.padded_bases, 857)
self.assertEqual(record.contigs[1].reads[7].rd.info_items, 0)
self.assertEqual(record.contigs[1].reads[7].rd.read_tags, 0)
center = len(record.contigs[1].reads[7].rd.sequence)//2
self.assertEqual(record.contigs[1].reads[7].rd.sequence[:10], "agaaagagga")
self.assertEqual(record.contigs[1].reads[7].rd.sequence[center-5:center+5], "nnnannnnnn")
self.assertEqual(record.contigs[1].reads[7].rd.sequence[-10:], "gtctttgctc")
self.assertEqual(record.contigs[1].reads[7].qa.qual_clipping_start, 548)
self.assertEqual(record.contigs[1].reads[7].qa.qual_clipping_end, 847)
self.assertEqual(record.contigs[1].reads[7].qa.align_clipping_start, 442)
self.assertEqual(record.contigs[1].reads[7].qa.align_clipping_end, 854)
self.assertEqual(record.contigs[1].reads[7].ds.chromat_file, "BL060-LR3R.b.ab1")
self.assertEqual(record.contigs[1].reads[7].ds.phd_file, "BL060-LR3R.b.ab1.phd.1")
self.assertEqual(record.contigs[1].reads[7].ds.time, "Fri Jan 16 09:01:10 2004")
self.assertEqual(record.contigs[1].reads[7].ds.chem, "term")
self.assertEqual(record.contigs[1].reads[7].ds.dye, "big")
self.assertEqual(record.contigs[1].reads[7].ds.template, "")
self.assertEqual(record.contigs[1].reads[7].ds.direction, "")
self.assertEqual(record.contigs[1].reads[7].rt, None)
self.assertEqual(record.contigs[1].reads[7].wr, None)
# Read 8
self.assertEqual(record.contigs[1].reads[8].rd.name, "BL060-c1-LR7.g.ab1")
self.assertEqual(record.contigs[1].reads[8].rd.padded_bases, 878)
self.assertEqual(record.contigs[1].reads[8].rd.info_items, 0)
self.assertEqual(record.contigs[1].reads[8].rd.read_tags, 0)
center = len(record.contigs[1].reads[8].rd.sequence)//2
self.assertEqual(record.contigs[1].reads[8].rd.sequence[:10], "agTttc*ctc")
self.assertEqual(record.contigs[1].reads[8].rd.sequence[center-5:center+5], "TCATAAAACT")
self.assertEqual(record.contigs[1].reads[8].rd.sequence[-10:], "xxxxxxxxxx")
self.assertEqual(record.contigs[1].reads[8].qa.qual_clipping_start, 20)
self.assertEqual(record.contigs[1].reads[8].qa.qual_clipping_end, 798)
self.assertEqual(record.contigs[1].reads[8].qa.align_clipping_start, 1)
self.assertEqual(record.contigs[1].reads[8].qa.align_clipping_end, 798)
self.assertEqual(record.contigs[1].reads[8].ds.chromat_file, "BL060-c1-LR7.g.ab1")
self.assertEqual(record.contigs[1].reads[8].ds.phd_file, "BL060-c1-LR7.g.ab1.phd.1")
self.assertEqual(record.contigs[1].reads[8].ds.time, "Tue Feb 3 11:01:16 2004")
self.assertEqual(record.contigs[1].reads[8].ds.chem, "term")
self.assertEqual(record.contigs[1].reads[8].ds.dye, "big")
self.assertEqual(record.contigs[1].reads[8].ds.template, "")
self.assertEqual(record.contigs[1].reads[8].ds.direction, "")
self.assertEqual(record.contigs[1].reads[8].rt, None)
self.assertEqual(record.contigs[1].reads[8].wr, None)
# Read 9
self.assertEqual(record.contigs[1].reads[9].rd.name, "BL060-LR7.g.ab1")
self.assertEqual(record.contigs[1].reads[9].rd.padded_bases, 880)
self.assertEqual(record.contigs[1].reads[9].rd.info_items, 0)
self.assertEqual(record.contigs[1].reads[9].rd.read_tags, 0)
center = len(record.contigs[1].reads[9].rd.sequence)//2
self.assertEqual(record.contigs[1].reads[9].rd.sequence[:10], "ggctaCGCCc")
self.assertEqual(record.contigs[1].reads[9].rd.sequence[center-5:center+5], "ATTGAGTTTC")
self.assertEqual(record.contigs[1].reads[9].rd.sequence[-10:], "tggcgttgcg")
self.assertEqual(record.contigs[1].reads[9].qa.qual_clipping_start, 14)
self.assertEqual(record.contigs[1].reads[9].qa.qual_clipping_end, 765)
self.assertEqual(record.contigs[1].reads[9].qa.align_clipping_start, 4)
self.assertEqual(record.contigs[1].reads[9].qa.align_clipping_end, 765)
self.assertEqual(record.contigs[1].reads[9].ds.chromat_file, "BL060-LR7.g.ab1")
self.assertEqual(record.contigs[1].reads[9].ds.phd_file, "BL060-LR7.g.ab1.phd.1")
self.assertEqual(record.contigs[1].reads[9].ds.time, "Fri Nov 14 09:46:03 2003")
self.assertEqual(record.contigs[1].reads[9].ds.chem, "term")
self.assertEqual(record.contigs[1].reads[9].ds.dye, "big")
self.assertEqual(record.contigs[1].reads[9].ds.template, "")
self.assertEqual(record.contigs[1].reads[9].ds.direction, "")
self.assertEqual(record.contigs[1].reads[9].rt, None)
self.assertEqual(record.contigs[1].reads[9].wr, None)
# Read 10
self.assertEqual(record.contigs[1].reads[10].rd.name, "BL060c5-LR5.g.ab1")
self.assertEqual(record.contigs[1].reads[10].rd.padded_bases, 871)
self.assertEqual(record.contigs[1].reads[10].rd.info_items, 0)
self.assertEqual(record.contigs[1].reads[10].rd.read_tags, 0)
center = len(record.contigs[1].reads[10].rd.sequence)//2
self.assertEqual(record.contigs[1].reads[10].rd.sequence[:10], "ggtTCGATTA")
self.assertEqual(record.contigs[1].reads[10].rd.sequence[center-5:center+5], "ACCAATTGAC")
self.assertEqual(record.contigs[1].reads[10].rd.sequence[-10:], "ACCACCCatt")
self.assertEqual(record.contigs[1].reads[10].qa.qual_clipping_start, 12)
self.assertEqual(record.contigs[1].reads[10].qa.qual_clipping_end, 767)
self.assertEqual(record.contigs[1].reads[10].qa.align_clipping_start, 1)
self.assertEqual(record.contigs[1].reads[10].qa.align_clipping_end, 871)
self.assertEqual(record.contigs[1].reads[10].ds.chromat_file, "BL060c5-LR5.g.ab1")
self.assertEqual(record.contigs[1].reads[10].ds.phd_file, "BL060c5-LR5.g.ab1.phd.1")
self.assertEqual(record.contigs[1].reads[10].ds.time, "Fri Nov 14 09:46:03 2003")
self.assertEqual(record.contigs[1].reads[10].ds.chem, "term")
self.assertEqual(record.contigs[1].reads[10].ds.dye, "big")
self.assertEqual(record.contigs[1].reads[10].ds.template, "")
self.assertEqual(record.contigs[1].reads[10].ds.direction, "")
self.assertEqual(record.contigs[1].reads[10].rt, None)
self.assertEqual(record.contigs[1].reads[10].wr, None)
# Read 11
self.assertEqual(record.contigs[1].reads[11].rd.name, "BL060c2-LR5.g.ab1")
self.assertEqual(record.contigs[1].reads[11].rd.padded_bases, 839)
self.assertEqual(record.contigs[1].reads[11].rd.info_items, 0)
self.assertEqual(record.contigs[1].reads[11].rd.read_tags, 0)
center = len(record.contigs[1].reads[11].rd.sequence)//2
self.assertEqual(record.contigs[1].reads[11].rd.sequence[:10], "ggttcatatg")
self.assertEqual(record.contigs[1].reads[11].rd.sequence[center-5:center+5], "TAAAATCAGT")
self.assertEqual(record.contigs[1].reads[11].rd.sequence[-10:], "TCTTGCaata")
self.assertEqual(record.contigs[1].reads[11].qa.qual_clipping_start, 11)
self.assertEqual(record.contigs[1].reads[11].qa.qual_clipping_end, 757)
self.assertEqual(record.contigs[1].reads[11].qa.align_clipping_start, 10)
self.assertEqual(record.contigs[1].reads[11].qa.align_clipping_end, 835)
self.assertEqual(record.contigs[1].reads[11].ds, None)
self.assertEqual(len(record.contigs[1].reads[11].rt), 1)
self.assertEqual(record.contigs[1].reads[11].rt[0].name, "BL060c2-LR5.g.ab1")
self.assertEqual(record.contigs[1].reads[11].rt[0].tag_type, "matchElsewhereHighQual")
self.assertEqual(record.contigs[1].reads[11].rt[0].program, "phrap")
self.assertEqual(record.contigs[1].reads[11].rt[0].padded_start, 617)
self.assertEqual(record.contigs[1].reads[11].rt[0].padded_end, 631)
self.assertEqual(record.contigs[1].reads[11].rt[0].date, "040217:110357")
self.assertEqual(record.contigs[1].reads[11].wr, None)
# Read 12
self.assertEqual(record.contigs[1].reads[12].rd.name, "BL060c5-LR0R.b.ab1")
self.assertEqual(record.contigs[1].reads[12].rd.padded_bases, 855)
self.assertEqual(record.contigs[1].reads[12].rd.info_items, 0)
self.assertEqual(record.contigs[1].reads[12].rd.read_tags, 0)
center = len(record.contigs[1].reads[12].rd.sequence)//2
self.assertEqual(record.contigs[1].reads[12].rd.sequence[:10], "cACTCGCGTA")
self.assertEqual(record.contigs[1].reads[12].rd.sequence[center-5:center+5], "CTCGTAAAAT")
self.assertEqual(record.contigs[1].reads[12].rd.sequence[-10:], "aacccctgca")
self.assertEqual(record.contigs[1].reads[12].qa.qual_clipping_start, 94)
self.assertEqual(record.contigs[1].reads[12].qa.qual_clipping_end, 835)
self.assertEqual(record.contigs[1].reads[12].qa.align_clipping_start, 1)
self.assertEqual(record.contigs[1].reads[12].qa.align_clipping_end, 847)
self.assertEqual(record.contigs[1].reads[12].ds.chromat_file, "BL060c5-LR0R.b.ab1")
self.assertEqual(record.contigs[1].reads[12].ds.phd_file, "BL060c5-LR0R.b.ab1.phd.1")
self.assertEqual(record.contigs[1].reads[12].ds.time, "Wed Nov 12 08:16:30 2003")
self.assertEqual(record.contigs[1].reads[12].ds.chem, "term")
self.assertEqual(record.contigs[1].reads[12].ds.dye, "big")
self.assertEqual(record.contigs[1].reads[12].ds.template, "")
self.assertEqual(record.contigs[1].reads[12].ds.direction, "")
self.assertEqual(len(record.contigs[1].reads[12].rt), 1)
self.assertEqual(record.contigs[1].reads[12].rt[0].name, "BL060c5-LR0R.b.ab1")
self.assertEqual(record.contigs[1].reads[12].rt[0].tag_type, "matchElsewhereHighQual")
self.assertEqual(record.contigs[1].reads[12].rt[0].program, "phrap")
self.assertEqual(record.contigs[1].reads[12].rt[0].padded_start, 617)
self.assertEqual(record.contigs[1].reads[12].rt[0].padded_end, 631)
self.assertEqual(record.contigs[1].reads[12].rt[0].date, "040217:110357")
self.assertEqual(record.contigs[1].reads[12].wr, None)
# Read 13
self.assertEqual(record.contigs[1].reads[13].rd.name, "BL060c2-LR0R.b.ab1")
self.assertEqual(record.contigs[1].reads[13].rd.padded_bases, 852)
self.assertEqual(record.contigs[1].reads[13].rd.info_items, 0)
self.assertEqual(record.contigs[1].reads[13].rd.read_tags, 0)
center = len(record.contigs[1].reads[13].rd.sequence)//2
self.assertEqual(record.contigs[1].reads[13].rd.sequence[:10], "cgCGTa*tTG")
self.assertEqual(record.contigs[1].reads[13].rd.sequence[center-5:center+5], "GTAAAATATT")
self.assertEqual(record.contigs[1].reads[13].rd.sequence[-10:], "Atccttgtag")
self.assertEqual(record.contigs[1].reads[13].qa.qual_clipping_start, 33)
self.assertEqual(record.contigs[1].reads[13].qa.qual_clipping_end, 831)
self.assertEqual(record.contigs[1].reads[13].qa.align_clipping_start, 1)
self.assertEqual(record.contigs[1].reads[13].qa.align_clipping_end, 852)
self.assertEqual(record.contigs[1].reads[13].ds.chromat_file, "BL060c2-LR0R.b.ab1")
self.assertEqual(record.contigs[1].reads[13].ds.phd_file, "BL060c2-LR0R.b.ab1.phd.1")
self.assertEqual(record.contigs[1].reads[13].ds.time, "Wed Nov 12 08:16:29 2003")
self.assertEqual(record.contigs[1].reads[13].ds.chem, "term")
self.assertEqual(record.contigs[1].reads[13].ds.dye, "big")
self.assertEqual(record.contigs[1].reads[13].ds.template, "")
self.assertEqual(record.contigs[1].reads[13].ds.direction, "")
self.assertEqual(record.contigs[1].reads[13].rt, [])
self.assertEqual(len(record.contigs[1].reads[13].wr), 1)
self.assertEqual(record.contigs[1].reads[13].wr[0].name, "BL060c2-LR0R.b.ab1")
self.assertEqual(record.contigs[1].reads[13].wr[0].aligned, "unaligned")
self.assertEqual(record.contigs[1].reads[13].wr[0].program, "phrap")
self.assertEqual(record.contigs[1].reads[13].wr[0].date, "040217:110357")
def test_check_record_parser(self):
"""Test to check that contig parser parses each contig into a contig."""
contigs=Ace.parse(self.handle)
# First contig
contig = contigs.next()
self.assertEqual(len(contig.reads), 2)
self.assertEqual(contig.name, "Contig1")
self.assertEqual(contig.nbases, 856)
self.assertEqual(contig.nreads, 2)
self.assertEqual(contig.nsegments, 31)
self.assertEqual(contig.uorc, 'U')
center = len(contig.sequence)//2
self.assertEqual(contig.sequence[:10], "aatacgGGAT")
self.assertEqual(contig.sequence[center-5:center+5], "ACATCATCTG")
self.assertEqual(contig.sequence[-10:], "cATCTAGtac")
center = len(contig.quality)//2
self.assertEqual(contig.quality[:10], [0, 0, 0, 0, 0, 0, 22, 23, 25, 28])
self.assertEqual(contig.quality[center-5:center+5], [90, 90, 90, 90, 90, 90, 90, 90, 90, 90])
self.assertEqual(contig.quality[-10:], [15, 22, 30, 24, 28, 22, 21, 15, 19, 0])
self.assertEqual(len(contig.af), 2)
self.assertEqual(contig.af[1].name, "BL060c3-LR0R.b.ab1")
self.assertEqual(contig.af[1].coru, "U")
self.assertEqual(contig.af[1].padded_start, 1)
self.assertEqual(len(contig.bs), 31)
self.assertEqual(contig.bs[15].name, "BL060c3-LR5.g.ab1")
self.assertEqual(contig.bs[15].padded_start, 434)
self.assertEqual(contig.bs[15].padded_end, 438)
self.assertEqual(contig.bs[30].name, "BL060c3-LR0R.b.ab1")
self.assertEqual(contig.bs[30].padded_start, 823)
self.assertEqual(contig.bs[30].padded_end, 856)
self.assertEqual(contig.ct, None)
self.assertEqual(contig.wa, None)
self.assertEqual(len(contig.reads), 2)
self.assertEqual(contig.reads[0].rd.name, "BL060c3-LR5.g.ab1")
self.assertEqual(contig.reads[0].rd.padded_bases, 868)
self.assertEqual(contig.reads[0].rd.info_items, 0)
self.assertEqual(contig.reads[0].rd.read_tags, 0)
center = len(contig.reads[0].rd.sequence)//2
self.assertEqual(contig.reads[0].rd.sequence[:10], "tagcgaggaa")
self.assertEqual(contig.reads[0].rd.sequence[center-5:center+5], "CCGAGGCCAA")
self.assertEqual(contig.reads[0].rd.sequence[-10:], "gaaccatcag")
self.assertEqual(contig.reads[0].qa.qual_clipping_start, 80)
self.assertEqual(contig.reads[0].qa.qual_clipping_end, 853)
self.assertEqual(contig.reads[0].qa.align_clipping_start, 22)
self.assertEqual(contig.reads[0].qa.align_clipping_end, 856)
self.assertEqual(contig.reads[0].ds, None)
self.assertEqual(len(contig.reads[0].rt), 2)
self.assertEqual(contig.reads[0].rt[0].name, "BL060c3-LR5.g.ab1")
self.assertEqual(contig.reads[0].rt[0].tag_type, "matchElsewhereHighQual")
self.assertEqual(contig.reads[0].rt[0].program, "phrap")
self.assertEqual(contig.reads[0].rt[0].padded_start, 590)
self.assertEqual(contig.reads[0].rt[0].padded_end, 607)
self.assertEqual(contig.reads[0].rt[0].date, "040217:110357")
self.assertEqual(contig.reads[0].rt[1].name, "BL060c3-LR5.g.ab1")
self.assertEqual(contig.reads[0].rt[1].tag_type, "matchElsewhereHighQual")
self.assertEqual(contig.reads[0].rt[1].program, "phrap")
self.assertEqual(contig.reads[0].rt[1].padded_start, 617)
self.assertEqual(contig.reads[0].rt[1].padded_end, 631)
self.assertEqual(contig.reads[0].rt[1].date, "040217:110357")
self.assertEqual(len(contig.reads[0].wr), 1)
self.assertEqual(contig.reads[0].wr[0].name, "BL060c3-LR5.g.ab1")
self.assertEqual(contig.reads[0].wr[0].aligned, "unaligned")
self.assertEqual(contig.reads[0].wr[0].program, "phrap")
self.assertEqual(contig.reads[0].wr[0].date, "040217:110357")
self.assertEqual(contig.reads[1].rd.name, "BL060c3-LR0R.b.ab1")
self.assertEqual(contig.reads[1].rd.padded_bases, 856)
self.assertEqual(contig.reads[1].rd.info_items, 0)
self.assertEqual(contig.reads[1].rd.read_tags, 0)
center = len(contig.reads[1].rd.sequence)//2
self.assertEqual(contig.reads[1].rd.sequence[:10], "aatacgGGAT")
self.assertEqual(contig.reads[1].rd.sequence[center-5:center+5], "ACATCATCTG")
self.assertEqual(contig.reads[1].rd.sequence[-10:], "cATCTAGtac")
self.assertEqual(contig.reads[1].qa.qual_clipping_start, 7)
self.assertEqual(contig.reads[1].qa.qual_clipping_end, 778)
self.assertEqual(contig.reads[1].qa.align_clipping_start, 1)
self.assertEqual(contig.reads[1].qa.align_clipping_end, 856)
self.assertEqual(contig.reads[1].ds, None)
self.assertEqual(contig.reads[1].rt, None)
self.assertEqual(contig.reads[1].wr, None)
# Second contig
contig = contigs.next()
self.assertEqual(len(contig.reads), 14)
self.assertEqual(contig.name, "Contig2")
self.assertEqual(contig.nbases, 3296)
self.assertEqual(contig.nreads, 14)
self.assertEqual(contig.nsegments, 214)
self.assertEqual(contig.uorc, 'U')
center = len(contig.sequence) // 2
self.assertEqual(contig.sequence[:10], "cacggatgat")
self.assertEqual(contig.sequence[center-5:center+5], "TTTGAATATT")
self.assertEqual(contig.sequence[-10:], "Atccttgtag")
center = len(contig.quality) // 2
self.assertEqual(contig.quality[:10], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
self.assertEqual(contig.quality[center-5:center+5], [90, 90, 90, 90, 90, 90, 90, 90, 90, 90])
self.assertEqual(contig.quality[-10:], [24, 0, 0, 0, 0, 0, 0, 0, 0, 0])
self.assertEqual(len(contig.af), 14)
self.assertEqual(contig.af[7].name, "BL060-LR3R.b.ab1")
self.assertEqual(contig.af[7].coru, "C")
self.assertEqual(contig.af[7].padded_start, 1601)
self.assertEqual(contig.af[13].name, "BL060c2-LR0R.b.ab1")
self.assertEqual(contig.af[13].coru, "C")
self.assertEqual(contig.af[13].padded_start, 2445)
self.assertEqual(len(contig.bs), 214)
self.assertEqual(contig.bs[107].name, "BL060-c1-LR3R.b.ab1")
self.assertEqual(contig.bs[107].padded_start, 2286)
self.assertEqual(contig.bs[107].padded_end, 2292)
self.assertEqual(contig.bs[213].name, "BL060c2-LR0R.b.ab1")
self.assertEqual(contig.bs[213].padded_start, 3236)
self.assertEqual(contig.bs[213].padded_end, 3296)
self.assertEqual(len(contig.ct), 3)
self.assertEqual(contig.ct[0].name, "Contig2")
self.assertEqual(contig.ct[0].tag_type, "repeat")
self.assertEqual(contig.ct[0].program, "phrap")
self.assertEqual(contig.ct[0].padded_start, 42)
self.assertEqual(contig.ct[0].padded_end, 43)
self.assertEqual(contig.ct[0].date, "123456:765432")
self.assertEqual(contig.ct[0].info, ['This is the forst line of comment for c2', 'and this the second for c2'])
self.assertEqual(contig.ct[1].name, "unrelated_Contig")
self.assertEqual(contig.ct[1].tag_type, "repeat")
self.assertEqual(contig.ct[1].program, "phrap")
self.assertEqual(contig.ct[1].padded_start, 1142)
self.assertEqual(contig.ct[1].padded_end, 143)
self.assertEqual(contig.ct[1].date, "122226:722232")
self.assertEqual(contig.ct[1].info, ['This is the forst line of comment for the unrelated ct tag', 'and this the second'])
self.assertEqual(contig.ct[2].name, "Contig1")
self.assertEqual(contig.ct[2].tag_type, "repeat")
self.assertEqual(contig.ct[2].program, "phrap")
self.assertEqual(contig.ct[2].padded_start, 52)
self.assertEqual(contig.ct[2].padded_end, 53)
self.assertEqual(contig.ct[2].date, "555456:555432")
self.assertEqual(contig.ct[2].info, ['This is the forst line of comment for c1', 'and this the second for c1'])
self.assertEqual(len(contig.wa), 1)
self.assertEqual(contig.wa[0].tag_type, "phrap_params")
self.assertEqual(contig.wa[0].program, "phrap")
self.assertEqual(contig.wa[0].date, "040203:114710")
self.assertEqual(contig.wa[0].info, ['phrap 304_nuclsu.fasta.screen -new_ace -retain_duplicates', 'phrap version 0.990329'])
self.assertEqual(len(contig.reads), 14)
# Read 0
self.assertEqual(contig.reads[0].rd.name, "BL060-c1-LR12.g.ab1")
self.assertEqual(contig.reads[0].rd.padded_bases, 862)
self.assertEqual(contig.reads[0].rd.info_items, 0)
self.assertEqual(contig.reads[0].rd.read_tags, 0)
center = len(contig.reads[0].rd.sequence)//2
self.assertEqual(contig.reads[0].rd.sequence[:10], "cacggatgat")
self.assertEqual(contig.reads[0].rd.sequence[center-5:center+5], "GTTCTCGTTG")
self.assertEqual(contig.reads[0].rd.sequence[-10:], "CGTTTACCcg")
self.assertEqual(contig.reads[0].qa.qual_clipping_start, 81)
self.assertEqual(contig.reads[0].qa.qual_clipping_end, 842)
self.assertEqual(contig.reads[0].qa.align_clipping_start, 1)
self.assertEqual(contig.reads[0].qa.align_clipping_end, 862)
self.assertEqual(contig.reads[0].ds.chromat_file, "BL060-c1-LR12.g.ab1")
self.assertEqual(contig.reads[0].ds.phd_file, "BL060-c1-LR12.g.ab1.phd.1")
self.assertEqual(contig.reads[0].ds.time, "Tue Feb 3 11:01:16 2004")
self.assertEqual(contig.reads[0].ds.chem, "term")
self.assertEqual(contig.reads[0].ds.dye, "big")
self.assertEqual(contig.reads[0].ds.template, "")
self.assertEqual(contig.reads[0].ds.direction, "")
self.assertEqual(contig.reads[0].rt, None)
self.assertEqual(contig.reads[0].wr, None)
# Read 1
self.assertEqual(contig.reads[1].rd.name, "BL060-c1-LR11.g.ab1")
self.assertEqual(contig.reads[1].rd.padded_bases, 880)
self.assertEqual(contig.reads[1].rd.info_items, 0)
self.assertEqual(contig.reads[1].rd.read_tags, 0)
center = len(contig.reads[1].rd.sequence)//2
self.assertEqual(contig.reads[1].rd.sequence[:10], "ctttctgacC")
self.assertEqual(contig.reads[1].rd.sequence[center-5:center+5], "CTGTGGTTTC")
self.assertEqual(contig.reads[1].rd.sequence[-10:], "cggagttacg")
self.assertEqual(contig.reads[1].qa.qual_clipping_start, 11)
self.assertEqual(contig.reads[1].qa.qual_clipping_end, 807)
self.assertEqual(contig.reads[1].qa.align_clipping_start, 8)
self.assertEqual(contig.reads[1].qa.align_clipping_end, 880)
self.assertEqual(contig.reads[1].ds.chromat_file, "BL060-c1-LR11.g.ab1")
self.assertEqual(contig.reads[1].ds.phd_file, "BL060-c1-LR11.g.ab1.phd.1")
self.assertEqual(contig.reads[1].ds.time, "Tue Feb 3 11:01:16 2004")
self.assertEqual(contig.reads[1].ds.chem, "term")
self.assertEqual(contig.reads[1].ds.dye, "big")
self.assertEqual(contig.reads[1].ds.template, "")
self.assertEqual(contig.reads[1].ds.direction, "")
self.assertEqual(len(contig.reads[1].rt), 1)
self.assertEqual(contig.reads[1].rt[0].name, "BL060c3-LR5.g.ab1")
self.assertEqual(contig.reads[1].rt[0].tag_type, "matchElsewhereHighQual")
self.assertEqual(contig.reads[1].rt[0].program, "phrap")
self.assertEqual(contig.reads[1].rt[0].padded_start, 617)
self.assertEqual(contig.reads[1].rt[0].padded_end, 631)
self.assertEqual(contig.reads[1].rt[0].date, "040217:110357")
self.assertEqual(contig.reads[1].wr, None)
# Read 2
self.assertEqual(contig.reads[2].rd.name, "BL060-c1-LR9.g.ab1")
self.assertEqual(contig.reads[2].rd.padded_bases, 864)
self.assertEqual(contig.reads[2].rd.info_items, 0)
self.assertEqual(contig.reads[2].rd.read_tags, 0)
center = len(contig.reads[2].rd.sequence)//2
self.assertEqual(contig.reads[2].rd.sequence[:10], "cacccaCTTT")
self.assertEqual(contig.reads[2].rd.sequence[center-5:center+5], "ACCAAACATT")
self.assertEqual(contig.reads[2].rd.sequence[-10:], "GGTAGCACgc")
self.assertEqual(contig.reads[2].qa.qual_clipping_start, 7)
self.assertEqual(contig.reads[2].qa.qual_clipping_end, 840)
self.assertEqual(contig.reads[2].qa.align_clipping_start, 4)
self.assertEqual(contig.reads[2].qa.align_clipping_end, 864)
self.assertEqual(contig.reads[2].ds.chromat_file, "BL060-c1-LR9.g.ab1")
self.assertEqual(contig.reads[2].ds.phd_file, "BL060-c1-LR9.g.ab1.phd.1")
self.assertEqual(contig.reads[2].ds.time, "Tue Feb 3 11:01:16 2004")
self.assertEqual(contig.reads[2].ds.chem, "term")
self.assertEqual(contig.reads[2].ds.dye, "big")
self.assertEqual(contig.reads[2].ds.template, "")
self.assertEqual(contig.reads[2].ds.direction, "")
self.assertEqual(contig.reads[2].rt, None)
self.assertEqual(contig.reads[2].wr, None)
# Read 3
self.assertEqual(contig.reads[3].rd.name, "BL060-c1-LR17R.b.ab1")
self.assertEqual(contig.reads[3].rd.padded_bases, 863)
self.assertEqual(contig.reads[3].rd.info_items, 0)
self.assertEqual(contig.reads[3].rd.read_tags, 0)
center = len(contig.reads[3].rd.sequence)//2
self.assertEqual(contig.reads[3].rd.sequence[:10], "ctaattggcc")
self.assertEqual(contig.reads[3].rd.sequence[center-5:center+5], "GGAACCTTTC")
self.assertEqual(contig.reads[3].rd.sequence[-10:], "CAACCTgact")
self.assertEqual(contig.reads[3].qa.qual_clipping_start, 63)
self.assertEqual(contig.reads[3].qa.qual_clipping_end, 857)
self.assertEqual(contig.reads[3].qa.align_clipping_start, 1)
self.assertEqual(contig.reads[3].qa.align_clipping_end, 861)
self.assertEqual(contig.reads[3].ds.chromat_file, "BL060-c1-LR17R.b.ab1")
self.assertEqual(contig.reads[3].ds.phd_file, "BL060-c1-LR17R.b.ab1.phd.1")
self.assertEqual(contig.reads[3].ds.time, "Tue Feb 3 11:01:16 2004")
self.assertEqual(contig.reads[3].ds.chem, "term")
self.assertEqual(contig.reads[3].ds.dye, "big")
self.assertEqual(contig.reads[3].ds.template, "")
self.assertEqual(contig.reads[3].ds.direction, "")
self.assertEqual(len(contig.reads[3].rt), 1)
self.assertEqual(contig.reads[3].rt[0].name, "BL060c3-LR5.g.ab1")
self.assertEqual(contig.reads[3].rt[0].tag_type, "matchElsewhereHighQual")
self.assertEqual(contig.reads[3].rt[0].program, "phrap")
self.assertEqual(contig.reads[3].rt[0].padded_start, 617)
self.assertEqual(contig.reads[3].rt[0].padded_end, 631)
self.assertEqual(contig.reads[3].rt[0].date, "040217:110357")
self.assertEqual(contig.reads[3].wr, None)
# Read 4
self.assertEqual(contig.reads[4].rd.name, "BL060-LR8.5.g.ab1")
self.assertEqual(contig.reads[4].rd.padded_bases, 877)
self.assertEqual(contig.reads[4].rd.info_items, 0)
self.assertEqual(contig.reads[4].rd.read_tags, 0)
center = len(contig.reads[4].rd.sequence)//2
self.assertEqual(contig.reads[4].rd.sequence[:10], "tgCTGCGGTT")
self.assertEqual(contig.reads[4].rd.sequence[center-5:center+5], "GGCAGTTTCA")
self.assertEqual(contig.reads[4].rd.sequence[-10:], "tactcataaa")
self.assertEqual(contig.reads[4].qa.qual_clipping_start, 13)
self.assertEqual(contig.reads[4].qa.qual_clipping_end, 729)
self.assertEqual(contig.reads[4].qa.align_clipping_start, 1)
self.assertEqual(contig.reads[4].qa.align_clipping_end, 877)
self.assertEqual(contig.reads[4].ds.chromat_file, "BL060-LR8.5.g.ab1")
self.assertEqual(contig.reads[4].ds.phd_file, "BL060-LR8.5.g.ab1.phd.1")
self.assertEqual(contig.reads[4].ds.time, "Fri Nov 14 09:46:03 2003")
self.assertEqual(contig.reads[4].ds.chem, "term")
self.assertEqual(contig.reads[4].ds.dye, "big")
self.assertEqual(contig.reads[4].ds.template, "")
self.assertEqual(contig.reads[4].ds.direction, "")
self.assertEqual(contig.reads[4].rt, None)
self.assertEqual(contig.reads[4].wr, None)
# Read 5
self.assertEqual(contig.reads[5].rd.name, "BL060-LR3R.b.ab1")
self.assertEqual(contig.reads[5].rd.padded_bases, 874)
self.assertEqual(contig.reads[5].rd.info_items, 0)
self.assertEqual(contig.reads[5].rd.read_tags, 0)
center = len(contig.reads[5].rd.sequence)//2
self.assertEqual(contig.reads[5].rd.sequence[:10], "ctCTTAGGAT")
self.assertEqual(contig.reads[5].rd.sequence[center-5:center+5], "AACTCACATT")
self.assertEqual(contig.reads[5].rd.sequence[-10:], "*CACCCAAac")
self.assertEqual(contig.reads[5].qa.qual_clipping_start, 65)
self.assertEqual(contig.reads[5].qa.qual_clipping_end, 874)
self.assertEqual(contig.reads[5].qa.align_clipping_start, 1)
self.assertEqual(contig.reads[5].qa.align_clipping_end, 874)
self.assertEqual(contig.reads[5].ds.chromat_file, "BL060-LR3R.b.ab1")
self.assertEqual(contig.reads[5].ds.phd_file, "BL060-LR3R.b.ab1.phd.1")
self.assertEqual(contig.reads[5].ds.time, "Fri Nov 14 09:46:03 2003")
self.assertEqual(contig.reads[5].ds.chem, "term")
self.assertEqual(contig.reads[5].ds.dye, "big")
self.assertEqual(contig.reads[5].ds.template, "")
self.assertEqual(contig.reads[5].ds.direction, "")
self.assertEqual(contig.reads[5].rt, None)
self.assertEqual(contig.reads[5].wr, None)
# Read 6
self.assertEqual(contig.reads[6].rd.name, "BL060-c1-LR3R.b.ab1")
self.assertEqual(contig.reads[6].rd.padded_bases, 864)
self.assertEqual(contig.reads[6].rd.info_items, 0)
self.assertEqual(contig.reads[6].rd.read_tags, 0)
center = len(contig.reads[6].rd.sequence)//2
self.assertEqual(contig.reads[6].rd.sequence[:10], "CCaTGTCCAA")
self.assertEqual(contig.reads[6].rd.sequence[center-5:center+5], "AAGGGTT*CA")
self.assertEqual(contig.reads[6].rd.sequence[-10:], "ACACTCGCga")
self.assertEqual(contig.reads[6].qa.qual_clipping_start, 73)
self.assertEqual(contig.reads[6].qa.qual_clipping_end, 862)
self.assertEqual(contig.reads[6].qa.align_clipping_start, 1)
self.assertEqual(contig.reads[6].qa.align_clipping_end, 863)
self.assertEqual(contig.reads[6].ds.chromat_file, "BL060-c1-LR3R.b.ab1")
self.assertEqual(contig.reads[6].ds.phd_file, "BL060-c1-LR3R.b.ab1.phd.1")
self.assertEqual(contig.reads[6].ds.time, "Tue Feb 3 11:01:16 2004")
self.assertEqual(contig.reads[6].ds.chem, "term")
self.assertEqual(contig.reads[6].ds.dye, "big")
self.assertEqual(contig.reads[6].ds.template, "")
self.assertEqual(contig.reads[6].ds.direction, "")
self.assertEqual(contig.reads[6].rt, None)
self.assertEqual(contig.reads[6].wr, None)
# Read 7
self.assertEqual(contig.reads[7].rd.name, "BL060-LR3R.b.ab1")
self.assertEqual(contig.reads[7].rd.padded_bases, 857)
self.assertEqual(contig.reads[7].rd.info_items, 0)
self.assertEqual(contig.reads[7].rd.read_tags, 0)
center = len(contig.reads[7].rd.sequence)//2
self.assertEqual(contig.reads[7].rd.sequence[:10], "agaaagagga")
self.assertEqual(contig.reads[7].rd.sequence[center-5:center+5], "nnnannnnnn")
self.assertEqual(contig.reads[7].rd.sequence[-10:], "gtctttgctc")
self.assertEqual(contig.reads[7].qa.qual_clipping_start, 548)
self.assertEqual(contig.reads[7].qa.qual_clipping_end, 847)
self.assertEqual(contig.reads[7].qa.align_clipping_start, 442)
self.assertEqual(contig.reads[7].qa.align_clipping_end, 854)
self.assertEqual(contig.reads[7].ds.chromat_file, "BL060-LR3R.b.ab1")
self.assertEqual(contig.reads[7].ds.phd_file, "BL060-LR3R.b.ab1.phd.1")
self.assertEqual(contig.reads[7].ds.time, "Fri Jan 16 09:01:10 2004")
self.assertEqual(contig.reads[7].ds.chem, "term")
self.assertEqual(contig.reads[7].ds.dye, "big")
self.assertEqual(contig.reads[7].ds.template, "")
self.assertEqual(contig.reads[7].ds.direction, "")
self.assertEqual(contig.reads[7].rt, None)
self.assertEqual(contig.reads[7].wr, None)
# Read 8
self.assertEqual(contig.reads[8].rd.name, "BL060-c1-LR7.g.ab1")
self.assertEqual(contig.reads[8].rd.padded_bases, 878)
self.assertEqual(contig.reads[8].rd.info_items, 0)
self.assertEqual(contig.reads[8].rd.read_tags, 0)
center = len(contig.reads[8].rd.sequence)//2
self.assertEqual(contig.reads[8].rd.sequence[:10], "agTttc*ctc")
self.assertEqual(contig.reads[8].rd.sequence[center-5:center+5], "TCATAAAACT")
self.assertEqual(contig.reads[8].rd.sequence[-10:], "xxxxxxxxxx")
self.assertEqual(contig.reads[8].qa.qual_clipping_start, 20)
self.assertEqual(contig.reads[8].qa.qual_clipping_end, 798)
self.assertEqual(contig.reads[8].qa.align_clipping_start, 1)
self.assertEqual(contig.reads[8].qa.align_clipping_end, 798)
self.assertEqual(contig.reads[8].ds.chromat_file, "BL060-c1-LR7.g.ab1")
self.assertEqual(contig.reads[8].ds.phd_file, "BL060-c1-LR7.g.ab1.phd.1")
self.assertEqual(contig.reads[8].ds.time, "Tue Feb 3 11:01:16 2004")
self.assertEqual(contig.reads[8].ds.chem, "term")
self.assertEqual(contig.reads[8].ds.dye, "big")
self.assertEqual(contig.reads[8].ds.template, "")
self.assertEqual(contig.reads[8].ds.direction, "")
self.assertEqual(contig.reads[8].rt, None)
self.assertEqual(contig.reads[8].wr, None)
# Read 9
self.assertEqual(contig.reads[9].rd.name, "BL060-LR7.g.ab1")
self.assertEqual(contig.reads[9].rd.padded_bases, 880)
self.assertEqual(contig.reads[9].rd.info_items, 0)
self.assertEqual(contig.reads[9].rd.read_tags, 0)
center = len(contig.reads[9].rd.sequence)//2
self.assertEqual(contig.reads[9].rd.sequence[:10], "ggctaCGCCc")
self.assertEqual(contig.reads[9].rd.sequence[center-5:center+5], "ATTGAGTTTC")
self.assertEqual(contig.reads[9].rd.sequence[-10:], "tggcgttgcg")
self.assertEqual(contig.reads[9].qa.qual_clipping_start, 14)
self.assertEqual(contig.reads[9].qa.qual_clipping_end, 765)
self.assertEqual(contig.reads[9].qa.align_clipping_start, 4)
self.assertEqual(contig.reads[9].qa.align_clipping_end, 765)
self.assertEqual(contig.reads[9].ds.chromat_file, "BL060-LR7.g.ab1")
self.assertEqual(contig.reads[9].ds.phd_file, "BL060-LR7.g.ab1.phd.1")
self.assertEqual(contig.reads[9].ds.time, "Fri Nov 14 09:46:03 2003")
self.assertEqual(contig.reads[9].ds.chem, "term")
self.assertEqual(contig.reads[9].ds.dye, "big")
self.assertEqual(contig.reads[9].ds.template, "")
self.assertEqual(contig.reads[9].ds.direction, "")
self.assertEqual(contig.reads[9].rt, None)
self.assertEqual(contig.reads[9].wr, None)
# Read 10
self.assertEqual(contig.reads[10].rd.name, "BL060c5-LR5.g.ab1")
self.assertEqual(contig.reads[10].rd.padded_bases, 871)
self.assertEqual(contig.reads[10].rd.info_items, 0)
self.assertEqual(contig.reads[10].rd.read_tags, 0)
center = len(contig.reads[10].rd.sequence)//2
self.assertEqual(contig.reads[10].rd.sequence[:10], "ggtTCGATTA")
self.assertEqual(contig.reads[10].rd.sequence[center-5:center+5], "ACCAATTGAC")
self.assertEqual(contig.reads[10].rd.sequence[-10:], "ACCACCCatt")
self.assertEqual(contig.reads[10].qa.qual_clipping_start, 12)
self.assertEqual(contig.reads[10].qa.qual_clipping_end, 767)
self.assertEqual(contig.reads[10].qa.align_clipping_start, 1)
self.assertEqual(contig.reads[10].qa.align_clipping_end, 871)
self.assertEqual(contig.reads[10].ds.chromat_file, "BL060c5-LR5.g.ab1")
self.assertEqual(contig.reads[10].ds.phd_file, "BL060c5-LR5.g.ab1.phd.1")
self.assertEqual(contig.reads[10].ds.time, "Fri Nov 14 09:46:03 2003")
self.assertEqual(contig.reads[10].ds.chem, "term")
self.assertEqual(contig.reads[10].ds.dye, "big")
self.assertEqual(contig.reads[10].ds.template, "")
self.assertEqual(contig.reads[10].ds.direction, "")
self.assertEqual(contig.reads[10].rt, None)
self.assertEqual(contig.reads[10].wr, None)
# Read 11
self.assertEqual(contig.reads[11].rd.name, "BL060c2-LR5.g.ab1")
self.assertEqual(contig.reads[11].rd.padded_bases, 839)
self.assertEqual(contig.reads[11].rd.info_items, 0)
self.assertEqual(contig.reads[11].rd.read_tags, 0)
center = len(contig.reads[11].rd.sequence)//2
self.assertEqual(contig.reads[11].rd.sequence[:10], "ggttcatatg")
self.assertEqual(contig.reads[11].rd.sequence[center-5:center+5], "TAAAATCAGT")
self.assertEqual(contig.reads[11].rd.sequence[-10:], "TCTTGCaata")
self.assertEqual(contig.reads[11].qa.qual_clipping_start, 11)
self.assertEqual(contig.reads[11].qa.qual_clipping_end, 757)
self.assertEqual(contig.reads[11].qa.align_clipping_start, 10)
self.assertEqual(contig.reads[11].qa.align_clipping_end, 835)
self.assertEqual(contig.reads[11].ds, None)
self.assertEqual(len(contig.reads[11].rt), 1)
self.assertEqual(contig.reads[11].rt[0].name, "BL060c2-LR5.g.ab1")
self.assertEqual(contig.reads[11].rt[0].tag_type, "matchElsewhereHighQual")
self.assertEqual(contig.reads[11].rt[0].program, "phrap")
self.assertEqual(contig.reads[11].rt[0].padded_start, 617)
self.assertEqual(contig.reads[11].rt[0].padded_end, 631)
self.assertEqual(contig.reads[11].rt[0].date, "040217:110357")
self.assertEqual(contig.reads[11].wr, None)
# Read 12
self.assertEqual(contig.reads[12].rd.name, "BL060c5-LR0R.b.ab1")
self.assertEqual(contig.reads[12].rd.padded_bases, 855)
self.assertEqual(contig.reads[12].rd.info_items, 0)
self.assertEqual(contig.reads[12].rd.read_tags, 0)
center = len(contig.reads[12].rd.sequence)//2
self.assertEqual(contig.reads[12].rd.sequence[:10], "cACTCGCGTA")
self.assertEqual(contig.reads[12].rd.sequence[center-5:center+5], "CTCGTAAAAT")
self.assertEqual(contig.reads[12].rd.sequence[-10:], "aacccctgca")
self.assertEqual(contig.reads[12].qa.qual_clipping_start, 94)
self.assertEqual(contig.reads[12].qa.qual_clipping_end, 835)
self.assertEqual(contig.reads[12].qa.align_clipping_start, 1)
self.assertEqual(contig.reads[12].qa.align_clipping_end, 847)
self.assertEqual(contig.reads[12].ds.chromat_file, "BL060c5-LR0R.b.ab1")
self.assertEqual(contig.reads[12].ds.phd_file, "BL060c5-LR0R.b.ab1.phd.1")
self.assertEqual(contig.reads[12].ds.time, "Wed Nov 12 08:16:30 2003")
self.assertEqual(contig.reads[12].ds.chem, "term")
self.assertEqual(contig.reads[12].ds.dye, "big")
self.assertEqual(contig.reads[12].ds.template, "")
self.assertEqual(contig.reads[12].ds.direction, "")
self.assertEqual(contig.reads[12].rt, None)
self.assertEqual(contig.reads[12].wr, None)
# Read 13
self.assertEqual(contig.reads[13].rd.name, "BL060c2-LR0R.b.ab1")
self.assertEqual(contig.reads[13].rd.padded_bases, 852)
self.assertEqual(contig.reads[13].rd.info_items, 0)
self.assertEqual(contig.reads[13].rd.read_tags, 0)
center = len(contig.reads[13].rd.sequence)//2
self.assertEqual(contig.reads[13].rd.sequence[:10], "cgCGTa*tTG")
self.assertEqual(contig.reads[13].rd.sequence[center-5:center+5], "GTAAAATATT")
self.assertEqual(contig.reads[13].rd.sequence[-10:], "Atccttgtag")
self.assertEqual(contig.reads[13].qa.qual_clipping_start, 33)
self.assertEqual(contig.reads[13].qa.qual_clipping_end, 831)
self.assertEqual(contig.reads[13].qa.align_clipping_start, 1)
self.assertEqual(contig.reads[13].qa.align_clipping_end, 852)
self.assertEqual(contig.reads[13].ds.chromat_file, "BL060c2-LR0R.b.ab1")
self.assertEqual(contig.reads[13].ds.phd_file, "BL060c2-LR0R.b.ab1.phd.1")
self.assertEqual(contig.reads[13].ds.time, "Wed Nov 12 08:16:29 2003")
self.assertEqual(contig.reads[13].ds.chem, "term")
self.assertEqual(contig.reads[13].ds.dye, "big")
self.assertEqual(contig.reads[13].ds.template, "")
self.assertEqual(contig.reads[13].ds.direction, "")
self.assertEqual(len(contig.reads[13].rt), 1)
self.assertEqual(contig.reads[13].rt[0].name, "BL060c5-LR0R.b.ab1")
self.assertEqual(contig.reads[13].rt[0].tag_type, "matchElsewhereHighQual")
self.assertEqual(contig.reads[13].rt[0].program, "phrap")
self.assertEqual(contig.reads[13].rt[0].padded_start, 617)
self.assertEqual(contig.reads[13].rt[0].padded_end, 631)
self.assertEqual(contig.reads[13].rt[0].date, "040217:110357")
self.assertEqual(len(contig.reads[13].wr), 1)
self.assertEqual(contig.reads[13].wr[0].name, "BL060c2-LR0R.b.ab1")
self.assertEqual(contig.reads[13].wr[0].aligned, "unaligned")
self.assertEqual(contig.reads[13].wr[0].program, "phrap")
self.assertEqual(contig.reads[13].wr[0].date, "040217:110357")
# Make sure there are no more contigs
self.assertRaises(StopIteration, contigs.next)
class AceTestTwo(unittest.TestCase):
"""Test parsing example output from CAP3.
The sample input file seq.cap.ace was downloaded from:
http://genome.cs.mtu.edu/cap/data/seq.cap.ace
"""
def setUp(self):
self.handle = open("Ace/seq.cap.ace")
def test_check_ACEParser(self):
"""Test to check that ACEParser can parse the whole file into one record."""