|
template<typename Data_ , typename Index_ , typename Group_ , typename Sum_ , typename Detected_ > |
void | aggregate_across_cells (const tatami::Matrix< Data_, Index_ > &input, const Group_ *const group, const AggregateAcrossCellsBuffers< Sum_, Detected_ > &buffers, const AggregateAcrossCellsOptions &options) |
|
template<typename Sum_ = double, typename Detected_ = int, typename Data_ , typename Index_ , typename Group_ > |
AggregateAcrossCellsResults< Sum_, Detected_ > | aggregate_across_cells (const tatami::Matrix< Data_, Index_ > &input, const Group_ *const group, const AggregateAcrossCellsOptions &options) |
|
template<typename Data_ , typename Index_ , typename Gene_ , typename Weight_ , typename Sum_ > |
void | aggregate_across_genes (const tatami::Matrix< Data_, Index_ > &input, const std::vector< std::tuple< std::size_t, const Gene_ *, const Weight_ * > > &gene_sets, const AggregateAcrossGenesBuffers< Sum_ > &buffers, const AggregateAcrossGenesOptions &options) |
|
template<typename Sum_ = double, typename Data_ , typename Index_ , typename Gene_ , typename Weight_ > |
AggregateAcrossGenesResults< Sum_ > | aggregate_across_genes (const tatami::Matrix< Data_, Index_ > &input, const std::vector< std::tuple< std::size_t, const Gene_ *, const Weight_ * > > &gene_sets, const AggregateAcrossGenesOptions &options) |
|
template<typename Factor_ , typename Output_ > |
std::vector< Factor_ > | clean_factor (const std::size_t n, const Factor_ *const factor, Output_ *const cleaned) |
|
template<typename Factor_ , typename Combined_ > |
std::vector< std::vector< Factor_ > > | combine_factors (const std::size_t n, const std::vector< const Factor_ * > &factors, Combined_ *const combined) |
|
template<typename Factor_ , typename Number_ , typename Combined_ > |
std::vector< std::vector< Factor_ > > | combine_factors_unused (const std::size_t n, const std::vector< std::pair< const Factor_ *, Number_ > > &factors, Combined_ *const combined) |
|
Aggregate single-cell expression values.
template<typename Data_ , typename Index_ , typename Group_ , typename Sum_ , typename Detected_ >
Aggregate expression values across groups of cells for each gene. We report the sum of expression values and the number of cells with detected (i.e., positive) expression values in each group. This is typically used to create pseudo-bulk expression profiles for cluster/sample combinations. Expression values are generally expected to be counts so that the sums can be used as if they were counts from bulk data, e.g., for differential analyses with edgeR.
- Template Parameters
-
Data_ | Type of data in the input matrix, should be numeric. |
Index_ | Integer type of index in the input matrix. |
Group_ | Integer type of the group assignments. |
Sum_ | Numeric type of the sum, often the same as Data_ . |
Detected_ | Numeric type (usually integer) of the number of detected cells. |
- Parameters
-
| input | The input matrix, usually containing non-negative counts. Rows are features and columns are cells. |
[in] | group | Pointer to an array of length equal to the number of columns of input , containing the assigned group for each cell. All entries should be integers in \([0, N)\) where \(N\) is the number of unique groups. |
| options | Further options. |
template<typename Data_ , typename Index_ , typename Gene_ , typename Weight_ , typename Sum_ >
Aggregate expression values across gene sets for each cell. This involves computing the sum/mean of expression values for any number of gene sets. The aim is to quantify the activity of signatures, pathways or regulons in each cell. Each gene in each set can also be weighted based on any a priori assumptions of their importance to the corresponding pathway.
- Template Parameters
-
Data_ | Type of data in the input matrix, should be numeric. |
Index_ | Integer type of index in the input matrix. |
Gene_ | Integer type of the indices of genes in each set. |
Weight_ | Floating-point type of the weights of genes in each set. |
Sum_ | Floating-point type of the sum. |
- Parameters
-
| input | Matrix of expression values where rows are features and columns are cells. This is usually normalized and possibly log-transformed, but the exact nature of the values depends on the application. |
| gene_sets | Vector of gene sets. Each tuple corresponds to a set and contains (i) the number of genes in the set, (ii) a pointer to the row indices of the genes in the set, and (iii) a pointer to the weights of the genes in the set. The weight pointer may be NULL , in which case all weights are set to 1. |
[out] | buffers | Collection of buffers in which to store the sum/mean for each gene set and cell. |
| options | Further options. |