I have a series of protein sequence alignments with inserts ('-' character) that need to be removed so I can search for a pattern in the sequence.
I can do this with the following SQL query:
select sequence
from sequences
where replace(sequences.sequence,"-","") like "%"+pattern+"%"
As I understand it, having the replacement and pattern matching in a query should be more efficient than looping through every sequence and doing the replacement and pattern matching in python. Is this correct?
If #1 is correct, is there a Django equivalent of that query?