Find kmer matches in the DNA string-based subject

matchKmers(k, subject, ...)

# S4 method for character,DNAStringSet
matchKmers(k, subject, out = c("matches",
  "positions"), ranges = NULL)

# S4 method for character,character
matchKmers(k, subject, out = c("matches",
  "positions"), ranges = NULL)

# S4 method for character,DNAString
matchKmers(k, subject, out = c("matches",
  "positions"), ranges = NULL)

# S4 method for character,GenomicRanges
matchKmers(k, subject,
  genome = GenomeInfoDb::genome(subject), out = c("matches", "positions"))

# S4 method for character,RangedSummarizedExperiment
matchKmers(k, subject, ...)

# S4 method for numeric,ANY
matchKmers(k, subject, ...)

# S4 method for DNAStringSet,ANY
matchKmers(k, subject, ...)

# S4 method for DNAString,ANY
matchKmers(k, subject, ...)

Arguments

k

k

subject

either GenomicRanges, DNAStringSet, DNAString, or character vector

...

additional arguments

out

what to return? see details

ranges

if subject is not GenomicRanges, ranges to use when out is positions

genome

BSgenome object, only used if subect is GenomicRanges

Value

SummarizedExperiment with matches assay storing which peaks contain which kmers

Details

Can either return a SummarizedExperiment with just sparse matrix with values set to 1 for a match (if return == 'matches'), or a GenomicRanges object with all the positions of matches

Methods (by class)

  • k = character,subject = DNAStringSet: For DNAStringSet Objects

  • k = character,subject = character: For character strings

  • k = character,subject = DNAString: For DNA String objects

  • k = character,subject = GenomicRanges: For GenomicRanges

  • k = character,subject = RangedSummarizedExperiment: For RangedSummarizedExperiment (containing GRanges in rowRanges)

  • k = numeric,subject = ANY: Catch-all for other un-documented types

  • k = DNAStringSet,subject = ANY: Catch-all for other un-documented types with DNAStringSet

  • k = DNAString,subject = ANY: Catch-all for other un-documented types with DNAString

See also

getAnnotations, computeDeviations

Examples

# NOT RUN {
# Load very small example counts (already filtered)
data(mini_counts, package = "chromVAR")

# Get peak-kmer annotation matrix for 6mers
library(BSgenome.Hsapiens.UCSC.hg19)
kmer_ix <- matchKmers(6, mini_counts,
                       genome = BSgenome.Hsapiens.UCSC.hg19)
# }