R/motif.find.R

Defines functions `motif.find`

`motif.find` <-
function(motif, sequence) {
  ## return indices of motif within sequence
  position <- regexpr( paste(motif, collapse=""), paste(sequence,collapse=""))
  inds <- c(position):c(position+attr(position, "match.length")-1)
  return(inds)
}

Try the bio3d package in your browser

Any scripts or data that you put into this service are public.

bio3d documentation built on Oct. 27, 2022, 1:06 a.m.