# Path: gffutils/merge_criteria.py
# def seqid(acc, cur, components):
# def strand(acc, cur, components):
# def feature_type(acc, cur, components):
# def exact_coordinates_only(acc, cur, components):
# def overlap_end_inclusive(acc, cur, components):
# def overlap_start_inclusive(acc, cur, components):
# def overlap_any_inclusive(acc, cur, components):
# def overlap_end_threshold(threshold):
#     def partial(acc, cur, components):
# def overlap_start_threshold(threshold):
#     def partial(acc, cur, components):
# def overlap_any_threshold(threshold):
#     def partial(acc, cur, components):
# 
# Path: gffutils/test/synth_test_base.py
# class TestWithSynthDB(TestCase):
#     def setUp(self):
#     def _dump_db(self):


from copy import deepcopy
from gffutils import merge_criteria as mc
from gffutils.test.synth_test_base import TestWithSynthDB, num_synthetic_features, num_synthetic_overlap
        self.assertEqual(len(expected_merge_children), len(merged), m_dump)
        for expected, actual in zip(expected_merge_children, merged):
            c_dump = '\n'.join(map(str, actual.children)) + '\n' + str(actual) + '\n'
            self.assertEqual(len(expected), len(actual.children), '\n'.join(map(str, [expected, actual])) + '\n')
            self.assertTrue(all(child.id in expected for child in actual.children), c_dump)

            if actual.strand != '.':
                self.assertTrue(all(f.strand == actual.strand for f in actual.children), c_dump)

            if actual.frame != '.':
                self.assertTrue(all(f.frame == actual.frame for f in actual.children), c_dump)

            if expected:
                self.assertEqual(actual.start, min(f.start for f in actual.children), c_dump)
                self.assertEqual(actual.end, max(f.end for f in actual.children), c_dump)
                if all(f.seqid == actual.children[0].seqid for f in actual.children):
                    self.assertEqual(actual.seqid, actual.children[0].seqid, c_dump)
                else:
                    self.assertEqual(set(f.seqid for f in actual.children), set(actual.seqid.split(',')), c_dump)

                if all(f.featuretype == actual.children[0].featuretype for f in actual.children):
                    self.assertTrue(all(f.featuretype == actual.featuretype for f in actual.children), c_dump)
                else:
                    self.assertEqual('sequence_feature', actual.featuretype, c_dump)

        return merged

    def test_defaults(self):
        merged = list(self.db.merge(self.db.all_features(order_by=('seqid', 'featuretype', 'strand', 'start'))))
        dump = '\n'.join(map(str, merged))

# Path: gffutils/merge_criteria.py
# def seqid(acc, cur, components):
# def strand(acc, cur, components):
# def feature_type(acc, cur, components):
# def exact_coordinates_only(acc, cur, components):
# def overlap_end_inclusive(acc, cur, components):
# def overlap_start_inclusive(acc, cur, components):
# def overlap_any_inclusive(acc, cur, components):
# def overlap_end_threshold(threshold):
#     def partial(acc, cur, components):
# def overlap_start_threshold(threshold):
#     def partial(acc, cur, components):
# def overlap_any_threshold(threshold):
#     def partial(acc, cur, components):
# 
# Path: gffutils/test/synth_test_base.py
# class TestWithSynthDB(TestCase):
#     def setUp(self):
#     def _dump_db(self):


# Path: gffutils/test/test_merge.py
from copy import deepcopy
from gffutils import merge_criteria as mc
from gffutils.test.synth_test_base import TestWithSynthDB, num_synthetic_features, num_synthetic_overlap

        self.assertEqual(len(expected_merge_children), len(merged), m_dump)
        for expected, actual in zip(expected_merge_children, merged):
            c_dump = '\n'.join(map(str, actual.children)) + '\n' + str(actual) + '\n'
            self.assertEqual(len(expected), len(actual.children), '\n'.join(map(str, [expected, actual])) + '\n')
            self.assertTrue(all(child.id in expected for child in actual.children), c_dump)

            if actual.strand != '.':
                self.assertTrue(all(f.strand == actual.strand for f in actual.children), c_dump)

            if actual.frame != '.':
                self.assertTrue(all(f.frame == actual.frame for f in actual.children), c_dump)

            if expected:
                self.assertEqual(actual.start, min(f.start for f in actual.children), c_dump)
                self.assertEqual(actual.end, max(f.end for f in actual.children), c_dump)
                if all(f.seqid == actual.children[0].seqid for f in actual.children):
                    self.assertEqual(actual.seqid, actual.children[0].seqid, c_dump)
                else:
                    self.assertEqual(set(f.seqid for f in actual.children), set(actual.seqid.split(',')), c_dump)

                if all(f.featuretype == actual.children[0].featuretype for f in actual.children):
                    self.assertTrue(all(f.featuretype == actual.featuretype for f in actual.children), c_dump)
                else:
                    self.assertEqual('sequence_feature', actual.featuretype, c_dump)

        return merged

    def test_defaults(self):
        merged = list(self.db.merge(self.db.all_features(order_by=('seqid', 'featuretype', 'strand', 'start'))))
        dump = '\n'.join(map(str, merged))

        self.assertEqual(num_synthetic_features, self.db.count_features_of_type(), dump)