File: test_AlignIO_FastaIO.py

package info (click to toggle)
python-biopython 1.78%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 65,756 kB
  • sloc: python: 221,141; xml: 178,777; ansic: 13,369; sql: 1,208; makefile: 131; sh: 70
file content (891 lines) | stat: -rw-r--r-- 44,198 bytes parent folder | download
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
# Copyright 2011 by Peter Cock.  All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license.  Please see the LICENSE file that should have been included
# as part of this package.
"""Unit tests for the Bio.AlignIO.FastaIO module."""

import unittest
from Bio.AlignIO import FastaIO


class FastaIOTests(unittest.TestCase):
    """Test FastaIO module."""

    def test_output001(self):
        """Check output001.m10 file."""
        fasta_file = "Fasta/output001.m10"
        with open(fasta_file) as handle:
            alignments = list(FastaIO.FastaM10Iterator(handle))
            self.assertEqual(len(alignments), 4)
            self.assertEqual(len(alignments[0]), 2)
            self.assertEqual(alignments[0].get_alignment_length(), 108)
            self.assertEqual(
                alignments[0][0].seq,
                "SGSNT-RRRAISRPVRLTAEED---QE"
                "IRKRAAECGKTVSGFLRAAALGKKVNS"
                "LTDDRVLKEVM-----RLGALQKKLFI"
                "DGKRVGDREYAEVLIAITEYHRALLSR",
            )
            self.assertEqual(alignments[0][0].id, "gi|10955263|ref|NP_052604.1|")
            self.assertEqual(alignments[0][0].annotations["original_length"], 107)
            self.assertEqual(
                alignments[0][1].seq,
                "AGSGAPRRRGSGLASRISEQSEALLQE"
                "AAKHAAEFGRS------EVDTEHLLLA"
                "LADSDVVKTILGQFKIKVDDLKRQIES"
                "EAKR-GDKPF-EGEIGVSPRVKDALSR",
            )
            self.assertEqual(alignments[0][1].id, "gi|152973457|ref|YP_001338508.1|")
            self.assertEqual(alignments[0][1].annotations["original_length"], 931)
            self.assertEqual(len(alignments[1]), 2)
            self.assertEqual(alignments[1].get_alignment_length(), 64)
            self.assertEqual(
                alignments[1][0].seq,
                "AAECGKTVSGFLRAAALGKKVNSLTDD"
                "RVLKEV-MRLGALQKKLFIDGKRVGDR"
                "EYAEVLIAIT",
            )
            self.assertEqual(alignments[1][0].id, "gi|10955263|ref|NP_052604.1|")
            self.assertEqual(alignments[1][0].annotations["original_length"], 107)
            self.assertEqual(
                alignments[1][1].seq,
                "ASRQGCTVGG--KMDSVQDKASDKDKE"
                "RVMKNINIMWNALSKNRLFDG----NK"
                "ELKEFIMTLT",
            )
            self.assertEqual(alignments[1][1].id, "gi|152973588|ref|YP_001338639.1|")
            self.assertEqual(alignments[1][1].annotations["original_length"], 459)
            self.assertEqual(len(alignments[2]), 2)
            self.assertEqual(alignments[2].get_alignment_length(), 38)
            self.assertEqual(
                alignments[2][0].seq, "MKKDKKYQIEAIKNKDKTLFIVYATDIYSPSEFFSKIE"
            )
            self.assertEqual(alignments[2][0].id, "gi|10955264|ref|NP_052605.1|")
            self.assertEqual(alignments[2][0].annotations["original_length"], 126)
            self.assertEqual(
                alignments[2][1].seq, "IKKDLGVSFLKLKNREKTLIVDALKKKYPVAELLSVLQ"
            )
            self.assertEqual(alignments[2][1].id, "gi|152973462|ref|YP_001338513.1|")
            self.assertEqual(alignments[2][1].annotations["original_length"], 101)
            self.assertEqual(len(alignments[3]), 2)
            self.assertEqual(alignments[3].get_alignment_length(), 43)
            self.assertEqual(
                alignments[3][0].seq, "SELHSKLPKSIDKIHEDIKKQLSC-SLIMKKIDVEMEDYSTYC"
            )
            self.assertEqual(alignments[3][0].id, "gi|10955265|ref|NP_052606.1|")
            self.assertEqual(alignments[3][0].annotations["original_length"], 346)
            self.assertEqual(
                alignments[3][1].seq, "SRINSDVARRIPGIHRDPKDRLSSLKQVEEALDMLISSHGEYC"
            )
            self.assertEqual(alignments[3][1].id, "gi|152973545|ref|YP_001338596.1|")
            self.assertEqual(alignments[3][1].annotations["original_length"], 242)

    def test_output002(self):
        """Check output002.m10 file."""
        fasta_file = "Fasta/output002.m10"
        with open(fasta_file) as handle:
            alignments = list(FastaIO.FastaM10Iterator(handle))
            self.assertEqual(len(alignments), 6)
            self.assertEqual(len(alignments[0]), 2)
            self.assertEqual(alignments[0].get_alignment_length(), 88)
            self.assertEqual(
                alignments[0][0].seq,
                "SGSNTRRRAISRPVR--LTAEED"
                "QEIRKRAAECG-KTVSGFLRAAA"
                "LGKKVNSLTDDRVLKEVMRLGAL"
                "QKKLFIDGKRVGDREYAEV",
            )
            self.assertEqual(alignments[0][0].id, "gi|10955263|ref|NP_052604.1|")
            self.assertEqual(alignments[0][0].annotations["original_length"], 107)
            self.assertEqual(
                alignments[0][1].seq,
                "SQRSTRRKPENQPTRVILFNKPY"
                "DVLPQFTDEAGRKTLKEFIPVQG"
                "VYAAGRLDRDSEGLLVLTNNGAL"
                "QARLTQPGKRTGKIYYVQV",
            )
            self.assertEqual(alignments[0][1].id, "gi|162139799|ref|NP_309634.2|")
            self.assertEqual(alignments[0][1].annotations["original_length"], 207)
            self.assertEqual(len(alignments[1]), 2)
            self.assertEqual(alignments[1].get_alignment_length(), 53)
            self.assertEqual(
                alignments[1][0].seq,
                "EIRKRAAECGKTVSGFLRAAA-LGKKV----NSLTDDRVLKEVMRLGALQKKL",
            )
            self.assertEqual(alignments[1][0].id, "gi|10955263|ref|NP_052604.1|")
            self.assertEqual(alignments[1][0].annotations["original_length"], 107)
            self.assertEqual(
                alignments[1][1].seq,
                "EIKPRGTSKGEAIAAFMQEAPFIGRTPVFLGDDLTDESGFAVVNRLGGMSVKI",
            )
            self.assertEqual(alignments[1][1].id, "gi|15831859|ref|NP_310632.1|")
            self.assertEqual(alignments[1][1].annotations["original_length"], 266)
            self.assertEqual(len(alignments[2]), 2)
            self.assertEqual(alignments[2].get_alignment_length(), 92)
            self.assertEqual(
                alignments[2][0].seq,
                "SEFFSKIESDLKKKKSKGDVFFD"
                "LIIPNG-----GKKDRYVYTSFN"
                "GEKFSSYTLNKVTKTDEYNDLSE"
                "LSASFFKKNFDKINVNLLSKATS",
            )
            self.assertEqual(alignments[2][0].id, "gi|10955264|ref|NP_052605.1|")
            self.assertEqual(alignments[2][0].annotations["original_length"], 126)
            self.assertEqual(
                alignments[2][1].seq,
                "TELNSELAKAMKVDAQRG-AFVS"
                "QVLPNSSAAKAGIKAGDVITSL"
                "NGKPISSFAALRA-QVGTMPVG"
                "SKLTLGLLRDG-KQVNVNLELQ"
                "QSS",
            )
            self.assertEqual(alignments[2][1].id, "gi|15829419|ref|NP_308192.1|")
            self.assertEqual(alignments[2][1].annotations["original_length"], 474)
            self.assertEqual(len(alignments[3]), 2)
            self.assertEqual(alignments[3].get_alignment_length(), 73)
            self.assertEqual(
                alignments[3][0].seq,
                "FFDLIIPNGGKKDRYVYTSFNGE"
                "KFSSYTLNKVTKTDEYNDLSELS"
                "ASFFKKNFDKINVNLLSKATSFA"
                "LKKG",
            )
            self.assertEqual(alignments[3][0].id, "gi|10955264|ref|NP_052605.1|")
            self.assertEqual(alignments[3][0].annotations["original_length"], 126)
            self.assertEqual(
                alignments[3][1].seq,
                "LFDLFLKNDAMHDPMVNESYC-E"
                "TFGWVSKENLARMKE---LTYKA"
                "NDVLKKLFDDAGLILVDFKLEFG"
                "LYKG",
            )
            self.assertEqual(alignments[3][1].id, "gi|15832592|ref|NP_311365.1|")
            self.assertEqual(alignments[3][1].annotations["original_length"], 237)
            self.assertEqual(len(alignments[4]), 2)
            self.assertEqual(alignments[4].get_alignment_length(), 63)
            self.assertEqual(
                alignments[4][0].seq,
                "VDIKK-ETIESELHSKLPKSIDKIHEDIKKQLSCSLI--MKKID-VEMEDYSTYCFSALRAIE",
            )
            self.assertEqual(alignments[4][0].id, "gi|10955265|ref|NP_052606.1|")
            self.assertEqual(alignments[4][0].annotations["original_length"], 346)
            self.assertEqual(
                alignments[4][1].seq,
                "IDPKKIEQIARQVHESMPKGIREFGEDVEKKIRQTLQAQLTRLDLVSREEFDVQTQVLLRTRE",
            )
            self.assertEqual(alignments[4][1].id, "gi|38704138|ref|NP_311957.2|")
            self.assertEqual(alignments[4][1].annotations["original_length"], 111)
            self.assertEqual(len(alignments[5]), 2)
            self.assertEqual(alignments[5].get_alignment_length(), 157)
            self.assertEqual(
                alignments[5][0].seq,
                "QYIMTTSNGDRVRAKIYKRGSIQ"
                "FQGKYLQIASLINDFMCSILNMK"
                "EIVEQKNKEFNVDI---KKETI-"
                "ESELHSKLPKSIDKIHEDIKKQL"
                "SCSLIMKKIDV-EMEDYSTYCFS"
                "ALRA-IEGFIYQILNDVCNPSSS"
                "KNLGEYFTENKPKYIIREI",
            )
            self.assertEqual(alignments[5][0].id, "gi|10955265|ref|NP_052606.1|")
            self.assertEqual(alignments[5][0].annotations["original_length"], 346)
            self.assertEqual(
                alignments[5][1].seq,
                "EFIRLLSDHDQFEKDQISELTVA"
                "ANALKLEVAK--NNY-----NMK"
                "YSFDTQTERRMIELIREQKDLIP"
                "EKYLHQSGIKKL-KLHED---EF"
                "SSLLVDAERQVLEGSSFVLCCGE"
                "KINSTISELLSKKITDLTHPTES"
                "FTLSEYFSYDVYEEIFKKV",
            )
            self.assertEqual(alignments[5][1].id, "gi|15833861|ref|NP_312634.1|")
            self.assertEqual(alignments[5][1].annotations["original_length"], 330)

    def test_output003(self):
        """Check output003.m10 file."""
        fasta_file = "Fasta/output003.m10"
        with open(fasta_file) as handle:
            alignments = list(FastaIO.FastaM10Iterator(handle))
            self.assertEqual(len(alignments), 3)
            self.assertEqual(len(alignments[0]), 2)
            self.assertEqual(alignments[0].get_alignment_length(), 55)
            self.assertEqual(
                alignments[0][0].seq,
                "ISISNNKDQYEELQKEQGERDLKTVDQLVRIAAAGGGLRLSASTKTVDQLVRIAA",
            )
            self.assertEqual(alignments[0][0].id, "gi|152973837|ref|YP_001338874.1|")
            self.assertEqual(alignments[0][0].annotations["original_length"], 183)
            self.assertEqual(
                alignments[0][1].seq,
                "VRLTAEEDQ--EIRKRAAECG-KTVSGFLRAAALGKKVNSLTDDRVLKEVMRLGA",
            )
            self.assertEqual(alignments[0][1].id, "gi|10955263|ref|NP_052604.1|")
            self.assertEqual(alignments[0][1].annotations["original_length"], 107)
            self.assertEqual(len(alignments[1]), 2)
            self.assertEqual(alignments[1].get_alignment_length(), 22)
            self.assertEqual(alignments[1][0].seq, "DDAEHLFRTLSSR-LDALQDGN")
            self.assertEqual(alignments[1][0].id, "gi|152973840|ref|YP_001338877.1|")
            self.assertEqual(alignments[1][0].annotations["original_length"], 63)
            self.assertEqual(alignments[1][1].seq, "DDRANLFEFLSEEGITITEDNN")
            self.assertEqual(alignments[1][1].id, "gi|10955265|ref|NP_052606.1|")
            self.assertEqual(alignments[1][1].annotations["original_length"], 346)
            self.assertEqual(len(alignments[2]), 2)
            self.assertEqual(alignments[2].get_alignment_length(), 63)
            self.assertEqual(
                alignments[2][0].seq,
                "VFGSFEQPKGEHLSGQVSEQ--RDTAFADQNEQVIRHLKQEIEHLNTLLLSKDSHIDSLKQAM",
            )
            self.assertEqual(alignments[2][0].id, "gi|152973841|ref|YP_001338878.1|")
            self.assertEqual(alignments[2][0].annotations["original_length"], 133)
            self.assertEqual(
                alignments[2][1].seq,
                "VYTSFN---GEKFSSYTLNKVTKTDEYNDLSELSASFFKKNFDKINVNLLSKATSF-ALKKGI",
            )
            self.assertEqual(alignments[2][1].id, "gi|10955264|ref|NP_052605.1|")
            self.assertEqual(alignments[2][1].annotations["original_length"], 126)

    def test_output004(self):
        """Check output004.m10 file."""
        fasta_file = "Fasta/output004.m10"
        with open(fasta_file) as handle:
            alignments = list(FastaIO.FastaM10Iterator(handle))
            self.assertEqual(len(alignments), 1)
            self.assertEqual(len(alignments[0]), 2)
            self.assertEqual(alignments[0].get_alignment_length(), 102)
            self.assertEqual(
                alignments[0][0].seq,
                "AAAAAAGATAAAAAATATCAAAT"
                "AGAAGCAATAAAAAATAAAGATA"
                "AAACTTTATTTATTGTCTATGCT"
                "ACTGATATTTATAGCCCGAGCGA"
                "ATTTTTCTCA",
            )
            self.assertEqual(alignments[0][0].id, "ref|NC_002127.1|:c1351-971")
            self.assertEqual(alignments[0][0].annotations["original_length"], 381)
            self.assertEqual(
                alignments[0][1].seq,
                "AGAGAAAATAAAACAAGTAATAA"
                "AATATTAATGGAAAAAATAAATT"
                "CTTGTTTATTTAGACCTGATTCT"
                "AATCACTTTTCTTGCCCGGAGTC"
                "ATTTTTGACA",
            )
            self.assertEqual(alignments[0][1].id, "ref|NC_002695.1|:1970775-1971404")
            self.assertEqual(alignments[0][1].annotations["original_length"], 630)

    def test_output005(self):
        """Check output005.m10 file."""
        fasta_file = "Fasta/output005.m10"
        with open(fasta_file) as handle:
            alignments = list(FastaIO.FastaM10Iterator(handle))
            self.assertEqual(len(alignments), 1)
            self.assertEqual(len(alignments[0]), 2)
            self.assertEqual(alignments[0].get_alignment_length(), 110)
            self.assertEqual(
                alignments[0][0].seq,
                "IKNKDKTLFIVYAT-DIYSPSEF"
                "FSKIESDLKKKKSKGDV--FFDL"
                "IIPNGGKKD--RYVYTSFNGEKF"
                "SSYTLNKVTKTDEYNDL--SELS"
                "ASFFKKNFDKINVNLLSK",
            )
            self.assertEqual(alignments[0][0].id, "gi|10955264|ref|NP_052605.1|")
            self.assertEqual(alignments[0][0].annotations["original_length"], 126)
            self.assertEqual(
                alignments[0][1].seq,
                "IKDELPVAFCSWASLDLECEVKY"
                "INDVTSLYAKDWMSGERKWFIDW"
                "IAPFGHNMELYKYMRKKYPYELF"
                "RAIRLDESSKTGKIAEFHGGGID"
                "KKLASKIFRQYHHELMSE",
            )
            self.assertEqual(alignments[0][1].id, "gi|10955282|ref|NP_052623.1|")
            self.assertEqual(alignments[0][1].annotations["original_length"], 163)

    def test_output006(self):
        """Check output006.m10 file."""
        fasta_file = "Fasta/output006.m10"
        with open(fasta_file) as handle:
            alignments = list(FastaIO.FastaM10Iterator(handle))
            self.assertEqual(len(alignments), 1)
            self.assertEqual(len(alignments[0]), 2)
            self.assertEqual(alignments[0].get_alignment_length(), 131)
            self.assertEqual(
                alignments[0][0].seq,
                "GCAACGCTTCAAGAACTGGAATT"
                "AGGAACCGTGACAACGATTAATG"
                "AGGAGATTTATGAAGAGGGTTCT"
                "TCGATTTTAGGCCAATCGGAAGG"
                "AATTATGTAGCAAGTCCATCAGA"
                "AAATGGAAGAAGTCAT",
            )
            self.assertEqual(alignments[0][0].id, "query")
            self.assertEqual(alignments[0][0].annotations["original_length"], 131)
            self.assertEqual(
                alignments[0][1].seq,
                "GCAACGCTTCAAGAACTGGAATT"
                "AGGAACCGTGACAACGATTAATG"
                "AGGAGATTTATGAAGAGGGTTCT"
                "TCGATTTTAGGCCAATCGGAAGG"
                "AATTATGTAGCAAGTCCATCAGA"
                "AAATGGAAGTAGTCAT",
            )
            self.assertEqual(alignments[0][1].id, "gi|116660610|gb|EG558221.1|EG558221")
            self.assertEqual(alignments[0][1].annotations["original_length"], 573)

    def test_output007(self):
        """Check output007.m10 file."""
        fasta_file = "Fasta/output007.m10"
        with open(fasta_file) as handle:
            alignments = list(FastaIO.FastaM10Iterator(handle))
            self.assertEqual(len(alignments), 9)
            self.assertEqual(len(alignments[0]), 2)
            self.assertEqual(alignments[0].get_alignment_length(), 108)
            self.assertEqual(
                alignments[0][0].seq,
                "SGSNT-RRRAISRPVRLTAEED-"
                "--QEIRKRAAECGKTVSGFLRAA"
                "ALGKKVNSLTDDRVLKEVM----"
                "-RLGALQKKLFIDGKRVGDREYA"
                "EVLIAITEYHRALLSR",
            )
            self.assertEqual(alignments[0][0].id, "gi|10955263|ref|NP_052604.1|")
            self.assertEqual(alignments[0][0].annotations["original_length"], 107)
            self.assertEqual(
                alignments[0][1].seq,
                "AGSGAPRRRGSGLASRISEQSEA"
                "LLQEAAKHAAEFGRS------EV"
                "DTEHLLLALADSDVVKTILGQFK"
                "IKVDDLKRQIESEAKR-GDKPF-"
                "EGEIGVSPRVKDALSR",
            )
            self.assertEqual(alignments[0][1].id, "gi|152973457|ref|YP_001338508.1|")
            self.assertEqual(alignments[0][1].annotations["original_length"], 931)
            self.assertEqual(len(alignments[1]), 2)
            self.assertEqual(alignments[1].get_alignment_length(), 64)
            self.assertEqual(
                alignments[1][0].seq,
                "AAECGKTVSGFLRAAALGKKVNS"
                "LTDDRVLKEV-MRLGALQKKLFI"
                "DGKRVGDREYAEVLIAIT",
            )
            self.assertEqual(alignments[1][0].id, "gi|10955263|ref|NP_052604.1|")
            self.assertEqual(alignments[1][0].annotations["original_length"], 107)
            self.assertEqual(
                alignments[1][1].seq,
                "ASRQGCTVGG--KMDSVQDKASD"
                "KDKERVMKNINIMWNALSKNRLF"
                "DG----NKELKEFIMTLT",
            )
            self.assertEqual(alignments[1][1].id, "gi|152973588|ref|YP_001338639.1|")
            self.assertEqual(alignments[1][1].annotations["original_length"], 459)
            self.assertEqual(len(alignments[2]), 2)
            self.assertEqual(alignments[2].get_alignment_length(), 45)
            self.assertEqual(
                alignments[2][0].seq, "EIRKRAAECGKTVSGFLRAAA-----LGKKVNSLTDDRVLKEVMR"
            )
            self.assertEqual(alignments[2][0].id, "gi|10955263|ref|NP_052604.1|")
            self.assertEqual(alignments[2][0].annotations["original_length"], 107)
            self.assertEqual(
                alignments[2][1].seq, "ELVKLIADMGISVRALLRKNVEPYEELGLEEDKFTDDQLIDFMLQ"
            )
            self.assertEqual(alignments[2][1].id, "gi|152973480|ref|YP_001338531.1|")
            self.assertEqual(alignments[2][1].annotations["original_length"], 141)
            self.assertEqual(len(alignments[3]), 2)
            self.assertEqual(alignments[3].get_alignment_length(), 38)
            self.assertEqual(
                alignments[3][0].seq, "MKKDKKYQIEAIKNKDKTLFIVYATDIYSPSEFFSKIE"
            )
            self.assertEqual(alignments[3][0].id, "gi|10955264|ref|NP_052605.1|")
            self.assertEqual(alignments[3][0].annotations["original_length"], 126)
            self.assertEqual(
                alignments[3][1].seq, "IKKDLGVSFLKLKNREKTLIVDALKKKYPVAELLSVLQ"
            )
            self.assertEqual(alignments[3][1].id, "gi|152973462|ref|YP_001338513.1|")
            self.assertEqual(alignments[3][1].annotations["original_length"], 101)
            self.assertEqual(len(alignments[4]), 2)
            self.assertEqual(alignments[4].get_alignment_length(), 11)
            self.assertEqual(alignments[4][0].seq, "FFDLIIPNGGK")
            self.assertEqual(alignments[4][0].id, "gi|10955264|ref|NP_052605.1|")
            self.assertEqual(alignments[4][0].annotations["original_length"], 126)
            self.assertEqual(alignments[4][1].seq, "FFDLVIENPGK")
            self.assertEqual(alignments[4][1].id, "gi|152973509|ref|YP_001338560.1|")
            self.assertEqual(alignments[4][1].annotations["original_length"], 448)
            self.assertEqual(len(alignments[5]), 2)
            self.assertEqual(alignments[5].get_alignment_length(), 40)
            self.assertEqual(
                alignments[5][0].seq, "DKTLFIVYATDIYSPSE-FFSKIESDLKKKKSKGD-VFFD"
            )
            self.assertEqual(alignments[5][0].id, "gi|10955264|ref|NP_052605.1|")
            self.assertEqual(alignments[5][0].annotations["original_length"], 126)
            self.assertEqual(
                alignments[5][1].seq, "ESVVFILMAGFAMSVCYLFFSVLEKVINARKSKDESIYHD"
            )
            self.assertEqual(alignments[5][1].id, "gi|152973581|ref|YP_001338632.1|")
            self.assertEqual(alignments[5][1].annotations["original_length"], 84)
            self.assertEqual(len(alignments[6]), 2)
            self.assertEqual(alignments[6].get_alignment_length(), 30)
            self.assertEqual(alignments[6][0].seq, "ASFFKKNFDKINVNLLSKATSFALKKGIPI")
            self.assertEqual(alignments[6][0].id, "gi|10955264|ref|NP_052605.1|")
            self.assertEqual(alignments[6][0].annotations["original_length"], 126)
            self.assertEqual(alignments[6][1].seq, "ASFSKEEQDKVAVDKVAADVAWQERMNKPV")
            self.assertEqual(alignments[6][1].id, "gi|152973536|ref|YP_001338587.1|")
            self.assertEqual(alignments[6][1].annotations["original_length"], 84)
            self.assertEqual(len(alignments[7]), 2)
            self.assertEqual(alignments[7].get_alignment_length(), 43)
            self.assertEqual(
                alignments[7][0].seq, "SELHSKLPKSIDKIHEDIKKQLSC-SLIMKKIDVEMEDYSTYC"
            )
            self.assertEqual(alignments[7][0].id, "gi|10955265|ref|NP_052606.1|")
            self.assertEqual(alignments[7][0].annotations["original_length"], 346)
            self.assertEqual(
                alignments[7][1].seq, "SRINSDVARRIPGIHRDPKDRLSSLKQVEEALDMLISSHGEYC"
            )
            self.assertEqual(alignments[7][1].id, "gi|152973545|ref|YP_001338596.1|")
            self.assertEqual(alignments[7][1].annotations["original_length"], 242)
            self.assertEqual(len(alignments[8]), 2)
            self.assertEqual(alignments[8].get_alignment_length(), 64)
            self.assertEqual(
                alignments[8][0].seq,
                "ISGTYKGIDFLIKLMPSGGNTTI"
                "GRASGQNNTYFDEIALIIKENCL"
                "Y--SDTKNFEYTIPKFSD",
            )
            self.assertEqual(alignments[8][0].id, "gi|10955265|ref|NP_052606.1|")
            self.assertEqual(alignments[8][0].annotations["original_length"], 346)
            self.assertEqual(
                alignments[8][1].seq,
                "IDGVITAFD-LRTGMNISKDKVV"
                "AQIQGMDPVW---ISAAVPESIA"
                "YLLKDTSQFEISVPAYPD",
            )
            self.assertEqual(alignments[8][1].id, "gi|152973505|ref|YP_001338556.1|")
            self.assertEqual(alignments[8][1].annotations["original_length"], 430)

    def test_output008(self):
        """Check output008.m10 file."""
        fasta_file = "Fasta/output008.m10"
        with open(fasta_file) as handle:
            alignments = list(FastaIO.FastaM10Iterator(handle))
            self.assertEqual(len(alignments), 12)
            self.assertEqual(len(alignments[0]), 2)
            self.assertEqual(alignments[0].get_alignment_length(), 65)
            self.assertEqual(
                alignments[0][0].seq,
                "LQHRHPHQQQQQQQQQQQQQQQQ"
                "QQQQQQQQQQQH---HHHHHHHL"
                "LQDAYMQQYQHATQQQQML",
            )
            self.assertEqual(alignments[0][0].id, "sp|Q9NSY1|BMP2K_HUMAN")
            self.assertEqual(alignments[0][0].annotations["original_length"], 1161)
            self.assertEqual(
                alignments[0][1].seq,
                "IPHQLPHALRHRPAQEAAHASQL"
                "HPAQPGCGQPLHGLWRLHHHPVY"
                "LYAWILRLRGHGMQSGGLL",
            )
            self.assertEqual(alignments[0][1].id, "gi|283855822|gb|GQ290312.1|")
            self.assertEqual(alignments[0][1].annotations["original_length"], 983)
            self.assertEqual(len(alignments[1]), 2)
            self.assertEqual(alignments[1].get_alignment_length(), 201)
            self.assertEqual(
                alignments[1][0].seq,
                "GPEIL---LGQ-GPPQQPPQQHR"
                "VLQQLQQGDWRLQQLH-------"
                "LQHRHPHQQQQQQQQQQQQQQQQ"
                "QQQQQQQQQQQH-----HHHHHH"
                "-HLLQDAYMQQYQHATQQQQMLQ"
                "QQF-LMHSVYQPQPSASQYPTMM"
                "PQYQQAFFQQQMLAQHQPSQQQA"
                "SPEYLTSPQEFSPALVSYTSSLP"
                "A-QVGTIMDSSYSANRS",
            )
            self.assertEqual(alignments[1][0].id, "sp|Q9NSY1|BMP2K_HUMAN")
            self.assertEqual(alignments[1][0].annotations["original_length"], 1161)
            self.assertEqual(
                alignments[1][1].seq,
                "GPELLRALLQQNGCGTQPLRVPT"
                "VLPG*AMAVLHAGRLHVPAHRAW"
                "LPHQLPHALRHGPAQEAAHASQL"
                "HPAQPGRG*PLHGLRWLHHHPLH"
                "/PLCMDTLSLGPQDAIWRASLPH"
                "WAVKLPCGLWWSWPLSGTWWCVS"
                "P*ATSA------LGRTMP*WASL"
                "SPGSWHWPALHPPSLVGPGTSLK"
                "ACSVHAGSTTTHSSQKS",
            )
            self.assertEqual(alignments[1][1].id, "gi|57163782|ref|NM_001009242.1|")
            self.assertEqual(alignments[1][1].annotations["original_length"], 1047)
            self.assertEqual(len(alignments[2]), 2)
            self.assertEqual(alignments[2].get_alignment_length(), 348)
            self.assertEqual(
                alignments[2][0].seq,
                "MNGTEGPNFYVPFSNATGVVRSP"
                "FEYPQYYLAEPWQFSMLAAYMFL"
                "LIVLGFPINFLTLYVTVQHKKLR"
                "TPLNYILLNLAVADLFMVLGGFT"
                "STLYTSLHGYFVFGPTGCNLEGF"
                "FATLGGEIALWSLVVLAIERYVV"
                "VCKPMSNFRFGENHAIMGVAFTW"
                "VMALACAAPPLAGWSRYIPEGLQ"
                "CSCGIDYYTLKPEVNNESFVIYM"
                "FVVHFTIPMIIIFFCYGQLVFTV"
                "KEAAAQQQESATTQKAEKEVTRM"
                "VIIMVIAFLICWVPYASVAFYIF"
                "THQGSNFGPIFMTIPAFFAKSAA"
                "IYNPVIYIMMNKQFRNCMLTTIC"
                "CGKNPLGDDEASATVSKTETSQV"
                "APA",
            )
            self.assertEqual(alignments[2][0].id, "sp|P08100|OPSD_HUMAN")
            self.assertEqual(alignments[2][0].annotations["original_length"], 348)
            self.assertEqual(
                alignments[2][1].seq,
                "MNGTEGPNFYVPFSNKTGVVRSP"
                "FEYPQYYLAEPWQFSMLAAYMFL"
                "LIVLGFPINFLTLYVTVQHKKLR"
                "TPLNYILLNLAVADLFMVFGGFT"
                "TTLYTSLHGYFVFGPTGCNLEGF"
                "FATLGGEIALWSLVVLAIERYVV"
                "VCKPMSNFRFGENHAIMGVAFTW"
                "VMALACAAPPLVGWSRYIPEGMQ"
                "CSCGIDYYTLKPEVNNESFVIYM"
                "FVVHFTIPMIVIFFCYGQLVFTV"
                "KEAAAQQQESATTQKAEKEVTRM"
                "VIIMVIAFLICWVPYASVAFYIF"
                "THQGSNFGPIFMTLPAFFAKSSS"
                "IYNPVIYIMMNKQFRNCMLTTLC"
                "CGKNPLGDDEASTTGSKTETSQV"
                "APA",
            )
            self.assertEqual(alignments[2][1].id, "gi|57163782|ref|NM_001009242.1|")
            self.assertEqual(alignments[2][1].annotations["original_length"], 1047)
            self.assertEqual(len(alignments[3]), 2)
            self.assertEqual(alignments[3].get_alignment_length(), 348)
            self.assertEqual(
                alignments[3][0].seq,
                "MNGTEGPNFYVPFSNATGVVRSP"
                "FEYPQYYLAEPWQFSMLAAYMFL"
                "LIVLGFPINFLTLYVTVQHKKLR"
                "TPLNYILLNLAVADLFMVLGGFT"
                "STLYTSLHGYFVFGPTGCNLEGF"
                "FATLGGEIALWSLVVLAIERYVV"
                "VCKPMSNFRFGENHAIMGVAFTW"
                "VMALACAAPPLAGWSRYIPEGLQ"
                "CSCGIDYYTLKPEVNNESFVIYM"
                "FVVHFTIPMIIIFFCYGQLVFTV"
                "KEAAAQQQESATTQKAEKEVTRM"
                "VIIMVIAFLICWVPYASVAFYIF"
                "THQGSNFGPIFMTIPAFFAKSAA"
                "IYNPVIYIMMNKQFRNCMLTTIC"
                "CGKNPLGDDEASATVSKTETSQV"
                "APA",
            )
            self.assertEqual(alignments[3][0].id, "sp|P08100|OPSD_HUMAN")
            self.assertEqual(alignments[3][0].annotations["original_length"], 348)
            self.assertEqual(
                alignments[3][1].seq,
                "MNGTEGPNFYVPFSNKTGVVRSP"
                "FEAPQYYLAEPWQFSMLAAYMFL"
                "LIMLGFPINFLTLYVTVQHKKLR"
                "TPLNYILLNLAVADLFMVFGGFT"
                "TTLYTSLHGYFVFGPTGCNLEGF"
                "FATLGGEIALWSLVVLAIERYVV"
                "VCKPMSNFRFGENHAIMGVAFTW"
                "VMALACAAPPLVGWSRYIPEGMQ"
                "CSCGIDYYTPHEETNNESFVIYM"
                "FVVHFIIPLIVIFFCYGQLVFTV"
                "KEAAAQQQESATTQKAEKEVTRM"
                "VIIMVIAFLICWLPYAGVAFYIF"
                "THQGSDFGPIFMTIPAFFAKTSA"
                "VYNPVIYIMMNKQFRNCMVTTLC"
                "CGKNPLGDDEASTTVSKTETSQV"
                "APA",
            )
            self.assertEqual(alignments[3][1].id, "gi|18148870|dbj|AB062417.1|")
            self.assertEqual(alignments[3][1].annotations["original_length"], 1047)
            self.assertEqual(len(alignments[4]), 2)
            self.assertEqual(alignments[4].get_alignment_length(), 326)
            self.assertEqual(
                alignments[4][0].seq,
                "VPFSNATGVVRSPFEYPQYYLAE"
                "PWQFSMLAAYMFLLIVLGFPINF"
                "LTLYVTVQHKKLRTPLNYILLNL"
                "AVADLFMVLGGFTSTLYTSLHGY"
                "FVFGPTGCNLEGFFATLGGEIAL"
                "WSLVVLAIERYVVVCKPMSNFRF"
                "GENHAIMGVAFTWVMALACAAPP"
                "LAGWSRYIPEGLQCSCGIDYYTL"
                "KPEVNNESFVIYMFVVHFTIPMI"
                "IIFFCYGQLVFTVKEAAAQQQES"
                "ATTQKAEKEVTRMVIIMVIAFLI"
                "CWVPYASVAFYIFTHQGSNFGPI"
                "FMTIPAFFAKSAAIYNPVIYIMM"
                "NKQFRNCMLTTICCGKNPLGDDE"
                "ASAT",
            )
            self.assertEqual(alignments[4][0].id, "sp|P08100|OPSD_HUMAN")
            self.assertEqual(alignments[4][0].annotations["original_length"], 348)
            self.assertEqual(
                alignments[4][1].seq,
                "VPFSNKTGVVRSPFEYPQYYLAE"
                "PWQFSMLAAYMFLLIVLGFPINF"
                "LTLYVTVQHKKLRTPLNYILLNL"
                "AVANLFMVFGGFTTTLYTSMHGY"
                "FVFGATGCNLEGFFATLGGEIAL"
                "WSLVVLAIERYVVVCKPMSNFRF"
                "GENHAIMGLAFTWVMALACAAPP"
                "LAGWSRYIPEGMQCSCGIDYYTL"
                "KPEVNNESFVIYMFVVHFTIPMI"
                "VIFFCYGQLVFTVKEAAAQQQES"
                "ATTQKAEKEVTRMVIIMVVAFLI"
                "CWLPYASVAFYIFTHQGSNFGPV"
                "FMTIPAFFAKSSSIYNPVIYIMM"
                "NKQFRNCMLTTLCCGKNPLGDDE"
                "ASTT",
            )
            self.assertEqual(alignments[4][1].id, "gi|283855822|gb|GQ290312.1|")
            self.assertEqual(alignments[4][1].annotations["original_length"], 983)
            self.assertEqual(len(alignments[5]), 2)
            self.assertEqual(alignments[5].get_alignment_length(), 354)
            self.assertEqual(
                alignments[5][0].seq,
                "MNGTEGPNFYVPFSNATGVVRSP"
                "FEYPQYYLAEPWQFSMLAAYMFL"
                "LIVLGFPINFLTLYVTVQHKKLR"
                "TPLNYILLNLAVADLFMVLGGFT"
                "STLYTSLHGYFVFGPTGCNLEGF"
                "FATLGGEIALWSLVVLAIERYVV"
                "VCKPMSNFRFGENHAIMGVAFTW"
                "VMALACAAPPLAGWSRYIPEGLQ"
                "CSCGIDYYTLKPEVNNESFVIYM"
                "FVVHFTIPMIIIFFCYGQLVFTV"
                "KEAAAQQQESATTQKAEKEVTRM"
                "VIIMVIAFLICWVPYASVAFYIF"
                "THQGSNFGPIFMTIPAFFAKSAA"
                "IYNPVIYIMMNKQFRNCMLTTIC"
                "CGKNPLGDDEAS-ATVSKTE---"
                "--TSQVAPA",
            )
            self.assertEqual(alignments[5][0].id, "sp|P08100|OPSD_HUMAN")
            self.assertEqual(alignments[5][0].annotations["original_length"], 348)
            self.assertEqual(
                alignments[5][1].seq,
                "MNGTEGPNFYIPMSNKTGVVRSP"
                "FEYPQYYLAEPWQYSILCAYMFL"
                "LILLGFPINFMTLYVTIQHKKLR"
                "TPLNYILLNLAFANHFMVLCGFT"
                "VTMYSSMNGYFILGATGCYVEGF"
                "FATLGGEIALWSLVVLAIERYVV"
                "VCKPMSNFRFSENHAVMGVAFTW"
                "IMALSCAVPPLLGWSRYIPEGMQ"
                "CSCGVDYYTLKPEVNNESFVIYM"
                "FVVHFTIPLIIIFFCYGRLVCTV"
                "KEAAAQQQESATTQKAEKEVTRM"
                "VIIMVVFFLICWVPYASVAFFIF"
                "SNQGSEFGPIFMTVPAFFAKSSS"
                "IYNPVIYIMLNKQFRNCMITTLC"
                "CGKNPFGEDDASSAATSKTEASS"
                "VSSSQVSPA",
            )
            self.assertEqual(alignments[5][1].id, "gi|2734705|gb|U59921.1|BBU59921")
            self.assertEqual(alignments[5][1].annotations["original_length"], 1574)
            self.assertEqual(len(alignments[6]), 2)
            self.assertEqual(alignments[6].get_alignment_length(), 347)
            self.assertEqual(
                alignments[6][0].seq,
                "MNGTEGPNFYVPFSNATGVVRSP"
                "FEYPQYYLAEPWQFSMLAAYMFL"
                "LIVLGFPINFLTLYVTVQHKKLR"
                "TPLNYILLNLAVADLFMVLGGFT"
                "STLYTSLHGYFVFGPTGCNLEGF"
                "FATLGGEIALWSLVVLAIERYVV"
                "VCKPMSNFRFGENHAIMGVAFTW"
                "VMALACAAPPLAGWSRYIPEGLQ"
                "CSCGIDYYTLKPEVNNESFVIYM"
                "FVVHFTIPMIIIFFCYGQLVFTV"
                "KEAAAQQQESATTQKAEKEVTRM"
                "VIIMVIAFLICWVPYASVAFYIF"
                "THQGSNFGPIFMTIPAFFAKSAA"
                "IYNPVIYIMMNKQFRNCMLTTIC"
                "CGKNPLGD-DEASATVSKTETSQ"
                "VA",
            )
            self.assertEqual(alignments[6][0].id, "sp|P08100|OPSD_HUMAN")
            self.assertEqual(alignments[6][0].annotations["original_length"], 348)
            self.assertEqual(
                alignments[6][1].seq,
                "MNGTEGPNFYIPMSNATGVVRSP"
                "FEYPQYYLAEPWAFSALSAYMFF"
                "LIIAGFPINFLTLYVTIEHKKLR"
                "TPLNYILLNLAVADLFMVFGGFT"
                "TTMYTSMHGYFVFGPTGCNIEGF"
                "FATLGGEIALWCLVVLAIERWMV"
                "VCKPVTNFRFGESHAIMGVMVTW"
                "TMALACALPPLFGWSRYIPEGLQ"
                "CSCGIDYYTRAPGINNESFVIYM"
                "FTCHFSIPLAVISFCYGRLVCTV"
                "KEAAAQQQESETTQRAEREVTRM"
                "VVIMVISFLVCWVPYASVAWYIF"
                "THQGSTFGPIFMTIPSFFAKSSA"
                "LYNPMIYICMNKQFRHCMITTLC"
                "CGKNPFEEEDGASATSSKTEASS"
                "VS",
            )
            self.assertEqual(alignments[6][1].id, "gi|12583664|dbj|AB043817.1|")
            self.assertEqual(alignments[6][1].annotations["original_length"], 1344)
            self.assertEqual(len(alignments[7]), 2)
            self.assertEqual(alignments[7].get_alignment_length(), 111)
            self.assertEqual(
                alignments[7][0].seq,
                "VPFSNATGVVRSPFEYPQYYLAE"
                "PWQFSMLAAYMFLLIVLGFPINF"
                "LTLYVTVQHKKLRTPLNYILLNL"
                "AVADLFMVLGGFTSTLYTSLHGY"
                "FVFGPTGCNLEGFFATLGG",
            )
            self.assertEqual(alignments[7][0].id, "sp|P08100|OPSD_HUMAN")
            self.assertEqual(alignments[7][0].annotations["original_length"], 348)
            self.assertEqual(
                alignments[7][1].seq,
                "VPFSNKTGVVRSPFEHPQYYLAE"
                "PWQFSMLAAYMFLLIVLGFPINF"
                "LTLYVTVQHKKLRTPLNYILLNL"
                "AVADLFMVFGGFTTTLYTSLHGY"
                "FVFGPTGCNLEGFFATLGG",
            )
            self.assertEqual(alignments[7][1].id, "gi|283855845|gb|GQ290303.1|")
            self.assertEqual(alignments[7][1].annotations["original_length"], 4301)
            self.assertEqual(len(alignments[8]), 2)
            self.assertEqual(alignments[8].get_alignment_length(), 172)
            self.assertEqual(
                alignments[8][0].seq,
                "RYIPEGLQCSCGIDYYTLKPEVN"
                "NESFVIYMFVVHFTIPMIIIFFC"
                "YGQLVFTVKE-------------"
                "-----------------------"
                "AAAQQQESATTQKAEKEVTRMVI"
                "IMVIAFLICWVPYASVAFYIFTH"
                "QGSNFGPIFMTIPAFFAKSAAIY"
                "NPVIYIMMNKQ",
            )
            self.assertEqual(alignments[8][0].id, "sp|P08100|OPSD_HUMAN")
            self.assertEqual(alignments[8][0].annotations["original_length"], 348)
            self.assertEqual(
                alignments[8][1].seq,
                "RYIPEGMQCSCGIDYYTLKPEVN"
                "NESFVIYMFVVHFTIPMIVIFFC"
                "YGQLVFTVKEVRSCVGHWGHAH*"
                "VNGAQLHSQSCHSLDT*PCVPA\\"
                "AAAQQQESATTQKAEKEVTRMVI"
                "IMVIAFLICWLPYAGVAFYIFTH"
                "QGSNFGPIFMTLPAFFAKSSSIY"
                "NPVIYIMMNKQ",
            )
            self.assertEqual(alignments[8][1].id, "gi|283855845|gb|GQ290303.1|")
            self.assertEqual(alignments[8][1].annotations["original_length"], 4301)
            self.assertEqual(len(alignments[9]), 2)
            self.assertEqual(alignments[9].get_alignment_length(), 73)
            self.assertEqual(
                alignments[9][0].seq,
                "LGGEIALWSLVVLAIERYVVVCK"
                "PMSNFRFGENHAIMGVAFTWVMA"
                "LACAAPPLAGWSR--YIPEGLQC"
                "SCGI",
            )
            self.assertEqual(alignments[9][0].id, "sp|P08100|OPSD_HUMAN")
            self.assertEqual(alignments[9][0].annotations["original_length"], 348)
            self.assertEqual(
                alignments[9][1].seq,
                "LAGEIALWSLVVLAIERYVVVCK"
                "PMSNFRFGENHAIMGLALTWVMA"
                "LACAAPPLVGWSR*WH*TEG-KC"
                "L*GL",
            )
            self.assertEqual(alignments[9][1].id, "gi|283855845|gb|GQ290303.1|")
            self.assertEqual(alignments[9][1].annotations["original_length"], 4301)
            self.assertEqual(len(alignments[10]), 2)
            self.assertEqual(alignments[10].get_alignment_length(), 30)
            self.assertEqual(alignments[10][0].seq, "IMMNKQFRNCMLTTICCGKNPLGDDEASAT")
            self.assertEqual(alignments[10][0].id, "sp|P08100|OPSD_HUMAN")
            self.assertEqual(alignments[10][0].annotations["original_length"], 348)
            self.assertEqual(alignments[10][1].seq, "MLLAFQFRNCMLTTLCCGKNPLGDDEASTT")
            self.assertEqual(alignments[10][1].id, "gi|283855845|gb|GQ290303.1|")
            self.assertEqual(alignments[10][1].annotations["original_length"], 4301)
            self.assertEqual(len(alignments[11]), 2)
            self.assertEqual(alignments[11].get_alignment_length(), 31)
            self.assertEqual(alignments[11][0].seq, "AQQQESATTQKAEKEVTRMVIIMVIAFLICW")
            self.assertEqual(alignments[11][0].id, "sp|P08100|OPSD_HUMAN")
            self.assertEqual(alignments[11][0].annotations["original_length"], 348)
            self.assertEqual(alignments[11][1].seq, "SQQIRNATTMMMTMRVTSFSAFWVVADSCCW")
            self.assertEqual(alignments[11][1].id, "gi|283855822|gb|GQ290312.1|")
            self.assertEqual(alignments[11][1].annotations["original_length"], 983)

    def test_output009(self):
        """Check output009.m10 file."""
        fasta_file = "Fasta/output009.m10"
        with open(fasta_file) as handle:
            alignments = list(FastaIO.FastaM10Iterator(handle))
            self.assertEqual(len(alignments), 7)
            self.assertEqual(len(alignments[0]), 2)
            self.assertEqual(alignments[0].get_alignment_length(), 22)
            self.assertEqual(alignments[0][0].seq, "TGATGTTCTGTTTCTAAAACAG")
            self.assertEqual(alignments[0][0].id, "gi|255708421:1-99")
            self.assertEqual(alignments[0][0].annotations["original_length"], 99)
            self.assertEqual(alignments[0][1].seq, "TGATTTTTTTTGTCTAAAACAG")
            self.assertEqual(alignments[0][1].id, "gi|23308614|ref|NM_152952.1|")
            self.assertEqual(alignments[0][1].annotations["original_length"], 5188)
            self.assertEqual(len(alignments[1]), 2)
            self.assertEqual(alignments[1].get_alignment_length(), 14)
            self.assertEqual(alignments[1][0].seq, "AGAAGGAAAAAAAA")
            self.assertEqual(alignments[1][0].id, "gi|156718121:2361-2376")
            self.assertEqual(alignments[1][0].annotations["original_length"], 16)
            self.assertEqual(alignments[1][1].seq, "AGAACTAAAAAAAA")
            self.assertEqual(alignments[1][1].id, "gi|47271416|ref|NM_131257.2|")
            self.assertEqual(alignments[1][1].annotations["original_length"], 597)
            self.assertEqual(len(alignments[2]), 2)
            self.assertEqual(alignments[2].get_alignment_length(), 14)
            self.assertEqual(alignments[2][0].seq, "AGAAGGAAAAAAAA")
            self.assertEqual(alignments[2][0].id, "gi|156718121:2361-2376")
            self.assertEqual(alignments[2][0].annotations["original_length"], 16)
            self.assertEqual(alignments[2][1].seq, "AGAAGGTATAAAAA")
            self.assertEqual(alignments[2][1].id, "gi|332859474|ref|XM_001156938.2|")
            self.assertEqual(alignments[2][1].annotations["original_length"], 762)
            self.assertEqual(len(alignments[3]), 2)
            self.assertEqual(alignments[3].get_alignment_length(), 14)
            self.assertEqual(alignments[3][0].seq, "TTTTTTTCCTTCTT")
            self.assertEqual(alignments[3][0].id, "gi|156718121:2361-2376")
            self.assertEqual(alignments[3][0].annotations["original_length"], 16)
            self.assertEqual(alignments[3][1].seq, "TTTTTTTACATCTT")
            self.assertEqual(alignments[3][1].id, "gi|332211534|ref|XM_003254825.1|")
            self.assertEqual(alignments[3][1].annotations["original_length"], 805)
            self.assertEqual(len(alignments[4]), 2)
            self.assertEqual(alignments[4].get_alignment_length(), 14)
            self.assertEqual(alignments[4][0].seq, "AAGAAGGAAAAAAA")
            self.assertEqual(alignments[4][0].id, "gi|156718121:2361-2376")
            self.assertEqual(alignments[4][0].annotations["original_length"], 16)
            self.assertEqual(alignments[4][1].seq, "AATAAGTAAAAAAA")
            self.assertEqual(alignments[4][1].id, "gi|23308614|ref|NM_152952.1|")
            self.assertEqual(alignments[4][1].annotations["original_length"], 5188)
            self.assertEqual(len(alignments[5]), 2)
            self.assertEqual(alignments[5].get_alignment_length(), 14)
            self.assertEqual(alignments[5][0].seq, "TTTTTTTCCTTCTT")
            self.assertEqual(alignments[5][0].id, "gi|156718121:2361-2376")
            self.assertEqual(alignments[5][0].annotations["original_length"], 16)
            self.assertEqual(alignments[5][1].seq, "TTTTTTTACATCTT")
            self.assertEqual(alignments[5][1].id, "gi|297689475|ref|XM_002822130.1|")
            self.assertEqual(alignments[5][1].annotations["original_length"], 1158)
            self.assertEqual(len(alignments[6]), 2)
            self.assertEqual(alignments[6].get_alignment_length(), 14)
            self.assertEqual(alignments[6][0].seq, "AAGAAGGAAAAAAA")
            self.assertEqual(alignments[6][0].id, "gi|156718121:2361-2376")
            self.assertEqual(alignments[6][0].annotations["original_length"], 16)
            self.assertEqual(alignments[6][1].seq, "AAGAAGGTAAAAGA")
            self.assertEqual(alignments[6][1].id, "gi|297689475|ref|XM_002822130.1|")
            self.assertEqual(alignments[6][1].annotations["original_length"], 1158)


if __name__ == "__main__":
    runner = unittest.TextTestRunner(verbosity=2)
    unittest.main(testRunner=runner)