View source: R/pfm_comparison.R
motifKmerSimilarity | R Documentation |
For each motif, calculate it's similarity to all k-mers of
length kmerLen
, defined as the maximal probability of observing the
k-mer given the base frequencies of the motif (the maximum is taken over
for all possible ungapped alignments between motif and k-mer). If necessary
matrices are padded on the sides with background base frequencies (assuming
all bases to have a frequency of 0.25).
motifKmerSimilarity(
x,
kmerLen = 5,
kmers = NULL,
includeRevComp = FALSE,
BPPARAM = SerialParam(),
verbose = FALSE
)
x |
Either a |
kmerLen |
A |
kmers |
Either a character vector of k-mers for which to calculate
the similarity to each motif, or |
includeRevComp |
A |
BPPARAM |
An optional |
verbose |
A logical scalar. If |
A matrix of probabilties for each motif - k-mer pair.
bplapply
used for parallelization.
m <- rbind(A = c(12, 0, 0),
C = c( 3, 2, 0),
G = c( 0, 14, 0),
T = c( 0, 0, 15))
pfms <- TFBSTools::PFMatrixList(
TFBSTools::PFMatrix(name = "m1", profileMatrix = m),
TFBSTools::PFMatrix(name = "m2", profileMatrix = m[, 3:1])
)
motifKmerSimilarity(pfms, kmerLen = 3)[, c("AGT", "TGA")]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.