Description Usage Arguments Value Author(s) Examples

This function performs enrichment analysis on two sets of matching test statistics. The circular permutation scheme accounts for possible local correlation of test statistcs. The testing is performed using the quantile thresholds provided for each data set.

For every permutation the enrichment is measure with Cramer's V coefficient. The maximum/minimum coefficient across all considered thresholds is recorded. It is then compared with the maximum/minimum coefficient observed without permuting the data.

For matching data sets calculated at different genomic locations
please use `matchDatasets`

.

1 2 3 4 5 6 7 8 | ```
enrichmentAnalysis(
pvstats1,
pvstats2,
percentiles1 = NULL,
percentiles2 = NULL,
npermute,
margin = 0.05,
threads = 1)
``` |

`pvstats1` |
The vector of statistics for primary data set. |

`pvstats2` |
The vector of statistics for auxiliary data set. |

`percentiles1` |
These quantile thresholds are used to cut off top results
in the primary data set
for matching with the top results in the auxiliary. |

`percentiles2` |
Same as |

`npermute` |
Number of permutations to perform. |

`margin` |
The minimum offset in the circular permutation to consider. |

`threads` |
The number of CPU cores to use for calculations. |

Returns a list with:

`overallPV` |
The p-values for the overall test across all thresholds. |

`byThresholdPV` |
The p-values for tests for each individual threshold. |

Andrey A Shabalin andrey.shabalin@gmail.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | ```
### Data size
n = 1e5
### Generate vectors of test statistics with local correlation
window = 1000
pvstats1 = diff(cumsum(runif(n+window)), lag = window)
pvstats2 = diff(cumsum(runif(n+window)), lag = window)
# Add a bit of dependence
pvstats1 = pvstats1 + 0.5 * pvstats2
# test top 0.1, 1, 3, 5, and 10 percent
percentiles1 = c(0.001, 0.01, 0.03, 0.05, 0.1)
percentiles2 = c(0.001, 0.01, 0.03, 0.05, 0.1)
# The offset margin
margin = 0.05
# Set the number of permutations
# to the maximum
npermute = 1e3
enr = enrichmentAnalysis(
pvstats1,
pvstats2,
percentiles1,
percentiles2,
npermute,
margin ,
threads = 2)
# View the results
enr
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.