This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Search for multiple Patterns in Sequences

Hi, is there a way to use matchPattern from Biostrings to search for a set of patterns rather than just one? If not is there any similar alternative?

I'm using it this so far and it doesn't work

matchPattern("TAATTAAT|ATTAATTATAATAT|ATTATA",subSeq)

and

MotifSearch<-DNAStringSet(c("TAATTAAT","ATTAATTA","TAATAT","ATTATA"))
MotifResults<-vmatchPattern(MotifSearch,subSeq)

Could searching for multiple patterns in multiple strings work too?

Thanks

pattern sequence bioconductor

1 answer

please see ?matchPDict

Doesn't seem to work if the strings in the stringset are different sizes.

centralMotifSearch<-DNAStringSet(c("TAATTAAT","ATTAATTA","TAATAT","ATTATA"))
pCentralMotifSearch<-PDict(centralMotifSearch)
Error in .Call2("ACtree2_build", tb, pp_exclude, base_codes, nodebuf_ptr,  : 
  element 3 in Trusted Band has a different length than first element

Also matchPDict doesn't seem to work with an XStringSet.

Log in to answer this question.