Beispiel #1
0
	def test_find_motif_matches_unaligned(self):
		mode = "unaligned"
		motif = self.MOTIFS[0].split("-")[0] # motif = ACCACC --> rc_motif = GGTGGT
		rc_REF_STR = motif_tools.rev_comp_motif(self.REF_STR)
		strand = 0
		matches_list = read_scanner.find_motif_matches(mode,motif,rc_REF_STR,strand)
		match1 = matches_list[0]
		self.assertEqual((18, 24), match1.span()[:2])
Beispiel #2
0
	def test_scan_motifs_unaligned(self):
		mode = "unaligned"
		strand = 0
		rc_REF_STR = motif_tools.rev_comp_motif(self.REF_STR)
		r_IPD_VALS = self.IPD_VALS[::-1]
		motifs = set(self.MOTIFS)
		bi_motifs = set()
		opts = data.set_opts()
		barcode, kmers = read_scanner.scan_motifs(mode, r_IPD_VALS, rc_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)))
Beispiel #3
0
	def test_walk_over_read_bipartite_unaligned(self):
		mode = "unaligned"
		opts = data.set_opts()
		rc_REF_STR = motif_tools.rev_comp_motif(self.REF_STR)
		r_IPD_VALS = self.IPD_VALS[::-1]
		motifs = set([self.MOTIFS[2]])
		subread_ipds = {}
		for motif in motifs:
			subread_ipds[motif] = []
		strand = 0
		subread_ipds = read_scanner.walk_over_read_bipartite(mode, subread_ipds, rc_REF_STR, r_IPD_VALS, strand, opts)
		self.assertTrue(round(subread_ipds["GACNNNNNACC-1"][0],1)==2.3 )
Beispiel #4
0
	def test_walk_over_read_unaligned(self):
		mode = "unaligned"
		opts = data.set_opts()
		rc_REF_STR = motif_tools.rev_comp_motif(self.REF_STR)
		r_IPD_VALS = self.IPD_VALS[::-1]
		motifs = set(self.MOTIFS[:2])
		subread_ipds = {}
		for motif in motifs:
			subread_ipds[motif] = []
		strand = 0
		k = 6
		subread_ipds = read_scanner.walk_over_read(mode, subread_ipds, rc_REF_STR, r_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)
Beispiel #5
0
	def test_rev_comp_motif(self):
		motif = "ACTTGTTACA"
		rev_comped_motif = motif_tools.rev_comp_motif(motif)
		self.assertEqual("TGTAACAAGT",rev_comped_motif)