I have multiple sequences and I want to find the presence of complementary sequence within the sequences.
It's just like find stem-loop structure in a sequence.
Length of complementary sequences should not be greater than 5bp.
library(seqinr) g33 <- ("ATGCATATAATATAGAGGCAT") nchar(g33) a <- c2s(comp(s2c(g33))) a all(substr(a, 1, 1)== substr(c2s(comp(s2c(g33))), 20, 20))
But, what if my position go on increasing. I tried for loop but failed. I am using library(stringr) in R
Any help is much appreciated. I am a new learner of R.