diff --git a/BA9F.py b/BA9F.py index 9e84e58..84f4354 100644 --- a/BA9F.py +++ b/BA9F.py @@ -17,12 +17,30 @@ import argparse from helpers import read_strings -#from snp import SuffixTree +from snp import SuffixArray import time +from numpy import argmin -def FindLongestRepeat(string): - pass - +def FindShortestNonShared(s,t): + text = s + '$' + t + '#' + r,p,lcp = SuffixArray(text,auxiliary=True,padLCP=True) + Candidates = [] + Rejects = [] + for i in range(len(r)): + if r[i]<= len(s)+ 2: + Candidates.append((i,text[r[i]:])) + print (f'{i:2d} {r[i]:2d} {lcp[i]:2d} {l} {text[r[i]:]}') + Pairs = [] + previous_from_s = False + for i in range(len(lcp)): + from_s = r[i]