scran
C++ library for basic single-cell RNA-seq analyses
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
scran::HypergeometricTail Class Reference

Compute hypergeometric tail probabilities. More...

#include <HypergeometricTail.hpp>

Classes

struct  Defaults
 Default parameters. More...
 

Public Member Functions

HypergeometricTailset_log (bool l=Defaults::log)
 
HypergeometricTailset_upper_tail (bool u=Defaults::upper_tail)
 
double run (int drawn_inside, int num_inside, int num_outside, int num_drawn) const
 

Detailed Description

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.

Member Function Documentation

◆ set_log()

HypergeometricTail & scran::HypergeometricTail::set_log ( bool  l = Defaults::log)
inline
Parameters
lWhether to report log-probabilities, which avoids underflow for very small values.
Returns
A reference to this HypergeometricTail instance.

◆ set_upper_tail()

HypergeometricTail & scran::HypergeometricTail::set_upper_tail ( bool  u = Defaults::upper_tail)
inline
Parameters
uWhether 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.
Returns
A reference to this HypergeometricTail instance.

◆ run()

double scran::HypergeometricTail::run ( int  drawn_inside,
int  num_inside,
int  num_outside,
int  num_drawn 
) const
inline
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.
Returns
Probability of randomly drawing at least 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.

The documentation for this class was generated from the following file: