regexLocate {sarks} | R Documentation |
Find locations of matches of a regular expression (or vector of regular expressions) in each element of a named character vector. Not case sensitive.
regexLocate(regex, seqs, showMatch = FALSE)
regex |
character vector or XStringSet of regular expressions to search for |
seqs |
named character vector or XStringSet of sequences in which to locate regex |
showMatch |
logical value; if true add additional column to output indicating what the exact regex match for each occurrence (can be slow) |
If only a single regex is searched for: data.frame with two columns: ‘seqid’ containing the name of the sequence from seqs in which the regex was found and ‘location’ giving the 1-based position at which the regex was found. If length(regex) greater than one, adds additional column ‘regex’ indicating the name of the regex located.
data(simulatedSeqs) reLoci <- regexLocate('AAAAA|TTTTT', simulatedSeqs)