Suppose I've got the sequence:
ATGCGTTATTGCATGTAGCA--------ATGGCATTACGATCCA-----CCAGGTAC
where "-" characters represent true indels
And after alignment it looks like:
----ATGCGTTATTGCATGTAGCA--------ATGGCATTACGATCCA-----CCAGGTAC------------
I've uploaded it in R using read.FASTA. Now I can extract any sequence as a vector.
My question is:
How to replace each "-" character with "?" at the beginning and at the end of the sequence while not touching true indels in the middle using R?
Thank you!