I would like to develop these expressions that are in this form:
a <- "[AGAT]5GAT[AGAT]7[AGAC]6AGAT"
I would like to convert the expression like this:
b <- "AGATAGATAGATAGATAGATGATAGATAGATAGATAGATAGATAGATAGATAGACAGACAGACAGACAGACAGACAGAT"
As you can see, the number after the hook means the number of times the pattern is found.
For the moment I use sub(".*[*(.*?) *].*", "\\1", seq)
for select character between []
and replicate(i, "my_string")
for replicate sequence between []
but I do not find how to make it work with my data.
I hope to be pretty clear.