[Paper Review] The probability of drawing intersections: extending the hypergeometric distribution
This paper extends the hypergeometric distribution to model the intersection size when sampling without replacement from multiple urns, each containing distinct categories of objects. It derives exact probability mass functions for symmetric and asymmetric cases, shows that the two-urn case reduces to the classic hypergeometric distribution, and provides closed-form solutions for special cases with duplicates. The key contribution is a general framework for testing enrichment in multivariate biological data, implemented in the R package 'hint'.
The wide availability of biological data at the genome-scale and across multiple variables has resulted in statistical questions regarding the enrichment or depletion of the number of discrete objects (e.g. genes) identified in individual experiments. Here, I consider the problem of inferring enrichment or depletion when drawing independently, and without replacement, from two or more separate urns in which the same $n$ distinct categories of objects exist. The statistic of interest is the size of the intersection of object categories. I derive a probability mass function describing the distribution of intersection sizes when sampling from N urns and show that this distribution follows the classic hypergeometric distribution when N = 2. I apply the theory to the intersection of genes belonging to a set of traits in three different vertebrate species illustrating that the use of P-values from one-tailed enrichment tests enables accurate clustering of related traits, yet this is not possible when relying on intersection sizes alone. In addition, intersection distributions provide a means to test for co-localization of objects in images when using discretized data, allowing co-localization tests in more than two channels. Finally, I show how to extend the problem to variable numbers of objects belonging to each category, and discuss how to make further progress in this direction. The distribution functions are implemented and freely available in the R package 'hint'.
Motivation & Objective
- To develop a probability model for the size of intersection when sampling without replacement from multiple urns, each containing distinct categories of objects.
- To generalize the hypergeometric distribution to handle more than two categories and independent sampling from separate urns.
- To enable statistical inference on enrichment or depletion of shared categories in multivariate biological datasets, such as overlapping gene sets across species.
- To extend the framework to cases with variable numbers of objects per category, including duplicate entries in urns.
- To provide a computational tool for testing co-localization in multi-channel image data using discretized object positions.
Proposed method
- Derives a probability mass function for intersection size when sampling from N urns, each with n distinct categories, using combinatorial counting of valid category combinations.
- Uses trinomial coefficients and combinatorial identities to simplify expressions, showing that the two-urn, singleton case reduces to the standard hypergeometric distribution.
- Introduces an asymmetric extension by adding q duplicate categories to one urn, leading to a complex sum that lacks a closed-form solution but remains computable.
- Derives a closed-form expression for the distribution of distinct categories sampled from a single urn with duplicates in all categories, using generating functions and combinatorial identities.
- Applies the derived distributions to test for statistical significance of intersection sizes using one-tailed P-values, enabling clustering of biologically related traits.
- Implements the full framework in the open-source R package 'hint' for practical use in genomics and imaging applications.
Experimental results
Research questions
- RQ1What is the exact probability distribution of the intersection size when sampling without replacement from two or more urns, each containing n distinct categories?
- RQ2How does the intersection distribution change when one urn contains duplicate members in some categories, and can this be expressed in closed form?
- RQ3Can the derived distribution be used to detect significant enrichment of shared categories in biological datasets, such as overlapping gene sets across species?
- RQ4How does the expected number of distinct categories sampled from an urn with duplicates depend on sample size and total category count?
- RQ5Can the framework be extended to test for significant differences between two intersection distributions, such as in multi-channel image co-localization?
Key findings
- The intersection distribution for two urns, each with one object per category, is exactly the hypergeometric distribution, confirming its applicability beyond the classic single-urn setting.
- For the case with q duplicate categories in one urn, the distribution is not expressible in closed form but can be computed via a finite sum involving binomial coefficients.
- A closed-form expression is derived for the number of distinct categories sampled from a single urn with duplicates in all n categories: $ inbb{P}(X=c) = rac{inom{n}{c}inom{c}{a-c}2^{2c-a}}{inom{2n}{a}} $.
- The expected number of distinct categories sampled from an urn with duplicates in all categories is $ b{E}(X) = aig(1 - rac{a-1}{4n-2}ig) $, which is less than both a and n.
- Using one-tailed P-values from enrichment tests, the method successfully clusters biologically related traits across three vertebrate species, whereas intersection sizes alone fail to reveal true relationships.
- The framework enables statistical testing of co-localization in multi-channel imaging by modeling object intersections across discretized spatial channels.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.