scran
C++ library for basic single-cell RNA-seq analyses
|
Compute a variety of per-cell quality control metrics from a count matrix. More...
#include <PerCellQcMetrics.hpp>
Classes | |
struct | Buffers |
Buffers for direct storage of the calculated statistics. More... | |
struct | Defaults |
Default parameters. More... | |
struct | Results |
Result store for QC metric calculations. More... | |
Public Member Functions | |
PerCellQcMetrics & | set_compute_total (bool s=Defaults::compute_total) |
PerCellQcMetrics & | set_compute_detected (bool s=Defaults::compute_detected) |
PerCellQcMetrics & | set_compute_max_count (bool s=Defaults::compute_max_count) |
PerCellQcMetrics & | set_compute_max_index (bool s=Defaults::compute_max_index) |
PerCellQcMetrics & | set_compute_subset_total (bool s=Defaults::compute_subset_total) |
PerCellQcMetrics & | set_compute_subset_detected (bool s=Defaults::compute_subset_detected) |
PerCellQcMetrics & | set_num_threads (int n=Defaults::num_threads) |
template<class Matrix , typename Subset = const uint8_t*> | |
Results | run (const Matrix *mat, const std::vector< Subset > &subsets) const |
template<class Matrix , typename Subset = const uint8_t*, typename Float , typename Integer > | |
void | run (const Matrix *mat, const std::vector< Subset > &subsets, Buffers< Float, Integer > &output) const |
Compute a variety of per-cell quality control metrics from a count matrix.
Given a feature-by-cell count matrix, this class computes several QC metrics:
These calculations are done in a single pass, avoiding the need to reload data from the count matrix.
|
inline |
s | Whether to compute the total count for each cell. This option only affects the run() method that returns a Results object. |
PerCellQcMetrics
object.
|
inline |
s | Whether to compute the number of detected features for each cell. This option only affects the run() method that returns a Results object. |
PerCellQcMetrics
object.
|
inline |
s | Whether to compute the maximmum count for each cell. This option only affects the run() method that returns a Results object. |
PerCellQcMetrics
object.
|
inline |
s | Whether to store the index of the feature with the maximum count for each cell. This option only affects the run() method that returns a Results object. |
PerCellQcMetrics
object.
|
inline |
s | Whether to compute the total count in each feature subset. This option only affects the run() method that returns a Results object. |
PerCellQcMetrics
object.
|
inline |
s | Whether to compute the number of detected features in each feature subset. This option only affects the run() method that returns a Results object. |
PerCellQcMetrics
object.
|
inline |
n | Number of threads to use. |
PerCellQcMetrics
object.
|
inline |
Compute the QC metrics from an input matrix and return the results.
Matrix | Type of matrix, usually a tatami::NumericMatrix . |
Subset | Pointer to an array of values interpretable as booleans. |
mat | Pointer to a feature-by-cells tatami matrix containing counts. | |
[in] | subsets | Vector of pointers to arrays of length equal to mat->nrow() . Each array represents a feature subset and indicating whether each feature in mat belongs to that subset. Users can pass {} if no subsets are to be used. |
Results
object containing the QC metrics. Subset totals are returned depending on the subsets
.
|
inline |
Compute the QC metrics from an input matrix.
Matrix | Type of matrix, usually a tatami::NumericMatrix . |
Subset | Pointer to a type interpretable as boolean. |
mat | Pointer to a feature-by-cells matrix containing counts. | |
[in] | subsets | Vector of pointers to arrays of length equal to mat->nrow() . Each array represents a feature subset and indicating whether each feature in mat belongs to that subset. Users can pass {} if no subsets are to be used. |
[out] | output | A Buffers object in which the computed statistics are to be stored. |