Description Usage Arguments Value Examples
Counts how often a k-mer (or vector of k-mers) occurs in each element of a character vector.
1 | kmerCounts(kmer, seqs, directional = TRUE, overlap = FALSE)
|
kmer |
character vector or XStringSet of k-mers to search for. |
seqs |
character vector or XStringSet of sequences in which to search for and count occurrences of kmer. |
directional |
logical value: if FALSE, counts occurrences of either kmer or its reverse-complement. Makes sense only if applying to DNA sequences! |
overlap |
logical value: should overlapping occurrences of kmer be counted as multiple hits? |
if length(kmer) is one, returns integer vector of counts; if length(kmer) is more than one, returns matrix of counts: one row per sequence in seqs, one column per expression in regex
1 2 3 4 5 6 7 | data(simulatedSeqs)
motifCounts <- kmerCounts('CATACTGAGA', simulatedSeqs)
otherCounts <- kmerCounts(
c('AAAAA', 'CG'),
simulatedSeqs,
directional = FALSE
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.