topicks
Pick top genes for downstream analyses
|
Priority queue for retaining top genes. More...
#include <TopQueue.hpp>
Public Member Functions | |
TopQueue (const Index_ top, const bool larger, const TopQueueOptions< Stat_ > &options) | |
void | push (std::pair< Stat_, Index_ > gene) |
void | emplace (Stat_ statistic, Index_ index) |
Index_ | size () const |
bool | empty () const |
const std::pair< Stat_, Index_ > & | top () const |
void | pop () |
Priority queue for retaining top genes.
Stat_ | Numeric type of the statistic for ranking top genes. |
Index_ | Integer type of gene index. |
The TopQueue
class retains the indices of the top genes, analogous to pick_top_genes_index()
. This is useful if the user does not want to store an array of statistics for all genes; instead, the statistics can be computed for each gene and added to this queue to reduce memory usage.
|
inline |
top | Number of top genes to choose. Note that the actual number of chosen genes may be smaller/larger than top , depending on the number of genes and options . |
larger | Whether the top genes are defined as those with larger statistics. |
options | Further options. |
|
inline |
gene | The statistic and the index of a gene. This is inserted into the queue if it is among the top current genes, otherwise no modification is performed. |
|
inline |
statistic | Statistic for the index -th gene. |
index | Index of the gene. |
The gene is inserted into the queue if it is among the top
current genes, otherwise no modification is performed.
|
inline |
top
if ties are included.
|
inline |
|
inline |
larger = true
) or largest (otherwise) statistic. In case of ties, the gene with the largest index is returned.This should only be called if empty()
returns false.
|
inline |
Removes the top item in the queue. This should only be called if empty()
returns false.