Searching for a pattern
Let's find some occurrences of a pattern in the zikaVirus
set using vmatchPattern()
. Then, let's try the same pattern search using matchPattern()
with a single sequence, zikv
.
# For Sets
vmatchPattern(pattern = "ACATGGGCCTACCATGGGAG",
subject = zikaVirus, max.mismatch = 1)
# For single sequences
matchPattern(pattern = "ACATGGGCCTACCATGGGAG",
subject = zikv, max.mismatch = 1)
Both functions should find the same number of occurrences, but you will notice a different output. How many matches do we get when running each pattern search individually?
This exercise is part of the course
Introduction to Bioconductor in R
Hands-on interactive exercise
Turn theory into action with one of our interactive exercises
