computeKmerEnrichment {transite} | R Documentation |
Compares foreground sequence set to background sequence set and computes enrichment values for each possible k-mer.
computeKmerEnrichment(foreground.kmers, background.kmers, permutation = FALSE, chisq.p.value.threshold = 0.05, p.adjust.method = "BH")
foreground.kmers |
k-mer counts of the foreground set
(generated by |
background.kmers |
k-mer counts of the background set
(generated by |
permutation |
if |
chisq.p.value.threshold |
threshold below which Fisher's exact test is used instead of Pearson's chi-squared test |
p.adjust.method |
see |
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.
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 |
Other k-mer functions: calculateKmerEnrichment
,
checkKmers
, drawVolcanoPlot
,
empiricalEnrichmentMeanCDF
,
generateKmers
,
generatePermutedEnrichments
,
homopolymerCorrection
,
permTestGeometricMean
,
runKmerSPMA
, runKmerTSMA
# 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)