Exemplo n.º 1
0
"""

import time
from cruzdb import Genome
from random import randrange, seed

#g = Genome('hg18', host='localhost', user='******')

#g.mirror(['refGene'], "sqlite:////tmp/u.db")

g = Genome('sqlite:////tmp/u.db')

# if we choose a huge distance all should have a distance of 0
#assert all(k.dist == 0  for k in  g.knearest("refGene", "chr1", 1234, 9915555, k=3))

print g.upstream("refGene", "chr1", 9444, 9555, k=6)

last = g.refGene.order_by(-g.refGene.table().c.txStart)[0]
print last
last.txStart = 1000 + last.txEnd
last.txEnd = last.txStart + 100
last.strand = "-"
print last
print g.upstream("refGene", last, k=6)

1 / 0

seed(1)

istart = 12345
iend = 386539
from random import randrange, seed

#g = Genome('hg18', host='localhost', user='******')

#g.mirror(['refGene'], "sqlite:////tmp/u.db")


g = Genome('sqlite:////tmp/u.db')



# if we choose a huge distance all should have a distance of 0
#assert all(k.dist == 0  for k in  g.knearest("refGene", "chr1", 1234, 9915555, k=3))


print g.upstream("refGene", "chr1", 9444, 9555, k=6)

last = g.refGene.order_by(-g.refGene.table().c.txStart)[0]
print last
last.txStart = 1000 + last.txEnd
last.txEnd = last.txStart + 100
last.strand = "-"
print last
print g.upstream("refGene", last, k=6)

1/0


seed(1)

istart = 12345