computeKmerEnrichment {transite} | R Documentation

## k-mer Enrichment between Foreground and Background Sets

### Description

Compares foreground sequence set to background sequence set and computes enrichment values for each possible k-mer.

### Usage

    computeKmerEnrichment(foreground.kmers, background.kmers,
      permutation = FALSE, chisq.p.value.threshold = 0.05,
      p.adjust.method = "BH")

### Arguments

`foreground.kmers` | k-mer counts of the foreground set (generated by `generateKmers`)
`background.kmers` | k-mer counts of the background set (generated by `generateKmers`)
`permutation` | if `TRUE`, only the enrichment value is returned (efficiency mode used for permutation testing)
`chisq.p.value.threshold` | threshold below which Fisher's exact test is used instead of Pearson's chi-squared test
`p.adjust.method` | see `p.adjust`

### Details

Usually uses Pearson's chi-squared test, but recalculates p-values with Fisher's exact test for Pearson's chi-squared test p-values `<= chisq.p.value.threshold`. The reason this is done is computational efficiency. Fisher's exact tests are computationally demanding and are only performed in situations, where exact p-values are preferred, e.g., if expected < 5 or significant p-values.

### Value

enrichment of k-mers in specified foreground sequences. A data frame with the following columns is returned:

`foreground.count` | foreground counts for each k-mer
`background.count` | background counts for each k-mer
`enrichment` | k-mer enrichment
`p.value` | p-value of k-mer enrichment (either from Fisher's exact test or Pearson's chi-squared test)
`adj.p.value` | multiple testing corrected p-value

### See Also

Other k-mer functions: `calculateKmerEnrichment`, `checkKmers`, `drawVolcanoPlot`, `empiricalEnrichmentMeanCDF`, `generateKmers`, `generatePermutedEnrichments`, `homopolymerCorrection`, `permTestGeometricMean`, `runKmerSPMA`, `runKmerTSMA`

### Examples

    # define simple sequence sets for foreground and background
    foreground.set <- c(
      "CAACAGCCUUAAUU", "CAGUCAAGACUCC", "CUUUGGGGAAU",
      "UCAUUUUAUUAAA", "AAUUGGUGUCUGGAUACUUCCCUGUACAU",
      "AUCAAAUUA", "AGAU", "GACACUUAAAGAUCCU",
      "UAGCAUUAACUUAAUG", "AUGGA", "GAAGAGUGCUCA",
      "AUAGAC", "AGUUC", "CCAGUAA"
    )
    background.set <- c(
      "CAACAGCCUUAAUU", "CAGUCAAGACUCC", "CUUUGGGGAAU",
      "UCAUUUUAUUAAA", "AAUUGGUGUCUGGAUACUUCCCUGUACAU",
      "AUCAAAUUA", "AGAU", "GACACUUAAAGAUCCU",
      "UAGCAUUAACUUAAUG", "AUGGA", "GAAGAGUGCUCA",
      "AUAGAC", "AGUUC", "CCAGUAA",
      "UUAUUUA", "AUCCUUUACA", "UUUUUUU", "UUUCAUCAUU",
      "CCACACAC", "CUCAUUGGAG", "ACUUUGGGACA", "CAGGUCAGCA"
    )
    foreground.kmers <- generateKmers(foreground.set, 6)
    background.kmers <- generateKmers(background.set, 6)

    kmer.enrichment.values <- computeKmerEnrichment(foreground.kmers,
      background.kmers)

[Package transite version 1.2.1 Index]