예제 #1
0
  def setUp(self):
    utils.build_ref_index()
    self.aligner = BwaAligner510()
    self.aligner.reference = utils.reference
    self.aligner.hit_visitor = type(self).SimpleVisitor()

    self.pairs = []
    with open(utils.get_fixture_path("pairs.txt")) as f:
      for line in f:
        if not line.startswith("#"): # leave #-lines for comments
          self.pairs.append(line.rstrip("\r\n").split("\t"))
예제 #2
0
	def test_make_mmap_sa(self):
		try:
			tu.build_ref_index()
			bwa.make_suffix_arrays_for_mmap(tu.reference)

			sax_name = "%s.sax" % tu.reference
			rsax_name = "%s.rsax" % tu.reference
			self.assertTrue(os.path.exists(sax_name))
			self.assertTrue(os.path.exists(rsax_name))
			# check magic
			with open(sax_name) as f:
				s = f.read(4)
				self.assertEqual(4, len(s))
				self.assertEqual(bwa.mmap_magic().value, struct.unpack("=I", s)[0])

			with open(rsax_name) as f:
				s = f.read(4)
				self.assertEqual(4, len(s))
				self.assertEqual(bwa.mmap_magic().value, struct.unpack("=I", s)[0])
		finally:
			tu.remove_ref_index()
예제 #3
0
파일: test_core.py 프로젝트: okulev/seal
    def test_make_mmap_sa(self):
        try:
            tu.build_ref_index()
            bwa.make_suffix_arrays_for_mmap(tu.reference)

            sax_name = "%s.sax" % tu.reference
            rsax_name = "%s.rsax" % tu.reference
            self.assertTrue(os.path.exists(sax_name))
            self.assertTrue(os.path.exists(rsax_name))
            # check magic
            with open(sax_name) as f:
                s = f.read(4)
                self.assertEqual(4, len(s))
                self.assertEqual(bwa.mmap_magic().value,
                                 struct.unpack("=I", s)[0])

            with open(rsax_name) as f:
                s = f.read(4)
                self.assertEqual(4, len(s))
                self.assertEqual(bwa.mmap_magic().value,
                                 struct.unpack("=I", s)[0])
        finally:
            tu.remove_ref_index()