regexLocate: Locate occurrences of regular expression

Description Usage Arguments Value Examples

View source: R/sarks.R

Description

Find locations of matches of a regular expression (or vector of regular expressions) in each element of a named character vector. Not case sensitive.

Usage

1
regexLocate(regex, seqs, showMatch = FALSE)

Arguments

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)

Value

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.

Examples

1
2
data(simulatedSeqs)
reLoci <- regexLocate('AAAAA|TTTTT', simulatedSeqs)

sarks documentation built on Nov. 8, 2020, 6:54 p.m.