locateKmers: Locate occurrences of specified k-mers

Description Usage Arguments Value Examples

Description

Find locations of matches of vector of k-mers in each element of a named character vector. Not case sensitive.

Usage

1
locateKmers(kmers, seqs, directional = TRUE, showMatch = FALSE)

Arguments

kmers

character vector or XStringSet of k-mers to search for

seqs

named character vector or XStringSet of sequences in which to locate kmer

directional

logical value: if FALSE, counts occurrences of either kmers or their reverse-complements. Makes sense only if applying to DNA sequences!

showMatch

logical value; if true add additional column to output indicating what the exact regex match for each occurrence (can be slow)

Value

data.frame with three columns: ‘seqid’ containing the name of the sequence from seqs in which the k-mer was found; ‘kmer’ indicating the k-mer located; and ‘location’ giving the 1-based position at which the match was found.

Examples

1
2
data(simulatedSeqs)
kmerLoci <- locateKmers(c('AAAAA', 'CATACTGAGA'), simulatedSeqs)

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