Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: a0f9d13da8
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 112 lines (89 sloc) 2.642 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
import caper
#bundle_path = '/scratch2/rose/capertestdata/out/s_1_sequence.map.trim3-20.bundle'
#contig = 'Contig0'

bundle_path = 'data/cache/REL606-maq-map.txt.bundle'
contig = 'rel606'
engine = caper.mapping_container(bundle_path)


print "ENGINE"
print "------"

print "GET READ LENGTH"

length = engine.get_read_length()
print length

print
print "GET READS"

reads = engine.get_reads(contig,13)
for item in reads:
    print item

print
print "GET INTERSECT"

inte = engine.get_intersect(contig,4)
for item in inte:
    for read in item[4]:
        print read

print
print "GET SLICE TEST"
slice = engine.get_slice(contig,0, 5)
for ival_start, ival_stop, start, stop, matches in slice:
    for index, name, sequence, orientation in matches:
        print index, name, sequence, orientation

print
print "ITERATOR"
print "--------"

print
print "ITERATOR: GET READS"
iter = engine.get_iterator(contig,0)
for i in range(10):
    x = iter.get_reads()
    print "Iterator Index: ", iter.current
    for index, name, sequence, orientation in x:
        print index, name, sequence, orientation
    iter.next()

print
print "ITERATOR: GET INTERSECTION"
iter = engine.get_iterator(contig,0)
for i in range(10):
    x = iter.get_intersection()
    print
    print "Iterator Index: ", iter.current
    for ival_start, ival_stop, slice_start, slice_stop, reads in x:
        for index, name, sequence, orientation in reads:
            print index, name, sequence, orientation

    iter.next()

print
print "ITERATOR: SET, GET INTERSECTION"
iter = engine.get_iterator(contig,5)
x = iter.get_intersection()
print
print "Iterator Index: ", iter.current
for ival_start, ival_stop, slice_start, slice_stop, reads in x:
    for index, name, sequence, orientation in reads:
        print index, name, sequence, orientation

print
print "SLICE ITERATOR"
print "--------------"

print
print "SLICE ITERATOR: GET READS"
slice_iter = engine.get_slice_iterator(contig,5)
for i in range(10):
    x = slice_iter.get_reads()
    print "Slice Iterator Index: ", slice_iter.current
    for ival_start, ival_stop, slice_start, slice_stop, reads in x:
        for index, name, sequence, orientation in reads:
            print index, name, sequence, orientation
    slice_iter.next()

#for i in range(10):
# reads = iter.get_reads()
# for item in reads:
# print item.NameP()

#m = x.get_reads_at("Contig0", 0, 1050)
#print m.seqname, m.start, m.stop
#print 'length:', len(m)

#for i in m:
# print i

###

#if 0:
# import time
# for i in range(100):
# print i
# for j in range(10000):
# x.get_reads_at("rel606", 0, 50)
Something went wrong with that request. Please try again.