def revc(seq):
    return ''.join([baseComplement[base] for base in seq[::-1]])
data = 'AGGGTTTCCCTGACCTTCACTGCAGGTCATGCA'
minlength = 6
n = len(data)
tree = GeneralisedSuffixTree([data, revc(data)])
for shared in tree.sharedSubstrings(minlength):
    _, start, stop = shared[0]
seq = data[start:stop]
_, rstart, rstop = shared[1]
rseq = data[n - rstop:n - rstart]
print('Match: {0} at [{1}:{2}] and {3} at [{4}:{5}]'.format(seq, start,
    stop, rseq, n - rstop, n - rstart))
Поиск перевернутого повторяющегося шаблона из последовательности FASTA с использованием python