.calcKmerEnrichment | R Documentation |
Given sequences, foreground/background labels and
weights, calculate the enrichment of each k-mer
in foreground compared to background. This function is called by
calcBinnedKmerEnr()
for each bin if background != "model"
.
The default type of test is "fisher"
.
Alternatively, a binomial test can be used by test = "binomial"
.
Using Fisher's exact test has the advantage that special cases such as
zero background counts are handled without ad-hoc adjustments to the
k-mer frequencies.
For test = "fisher"
, fisher.test
is used with
alternative = "greater"
, making it a one-sided test for enrichment,
as is the case with the binomial test.
.calcKmerEnrichment(k, df, test = c("fisher", "binomial"), verbose = FALSE)
k |
Numeric scalar giving the length of k-mers to analyze. |
df |
a |
test |
type of motif enrichment test to perform. |
verbose |
A logical scalar. If |
The function works in ZOOPS mode, which means only one or zero occurrences of a k-mer are considered per sequence. This is helpful to reduce the impact of simple sequence repeats occurring in few sequences.
A data.frame
containing the motifs as rows and the columns:
: the motif name
: the log p-value for enrichment (natural logarithm).
If test="binomial"
(default), this log p-value is identical to
the one returned by Homer.
: the weighted number of k-mer hits in foreground sequences.
: the weighted number of k-mer hits in background sequences.
: the total sum of weights of foreground sequences.
: the total sum of weights of background sequences.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.