def test_create(self): self.assertEquals(2, self.w.n_reads_per_frag) self.assertEquals(0, len(self.w)) self.assertEquals(0, self.w.n_fragments) w = rapi.read_batch(1) self.assertEquals(1, w.n_reads_per_frag)
def test_iteration_completeness_single_end(self): seqs = stuff.get_mini_ref_seqs() batch = rapi.read_batch(1) for pair in seqs: batch.append(pair[0], pair[1], pair[2], rapi.QENC_SANGER) batch.append(pair[0], pair[3], pair[4], rapi.QENC_SANGER) # test whether we iterate over all the fragments self.assertEquals(2 * len(seqs), sum(1 for frag in batch)) it = iter(batch) fragment = next(it) self.assertEquals(1, len(fragment))
def setUp(self): self.opts = rapi.opts() self.opts.share_ref_mem = False # for Travis rapi.init(self.opts) self.ref = rapi.ref(stuff.MiniRef) aligner = rapi.aligner(self.opts) self.batch = rapi.read_batch(2) reads = stuff.get_mini_ref_seqs() for row in reads: self.batch.append(row[0], row[1], row[2], rapi.QENC_SANGER) self.batch.append(row[0], row[3], row[4], rapi.QENC_SANGER) aligner.align_reads(self.ref, self.batch)
def test_n_reads_per_frag(self): self.assertEquals(2, self.w.n_reads_per_frag) w = rapi.read_batch(1) self.assertEquals(1, w.n_reads_per_frag)
def setUp(self): self.opts = rapi.opts() rapi.init(self.opts) self.w = rapi.read_batch(2)