locateClusters: Locate occurrences of specified clusters of k-mers

Description Usage Arguments Value Examples

Description

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

Usage

1
locateClusters(clusters, seqs, directional = TRUE, showMatch = FALSE)

Arguments

clusters

list of character vectors or XStringSet objects of k-mers to search for

seqs

character vector or XStringSet of sequences in which to locate kmer

directional

logical value: if FALSE, counts occurrences of either k-mers within each cluster 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 match was found; ‘cluster’ indicating the cluster from wich a k-mer was located; and ‘location’ giving the 1-based position at which the match was found.

Examples

 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'
)
clusterLoci <- locateClusters(clusters, seqs)

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