def test_frequent_kmers_hamming_reverse(self): dna = 'ACGTTGCATGTCGCATGATGCATGAGAGCT' k = 4 d = 1 expected = {'ATGT', 'ACAT'}, 9 actual = motifs.frequent_kmers(dna, k, d, True) self.assertEqual(expected, actual)
def test_frequent_kmers_hamming(self): dna = 'ACGTTGCATGTCGCATGATGCATGAGAGCT' k = 4 d = 1 expected = {'GATG', 'ATGC', 'ATGT'}, 5 actual = motifs.frequent_kmers(dna, k, d, False) self.assertEqual(expected, actual)
def find_ori(file, txt=''): if file: dna = ''.join(f.strip() for f in open(file).readlines()) # utils.plot_skew(dna) min_skew = motifs.get_min_skew_position(dna)[0] print(min_skew) L = 500 dna_box = dna[min_skew - L:min_skew + L] else: dna_box = txt k = 9 d = 1 most_freq_kmer = motifs.frequent_kmers(dna_box, k, d, True) print('Found ORI', most_freq_kmer)
def test_frequent_kmers2(self): dna = 'AAGCAAAGGTGGG' k = 2 expected = {'AA', 'GG'}, 3 actual = motifs.frequent_kmers(dna, k) self.assertEqual(expected, actual)
def test_frequent_kmers(self): dna = 'ACGTTGCATGTCGCATGATGCATGAGAGCT' k = 4 expected = {'CATG', 'GCAT'}, 3 actual = motifs.frequent_kmers(dna, k) self.assertEqual(expected, actual)