예제 #1
0
def main():

    # Takes a series of patterns as fasta files
    # or strings and a text as fasta file or string and
    # returns the match locations by constructing a trie.

    text, patterns = parse()
    trie = trie_builder.PrefixTrieConstruction(patterns)
    match_loc = trie_builder.match_loc(text, trie)
    print('Matches at: ', match_loc)
    return match_loc
예제 #2
0
 def test_normal(self):
     text = "acgta"
     patterns = ["cg", "gta"]
     trie = trie_builder.PrefixTrieConstruction(patterns)
     val = trie_builder.match_loc(text, trie)
     self.assertEqual(val, [1, 2])