topicks
Pick top genes for downstream analyses
Loading...
Searching...
No Matches
topicks Namespace Reference

Pick top genes from their statistics. More...

Classes

struct  PickTopGenesOptions
 Options for pick_top_genes(). More...
 
class  TopQueue
 Priority queue for retaining top genes. More...
 
struct  TopQueueOptions
 Options for TopQueue. More...
 

Functions

template<typename Stat_ , typename Bool_ >
void pick_top_genes (const std::size_t n, const Stat_ *const statistic, const std::size_t top, const bool larger, Bool_ *const output, const PickTopGenesOptions< Stat_ > &options)
 
template<typename Bool_ , typename Stat_ >
std::vector< Bool_ > pick_top_genes (const std::size_t n, const Stat_ *const statistic, const std::size_t top, const bool larger, const PickTopGenesOptions< Stat_ > &options)
 
template<typename Index_ , typename Stat_ >
std::vector< Index_ > pick_top_genes_index (const Index_ n, const Stat_ *const statistic, const Index_ top, const bool larger, const PickTopGenesOptions< Stat_ > &options)
 

Detailed Description

Pick top genes from their statistics.

Function Documentation

◆ pick_top_genes() [1/2]

template<typename Stat_ , typename Bool_ >
void topicks::pick_top_genes ( const std::size_t n,
const Stat_ *const statistic,
const std::size_t top,
const bool larger,
Bool_ *const output,
const PickTopGenesOptions< Stat_ > & options )
Template Parameters
Stat_Numeric type of the statistic for picking top genes.
Bool_Output boolean type.
Parameters
nNumber of genes.
[in]statisticPointer to an array of length n, containing the statistics with which to rank genes.
topNumber of top genes to choose.
largerWhether the top genes are defined as those with larger statistics.
[out]outputPointer to an array of length n. On output, the i-th element will be true if gene i is one of the top genes and false otherwise. Note that the actual number of chosen genes may be smaller/larger than top, depending on n and options.
optionsFurther options.

◆ pick_top_genes() [2/2]

template<typename Bool_ , typename Stat_ >
std::vector< Bool_ > topicks::pick_top_genes ( const std::size_t n,
const Stat_ *const statistic,
const std::size_t top,
const bool larger,
const PickTopGenesOptions< Stat_ > & options )
Template Parameters
Bool_Output boolean type.
Stat_Numeric type of the statistic for picking top genes.
Parameters
nNumber of genes.
[in]statisticPointer to an array of length n, containing the statistics with which to rank genes.
topNumber of top genes to choose.
largerWhether the top genes are defined as those with larger statistics.
optionsFurther options.
Returns
A vector of booleans of length n, indicating whether each gene is to be retained. Note that the actual number of chosen genes may be smaller/larger than top, depending on n and options.

◆ pick_top_genes_index()

template<typename Index_ , typename Stat_ >
std::vector< Index_ > topicks::pick_top_genes_index ( const Index_ n,
const Stat_ *const statistic,
const Index_ top,
const bool larger,
const PickTopGenesOptions< Stat_ > & options )
Template Parameters
Index_Integer type of the output indices.
Stat_Numeric type of the statistic for picking top genes.
Parameters
nNumber of genes.
[in]statisticPointer to an array of length n containing the statistics with which to rank genes.
topNumber of top genes to choose.
largerWhether the top genes are defined as those with larger statistics.
optionsFurther options.
Returns
Vector of sorted and unique indices for the chosen genes. All indices are guaranteed to be non-negative and less than n. Note that the actual number of chosen genes may be smaller/larger than top, depending on n and options.