phyper
Hypergeometric tail calculations
Loading...
Searching...
No Matches
Classes | Functions
phyper Namespace Reference

Compute hypergeometric tail probabilities. More...

Classes

struct  Options
 Options for compute(). More...
 

Functions

template<typename Count_ >
double compute (Count_ drawn_inside, Count_ num_inside, Count_ num_outside, Count_ num_drawn, const Options &options)
 

Detailed Description

Compute hypergeometric tail probabilities.

Function Documentation

◆ compute()

template<typename Count_ >
double phyper::compute ( Count_  drawn_inside,
Count_  num_inside,
Count_  num_outside,
Count_  num_drawn,
const Options options 
)

Compute the tail probabilities for the hypergeometric distribution. It is intended for use in quantifying gene set enrichment in marker lists. The "successes" are the genes in the set, the "failures" are all other genes, and the drawing process typically involves picking the top N markers; our aim is to compute the p-value for enrichment of genes in the set among the top markers.

Template Parameters
Count_Integer type for the number of genes.
Parameters
drawn_insideNumber of genes inside the set that were drawn.
num_insideTotal number of genes in the set.
num_outsideTotal number of genes outside the set.
num_drawnNumber of genes that were drawn.
optionsFurther options for the calculation.
Returns
Probability of randomly drawing at least drawn_inside genes from the set, if Options::upper_tail = true. Otherwise, the probability of randomly drawing no more than drawn_inside genes from the set. These probabilities are log-transformed in Options::log = true.