Is there an appropriate statistical or performance test to perform when I want to compare genomic intervals between 2 samples. Sample A is the the benchmark of comparing the intervals and sample B is the sample in question. What I am really looking for is not only how many intervals from sample B did indeed overlap with sample A but additionally what intervals from sample B has intervals that don't overlap with sample A and also those intervals in sample A that don't overlap with B and being able to measure the performance of how accurate sample B intervals overlap with sample A. This in some sense, can be translated into the following:

  1. True positive: intervals from sample B that overlap with sample A.
  2. False positive: intervals from sample B that don't overlap with sample A.
  3. False negative: intervals from sample A that don't overlap with sample B.

If I consider the above schema, then I will not be able to do any of the performance and statistical test (ROC curve or accuracy) because it is not possible to know what the true negative and the true negative are needed parameters. Then, what would should I be using to be able to incorporate the above schema and still apply performance and statistical testing.

I highly appreciate any help or pointers in advance.

  • $\begingroup$ Could you please give more context around your question? What samples? What gene? Can you provide any examples of what you're interested in? Abstract questions about hypothetical situations are not easy to answer. $\endgroup$
    – gringer
    Sep 29, 2021 at 4:08
  • $\begingroup$ Are you looking for some coding solution to get which A interval fall into B interval ? $\endgroup$ Oct 1, 2021 at 12:36
  • $\begingroup$ Please consider @MaximillianPress's for upvoting/accepting. Accepting an answer does help with site stats $\endgroup$
    – M__
    Sep 14, 2023 at 12:19

1 Answer 1


I would recommend looking into BEDtools, assuming that you are talking about genomic intervals, which I think you are based on the question. Possibly a diagram would help.

BEDtools has a suite of statistical tools for evaluating overlaps, including Fisher Exact Tests and also approaches based on the relative distance of 2 sets of intervals. So as long as your genomic intervals are defined by BED files and a genome file, this should be quite easy, e.g.

bedtools fisher -a A.bed -b B.bed -g genome_file.genome
# will print p-values for left, right, and two-tailed tests

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.