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

Choose highly variable genes for downstream analyses. More...

#include <ChooseHvgs.hpp>

Classes

struct  Defaults
 Default paramater settings. More...
 

Public Member Functions

ChooseHvgsset_top (size_t t=Defaults::top)
 
template<typename V , typename T >
void run (size_t n, const V *statistic, T *output) const
 
template<typename T = uint8_t, typename V >
std::vector< T > run (size_t n, const V *statistic) const
 

Detailed Description

Choose highly variable genes for downstream analyses.

This is done by selecting the top number of genes with the largest values for a precomputed variance statistic. We typically use the residual from the trend as computed by ModelGeneVar.

Member Function Documentation

◆ set_top()

ChooseHvgs & scran::ChooseHvgs::set_top ( size_t  t = Defaults::top)
inline
Parameters
tThe number of top genes to consider as highly variable genes.
Returns
A reference to this ChooseHvgs object.

The choice is more or less arbitrary and is a trade-off between capturing more biological signal at the cost of increasing noise. Values of 1000-5000 seem appropriate for most use cases. Note that increasing the number of genes will also increase the size of the subdataset to be used in downstream computation.

◆ run() [1/2]

template<typename V , typename T >
void scran::ChooseHvgs::run ( size_t  n,
const V *  statistic,
T *  output 
) const
inline

Choose HVGs to use in downstream analyses.

Template Parameters
VType of the variance statistic.
TType to be used as a boolean.
Parameters
nNumber of genes.
[in]statisticPointer to an array of length n containing the per-gene variance statistics.
[out]outputPointer to an array of length n, used to store a boolean flag. On completion, output is filled with true if the gene is to be retained and false otherwise.

◆ run() [2/2]

template<typename T = uint8_t, typename V >
std::vector< T > scran::ChooseHvgs::run ( size_t  n,
const V *  statistic 
) const
inline
Template Parameters
VType of the variance statistic.
TType to be used as a boolean.
Parameters
nNumber of genes.
[in]statisticPointer to an array of length n containing the per-gene variance statistics.
Returns
A vector of booleans of length n, indicating whether each gene is to be retained.

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