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

Compute typical per-cell quality control metrics from an RNA count matrix. More...

#include <PerCellRnaQcMetrics.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

PerCellRnaQcMetricsset_num_threads (int n=Defaults::num_threads)
 
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
 
template<class Matrix , typename Subset = const uint8_t*>
Results run (const Matrix *mat, const std::vector< Subset > &subsets) const
 

Detailed Description

Compute typical per-cell quality control metrics from an RNA count matrix.

Given a feature-by-cell RNA count matrix, this class computes several QC metrics:

This class is just a pre-configured wrapper around PerCellQcMetrics, with some careful division of the subset totals to obtain the subset proportions.

Member Function Documentation

◆ set_num_threads()

PerCellRnaQcMetrics & scran::PerCellRnaQcMetrics::set_num_threads ( int  n = Defaults::num_threads)
inline
Parameters
nNumber of threads to use.
Returns
A reference to this PerCellRnaQcMetrics object.

◆ run() [1/2]

template<class Matrix , typename Subset = const uint8_t*, typename Float , typename Integer >
void scran::PerCellRnaQcMetrics::run ( const Matrix *  mat,
const std::vector< Subset > &  subsets,
Buffers< Float, Integer > &  output 
) const
inline

Compute the QC metrics from an input matrix.

Template Parameters
MatrixType of matrix, usually a tatami::NumericMatrix.
SubsetPointer to an array of values interpretable as booleans.
FloatFloating point type to store the totals.
IntegerInteger type to store the counts and indices.
Parameters
matPointer to a feature-by-cells matrix containing counts.
[in]subsetsVector 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]outputBuffers object in which to store the output. All pointers should be set to non-NULL values.

◆ run() [2/2]

template<class Matrix , typename Subset = const uint8_t*>
Results scran::PerCellRnaQcMetrics::run ( const Matrix *  mat,
const std::vector< Subset > &  subsets 
) const
inline

Compute the QC metrics from an input matrix and return the results.

Template Parameters
MatrixType of matrix, usually a tatami::NumericMatrix.
SubsetPointer to an array of values interpretable as booleans.
Parameters
matPointer to a feature-by-cells tatami matrix containing counts.
[in]subsetsVector 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.
Returns
A PerCellRnaQcMetrics::Results object containing the QC metrics. Subset proportions are returned depending on the subsets.

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