The p-value is calculated by hypergeometric test to determine whether the peaks or features are overlapped significantly in the makeVennDiagram function. Hypergeometric test requires users to input an estimate of the total potential binding sites (peaks) for a given TF. To circumvent this requirement, a permutation test function called
permTest has also been implemented in ChIPpeakAnno package.
Here is an example: