コード例 #1
0
	def test_find_motif_matches_aligned_strand_r(self):
		mode = "aligned"
		motif = self.MOTIFS[0].split("-")[0] # motif = ACCACC --> rc_motif = GGTGGT
		c_REF_STR = motif_tools.comp_motif(self.REF_STR)
		strand = 1
		matches_list = read_scanner.find_motif_matches(mode,motif,c_REF_STR,strand)
		match1 = matches_list[0]
		self.assertEqual((1,7), match1.span()[:2])
コード例 #2
0
	def test_scan_motifs_aligned_r(self):
		mode = "aligned"
		strand = 1
		c_REF_STR = motif_tools.comp_motif(self.REF_STR)
		motifs = set(self.MOTIFS)
		bi_motifs = set()
		opts = data.set_opts()
		barcode, kmers = read_scanner.scan_motifs(mode, self.IPD_VALS, c_REF_STR, strand, motifs, bi_motifs, opts)
		self.assertTrue(barcode["ACCACC-0"]==(1, round(2.4,1)) and \
						barcode["TGATCA-2"]==(1, round(2.2,1)) and \
						barcode["GACNNNNNACC-1"]==(1, round(2.3,1)))
コード例 #3
0
	def test_walk_over_read_bipartite_aligned_r(self):
		mode = "aligned"
		opts = data.set_opts()
		c_REF_STR = motif_tools.comp_motif(self.REF_STR)
		motifs = set([self.MOTIFS[2]])
		subread_ipds = {}
		for motif in motifs:
			subread_ipds[motif] = []
		strand = 1
		subread_ipds = read_scanner.walk_over_read_bipartite(mode, subread_ipds, c_REF_STR, self.IPD_VALS, strand, opts)
		self.assertTrue(round(subread_ipds["GACNNNNNACC-1"][0],1)==2.3 )
コード例 #4
0
	def test_walk_over_read_aligned_r(self):
		mode = "aligned"
		opts = data.set_opts()
		c_REF_STR = motif_tools.comp_motif(self.REF_STR)
		motifs = set(self.MOTIFS[:2])
		subread_ipds = {}
		for motif in motifs:
			subread_ipds[motif] = []
		strand = 1
		k = 6
		subread_ipds = read_scanner.walk_over_read(mode, subread_ipds, c_REF_STR, self.IPD_VALS, strand, k, opts)
		self.assertTrue(round(subread_ipds["ACCACC-0"][0],1)==2.4 and \
						round(subread_ipds["TGATCA-2"][0],1)==2.2)
コード例 #5
0
ファイル: test_motif_tools.py プロジェクト: liyan910117/mbin
	def test_comp_motif(self):
		motif = "ACTTGTTACA"
		comped_motif = motif_tools.comp_motif(motif)
		self.assertEqual("TGAACAATGT",comped_motif)