Description Usage Arguments Value Examples
Counts how often any k-mer from a cluster of k-mers (or list of clusters of k-mers) occurs in each element of a character vector.
1 | clusterCounts(kmers, seqs, directional = TRUE, overlap = FALSE)
|
kmers |
character vector or XStringSet of k-mers composing cluster to search for, or a named list of such character vectors or XStringSet objects to count multiple clusters. |
seqs |
character vector or XStringSet of sequences in which to search for and count occurrences of kmers. |
directional |
logical value: if FALSE, counts occurrences of either cluster(s) of k-mers or their reverse-complements. Makes sense only if applying to DNA sequences! |
overlap |
logical value: should overlapping occurrences of k-mers be counted as multiple hits? |
if cluster is a single character vector or XStringSet (of any length), returns integer vector of counts; if cluster is a list of character vectors, returns matrix of counts: one row per sequence in seqs, one column per character vector/XStringSet in cluster
1 2 3 4 5 6 7 8 9 10 | seqs <- c(
line1 = "My mind's got a mind of its own",
line2 = "Takes me out to parties when I'd rather be alone",
line3 = "Takes me out a-walkin' when I'd rather be at home"
)
clusters <- list(
antisocial = c('alone', 'at home'),
mind = 'mind'
)
clCounts <- clusterCounts(clusters, seqs)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.