Exemplo n.º 1
0
    def test_inter(self):
        fi = gt.FeatureIndexMemory()
        gt.FeatureStream(gt.CustomStreamExample(self.ins), fi).pull()

        f = fi.get_features_for_seqid('ctg123')
        dfi = gt.FeatureNodeIteratorDepthFirst(f[0])
        f = dfi.next()
        types = set([])
        while f:
            types.update([f.type])
            f = dfi.next()
        self.assertTrue('bar' in types, types)
Exemplo n.º 2
0
    def test_depth_first(self):
        dfi = gt.FeatureNodeIteratorDepthFirst(self.feature)

        found = dfi.next()
        self.assertEqual(found.get_attribute("ID"), "gene12")
        self.assertEqual(found.type, "gene")
        found = dfi.next()
        self.assertEqual(found.type, 'exon')
        found = dfi.next()
        self.assertEqual(found.type, 'five_prime_cis_splice_site')
        found = dfi.next()
        found = dfi.next()
        self.assertEqual(found.type, 'exon')
Exemplo n.º 3
0
    def test_dup(self):
        fi = gt.FeatureIndexMemory()
        gt.FeatureStream(gt.DuplicateFeatureStream(self.ins, "intron", "exon"),
                         fi).pull()

        f = fi.get_features_for_seqid('ctg123')
        dfi = gt.FeatureNodeIteratorDepthFirst(f[0])
        f = dfi.next()
        types = set([])
        while f:
            types.update([f.type])
            f = dfi.next()
        self.assertTrue('intron' in types, types)