Beispiel #1
0
 def test_fasta_from_alignment(self):
     """should return correct fasta string."""
     self.assertEqual(fasta_from_alignment({}), '')
     self.assertEqual(fasta_from_alignment(self.alignment_dict),
                      self.fasta_with_label)
     self.assertEqual(
         fasta_from_alignment(self.alignment_dict, line_wrap=2),
         self.fasta_with_label_lw2)
Beispiel #2
0
 def test_fasta_from_alignment(self):
     """should return correct fasta string."""
     self.assertEqual(fasta_from_alignment({}), '')
     self.assertEqual(fasta_from_alignment(self.alignment_dict),
                      self.fasta_with_label)
     self.assertEqual(fasta_from_alignment(self.alignment_dict,
                                           line_wrap=2),
                      self.fasta_with_label_lw2)
Beispiel #3
0
    def test_fasta_from_alignment_from_alignment(self):
        """should return correct fasta string for alignment object"""
        # alignment with a few sequences
        obs = fasta_from_alignment(self.alignment)
        self.assertEquals('>seq1\nACC--G-GGTA..\n>seqs2\nTCC--G-GGCA..', obs)

        # empty alginment
        obs = fasta_from_alignment(Alignment([]))
        self.assertEquals('', obs)

        # alignment with a few sequences
        obs = fasta_from_alignment(self.alignment, sort=False)
        self.assertEquals('>seq1\nACC--G-GGTA..\n>seqs2\nTCC--G-GGCA..', obs)
Beispiel #4
0
    def test_fasta_from_alignment_from_alignment(self):
        """should return correct fasta string for alignment object"""
        # alignment with a few sequences
        obs = fasta_from_alignment(self.alignment)
        self.assertEquals('>seq1\nACC--G-GGTA..\n>seqs2\nTCC--G-GGCA..', obs)

        # empty alginment
        obs = fasta_from_alignment(Alignment([]))
        self.assertEquals('', obs)

        # alignment with a few sequences
        obs = fasta_from_alignment(self.alignment, sort=False)
        self.assertEquals('>seq1\nACC--G-GGTA..\n>seqs2\nTCC--G-GGCA..', obs)