I have a table that contains 2 columns, one is a id, and other is column containing long strings eg.
Id strings
1 AGTTAGGACCTTACTCTATATCTGTTCTGTTGGTATGGAG
2 GTACTTGTATTCTGATATCTAGGGTTTTCTAATTACTTCTG
3 GTATTCTCTTTCTAGCTGATCGTAATTAAATCTTATCTAA
when the user is performing a search, I would find the longest common subsequence in the search string and all the data in the table. Eg. the search sequence is
TCTGTTCTG
1. Its a 100% match, with the whole match found.
2. The LCS is TCTGTTCTG, but with some gaps.
3. The LCS is TCTGTTCT, with some gaps in BTW.
Is there a way to store the information about the match that where exactly it started finding the match and then upto where it found the match, and then where it started again and so on? So, that I can represent data in somewhat this format
First one =>
AGTTAGGACCTTACTCTATATCTGTTCTGTTGGTATGGAG
|||||||||
TCTGTTCTG
Second one =>
GTACTTGTATTCTGATATCTAGGGTTTTCTAATTACTTCTG
| || | |||||
T CT G TTCTG
Basically somehow I could store this, start and end position for each sequence for each subsequence found, so that when I show this page again in future, I don't have to compute this match again and can somehow pick out this data about start and end from database and just show this in the format shown? I know the question might be a little hazy, but please let me know how else I can elaborate if you have any doubts?