View source: R/pfm_comparison.R
motifSimilarity | R Documentation |
For each pair of motifs, calculate the similarity defined as the maximal Pearson's correlation coefficient between base frequencies over all possible shifts (relative positions of the two matrices with at least one overlapping position). If necessary matrices are padded on the sides with background base frequencies (assuming all bases to have a frequency of 0.25) to enable comparison of all positions in both matrices.
motifSimilarity(
x,
y = NULL,
method = c("R", "HOMER"),
homerfile = findHomer("compareMotifs.pl"),
homerOutfile = NULL,
BPPARAM = SerialParam(),
verbose = FALSE
)
x |
Either a |
y |
Either a |
method |
A character scalar specifying the method for similarity
calculations. Either |
homerfile |
Path to the HOMER script |
homerOutfile |
A character scalar giving the file to save the similarity
scores (only for |
BPPARAM |
An optional |
verbose |
A logical scalar. If |
A matrix of Pearson's correlation coefficients for each pair of motifs.
bplapply
used for parallelization for
method = "R"
,
documentation of HOMER's compareMotifs.pl
for details on
method = "HOMER"
.
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 + 10),
TFBSTools::PFMatrix(name = "m3", profileMatrix = m[, 3:1])
)
motifSimilarity(pfms)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.