Deleted:calculate number of non-overlapping matches for a motif set in a XStringSet
0
0
Entering edit mode
@stefanie-tauber-3978
Last seen 3.7 years ago
Germany

Hi,

I would like to find the number of disjunct occurrences of a motif set (e.g. 3 motifs) in a given StringSet. This basically means the sequences shall be walked from left to right and looked up for matches of the motif set. If one match is identified, the next putative match can only be adjacent, not overlapping.

I thought of using multiple times gregexpr and then parse the output of gregexpr, but it seems pretty complicated to me. Does somebody know an easier way to do this?


library(Biostrings)

data(yeastSEQCHR1)
yeast1 <- DNAString(yeastSEQCHR1)

x = Views(yeast1, start = sample(length(yeast1),20), width=20)

motif_set = c("AAA", "ATT", "TTT")
# returns number of disjoint matches for a given pattern
gregexpr("AAA",x)
Biostrings patternmatch • 547 views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 1049 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6