scran
C++ library for basic single-cell RNA-seq analyses
|
Compute hypergeometric tail probabilities. More...
#include <HypergeometricTail.hpp>
Classes | |
struct | Defaults |
Default parameters. More... | |
Public Member Functions | |
HypergeometricTail & | set_log (bool l=Defaults::log) |
HypergeometricTail & | set_upper_tail (bool u=Defaults::upper_tail) |
double | run (int drawn_inside, int num_inside, int num_outside, int num_drawn) const |
Compute hypergeometric tail probabilities.
This computes the tail probabilities for the hypergeometric distribution. It is intended for use in quantifying feature set enrichment in marker lists. The "successes" are the features in the set, the "failures" are all other features, and the drawing process typically involves picking the top N markers; our aim is to compute the p-value for enrichment of features in the set among the top markers.
|
inline |
l | Whether to report log-probabilities, which avoids underflow for very small values. |
HypergeometricTail
instance.
|
inline |
u | Whether to report the upper tail, including the probability mass of the observed number of drawn white balls. This allows the tail probability to be directly used as the p-value for testing enrichment. If false , the lower tail is returned, again including the probability mass of drawn_inside . |
HypergeometricTail
instance.
|
inline |
drawn_inside | Number of genes inside the set that were drawn. |
num_inside | Total number of genes in the set. |
num_outside | Total number of genes outside the set. |
num_drawn | Number of genes that were drawn. |
drawn_inside
genes from the set, if set_upper_tail()
is set to true. Otherwise, the probability of randomly drawing no more than drawn_inside
genes from the set is returned.