コード例 #1
0
 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)
コード例 #2
0
 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)
コード例 #3
0
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)
コード例 #4
0
 def test_frequent_kmers2(self):
     dna = 'AAGCAAAGGTGGG'
     k = 2
     expected = {'AA', 'GG'}, 3
     actual = motifs.frequent_kmers(dna, k)
     self.assertEqual(expected, actual)
コード例 #5
0
 def test_frequent_kmers(self):
     dna = 'ACGTTGCATGTCGCATGATGCATGAGAGCT'
     k = 4
     expected = {'CATG', 'GCAT'}, 3
     actual = motifs.frequent_kmers(dna, k)
     self.assertEqual(expected, actual)