Esempio n. 1
0
    def test_phylip_to_tabular_msa_valid_files(self):
        for valid_files, components in self.valid_configurations:
            for valid in valid_files:
                observed = _phylip_to_tabular_msa(valid, constructor=DNA)

                expected_seqs = []
                expected_index = []
                for seq, ID in components:
                    expected_seqs.append(DNA(seq))
                    expected_index.append(ID)
                expected = TabularMSA(expected_seqs, index=expected_index)

                self.assertEqual(observed, expected)
Esempio n. 2
0
    def test_phylip_to_tabular_msa_valid_files(self):
        for valid_files, components in self.valid_configurations:
            for valid in valid_files:
                observed = _phylip_to_tabular_msa(valid, constructor=DNA)

                expected_seqs = []
                expected_index = []
                for seq, ID in components:
                    expected_seqs.append(DNA(seq))
                    expected_index.append(ID)
                expected = TabularMSA(expected_seqs, index=expected_index)

                self.assertEqual(observed, expected)
Esempio n. 3
0
 def test_phylip_to_tabular_msa_no_constructor(self):
     with self.assertRaisesRegex(ValueError, '`constructor`'):
         _phylip_to_tabular_msa(get_data_path('phylip_dna_3_seqs'))
Esempio n. 4
0
 def test_phylip_to_tabular_msa_invalid_files(self):
     for fp, error_type, error_msg_regex in self.invalid_files:
         with self.assertRaisesRegex(error_type, error_msg_regex):
             _phylip_to_tabular_msa(fp, constructor=DNA)
Esempio n. 5
0
 def test_phylip_to_tabular_msa_no_constructor(self):
     with six.assertRaisesRegex(self, ValueError, '`constructor`'):
         _phylip_to_tabular_msa(get_data_path('phylip_dna_3_seqs'))
Esempio n. 6
0
 def test_phylip_to_tabular_msa_invalid_files(self):
     for fp, error_type, error_msg_regex in self.invalid_files:
         with six.assertRaisesRegex(self, error_type, error_msg_regex):
             _phylip_to_tabular_msa(fp, constructor=DNA)