Exemple #1
0
    def test_check_tree_subset(self):
        """ Checks that fasta labels are a subset of tree tips properly """

        fasta_labels = ['seq1_1', 'seq1_2', 'seq2_3', 'seq3_4']

        actual_subset_results = check_tree_subset(fasta_labels,
                                                  self.sample_tree_3tips_fp)

        # Should find all and give True result

        self.assertEqual(actual_subset_results, True)

        # Should also get same results with 5 tip tree

        fasta_labels = ['seq1_1', 'seq1_2', 'seq2_3', 'seq3_4']

        actual_subset_results = check_tree_subset(fasta_labels,
                                                  self.sample_tree_5tips_fp)

        # Should find all and give True result

        self.assertEqual(actual_subset_results, True)

        # Change two of the fasta labels to not match tree tips

        fasta_labels = ['seq1_1', 'seqX_2', 'seq2_3', 'seqY_4']

        actual_subset_results = check_tree_subset(fasta_labels,
                                                  self.sample_tree_5tips_fp)

        # Should find seqX and seqY as not being a subset

        self.assertEqual(actual_subset_results, ['seqX', 'seqY'])
    def test_check_tree_subset(self):
        """ Checks that fasta labels are a subset of tree tips properly """

        fasta_labels = ['seq1_1', 'seq1_2', 'seq2_3', 'seq3_4']

        actual_subset_results = check_tree_subset(fasta_labels,
                                                  self.sample_tree_3tips_fp)

        # Should find all and give True result

        self.assertEqual(actual_subset_results, True)

        # Should also get same results with 5 tip tree

        fasta_labels = ['seq1_1', 'seq1_2', 'seq2_3', 'seq3_4']

        actual_subset_results = check_tree_subset(fasta_labels,
                                                  self.sample_tree_5tips_fp)

        # Should find all and give True result

        self.assertEqual(actual_subset_results, True)

        # Change two of the fasta labels to not match tree tips

        fasta_labels = ['seq1_1', 'seqX_2', 'seq2_3', 'seqY_4']

        actual_subset_results = check_tree_subset(fasta_labels,
                                                  self.sample_tree_5tips_fp)

        # Should find seqX and seqY as not being a subset

        self.assertEqual(actual_subset_results, ['seqX', 'seqY'])