Beispiel #1
0
 def test_fetch_decimal(self):
     first = True
     for col in self.bamfile.pileup(region="IL4:5879-5880"):
         count = 0
         for r in col.pileups:
             if first:
                 if count == self.foc:
                     self.read = r
                     first = False
                 count = count + 1
     self.assertEquals(82, ref2querypos(self.read.alignment, 5959.01))
 def test_fetch_decimal(self):
     first = True
     for col in self.bamfile.pileup(region="IL4:5879-5880"):
         count = 0
         for r in col.pileups:
             if first:
                 if count == self.foc:
                     self.read = r
                     first = False
                 count = count + 1
     self.assertEquals(82, ref2querypos(self.read.alignment, 5959.01))
 def test_get_indel_matches_pileupread_pos(self):
     first = True
     for col in self.bamfile.pileup(region="IL4:5879-5880"):
         count = 0
         for r in col.pileups:
             if first:
                 if count == self.foc:
                     self.read = r
                     first = False
                 count = count + 1
             if self.read is not None and self.read.alignment.query_name == r.alignment.query_name:
                 if not r.is_del:
                     self.assertEquals(r.query_position, ref2querypos(r.alignment, col.reference_pos))
Beispiel #4
0
 def test_get_indel_matches_pileupread_pos(self):
     first = True
     for col in self.bamfile.pileup(region="IL4:5879-5880"):
         count = 0
         for r in col.pileups:
             if first:
                 if count == self.foc:
                     self.read = r
                     first = False
                 count = count + 1
             if self.read is not None and self.read.alignment.query_name == r.alignment.query_name:
                 if not r.is_del:
                     self.assertEquals(
                         r.query_position,
                         ref2querypos(r.alignment, col.reference_pos))
Beispiel #5
0
# THIS IS GOOD CODE
read = None
foc = 0
seq = ""
first = True
for pileup_column in samfile.pileup(region="IL4:5879-5880"):
    count = 0
    for r in pileup_column.pileups:
        if first:
            if count == foc:
                read = r
                first = False
            count = count + 1
        if read is not None and read.alignment.query_name == r.alignment.query_name:
            if not r.is_del:
                print str(r.query_position) + " " + str(ref2querypos(r.alignment, pileup_column.reference_pos)) + " " + str(pileup_column.reference_pos)
print read.alignment.cigarstring
print read.alignment.query_sequence

"""
read_dict['RB40W:00428:02640'] = []


ref_spacer = []
for each column:
    max_indel = 0
    for each read:
        find max indel
    ref_spacer.append((ref_pos, max_indel))

# Now generate printing view (numeric header)