.calcMotifEnrichment {monaLisa}R Documentation

Calculate motif enrichment

Description

Given motif counts, foreground/background labels and weights for a set of sequences, calculate the enrichment of each motif in foreground compared to background. This function is called by calcBinnedMotifEnrR() for each bin.

The default type of test is "fisher", which is also what Homer uses if "-h" is specified for a hypergeometric test. Alternatively, a binomial test can be used by test = "binomial" (what Homer does by default). Using Fisher's exact test has the advantage that special cases such as zero background counts are handled without ad-hoc adjustments to the 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.

Usage

.calcMotifEnrichment(
  motifHitMatrix,
  df,
  test = c("fisher", "binomial"),
  verbose = FALSE
)

Arguments

motifHitMatrix

matrix with 0 and 1 entries for absence or presence of motif hits in each sequence.

df

a DataFrame with sequence information as returned by .iterativeNormForKmers().

test

type of motif enrichment test to perform.

verbose

A logical scalar. If TRUE, report on progress.

Value

a data.frame containing the motifs as rows and the columns:


[Package monaLisa version 0.99.5 Index]