How to find complementry sequence within the sequence
0
0
Entering edit mode
3.4 years ago

Hi,

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.

Thanks

R seqinr • 488 views
0
Entering edit mode