Exemplo n.º 1
0
 def test_bed_gene_pred(self):
     g = Genome('hg19', host="localhost", user="******")
     from sqlalchemy import and_
     from cStringIO import StringIO
     query = g.knownGene.filter(and_(g.table('knownGene').c.txStart > 10000, g.table('knownGene').c.txEnd < 20000))
     c = StringIO()
     Genome.save_bed(query, c)
     c.seek(0)
     rows = c.readlines()
     for toks in (row.split("\t") for row in rows):
         self.assert_(len(toks) == 12)
         self.assert_(int(toks[1]) > 10000)
         self.assert_(int(toks[2]) < 20000)
Exemplo n.º 2
0
 def test_bed_gene_pred(self):
     g = Genome('hg19')
     from sqlalchemy import and_
     from cStringIO import StringIO
     query = g.knownGene.filter(
         and_(
             g.table('knownGene').c.txStart > 10000,
             g.table('knownGene').c.txEnd < 20000))
     c = StringIO()
     Genome.save_bed(query, c)
     c.seek(0)
     rows = c.readlines()
     for toks in (row.split("\t") for row in rows):
         self.assert_(len(toks) == 12)
         self.assert_(int(toks[1]) > 10000)
         self.assert_(int(toks[2]) < 20000)