Choose highly variable genes for downstream analyses.
More...
#include <ChooseHvgs.hpp>
|
ChooseHvgs & | set_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 |
|
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
.
◆ set_top()
- Parameters
-
t | The 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
-
V | Type of the variance statistic. |
T | Type to be used as a boolean. |
- Parameters
-
| n | Number of genes. |
[in] | statistic | Pointer to an array of length n containing the per-gene variance statistics. |
[out] | output | Pointer 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
-
V | Type of the variance statistic. |
T | Type to be used as a boolean. |
- Parameters
-
| n | Number of genes. |
[in] | statistic | Pointer 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: