scran
C++ library for basic single-cell RNA-seq analyses
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
scran::SuggestAdtQcFilters::Thresholds Struct Reference

Thresholds to define outliers on each metric. More...

#include <SuggestAdtQcFilters.hpp>

Public Member Functions

template<bool overwrite = true, typename Float , typename Integer , typename Output >
void filter (size_t n, const PerCellAdtQcMetrics::Buffers< Float, Integer > &buffers, Output *output) const
 
template<typename Output = uint8_t>
std::vector< Output > filter (const PerCellAdtQcMetrics::Results &metrics) const
 
template<bool overwrite = true, typename Block , typename Float , typename Integer , typename Output >
void filter_blocked (size_t n, const Block *block, const PerCellAdtQcMetrics::Buffers< Float, Integer > &buffers, Output *output) const
 
template<typename Output = uint8_t, typename Block >
std::vector< Output > filter_blocked (const PerCellAdtQcMetrics::Results &metrics, const Block *block) const
 

Public Attributes

std::vector< double > detected
 
std::vector< std::vector< double > > subset_totals
 

Detailed Description

Thresholds to define outliers on each metric.

SuggestAdtQcFilters::run() and related methods will suggest some (hopefully) sensible thresholds based on outlier calls. Users can directly modify the thresholds in instances of this class if the default suggestions are not suitable. These thresholds can then be used to generate calls for low-quality cells via the filter() methods.

Member Function Documentation

◆ filter() [1/2]

template<bool overwrite = true, typename Float , typename Integer , typename Output >
void scran::SuggestAdtQcFilters::Thresholds::filter ( size_t  n,
const PerCellAdtQcMetrics::Buffers< Float, Integer > &  buffers,
Output *  output 
) const
inline
Template Parameters
overwriteWhether to overwrite existing truthy entries in output.
FloatFloating point type for the metrics.
IntegerInteger for the metrics.
OutputBoolean type for the low-quality calls.
Parameters
nNumber of cells.
[in]buffersPointers to arrays of length n, containing the per-cell ADT-derived metrics. These should be comparable to the values used to create this Thresholds object. Only detected and subset_totals are used; sums does not need to be set.
[out]outputPointer to an array of length n, to store the low-quality calls. Values are set to true for low-quality cells. If overwrite = true, values are set to false for high-quality cells, otherwise the existing entry is preserved.

Use filter_blocked() instead for multi-block datasets.

◆ filter() [2/2]

template<typename Output = uint8_t>
std::vector< Output > scran::SuggestAdtQcFilters::Thresholds::filter ( const PerCellAdtQcMetrics::Results metrics) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Template Parameters
OutputBoolean type for the low-quality calls.
Parameters
metricsCollection of arrays of per-cell ADT metrics. These should be comparable to the values used to create this Thresholds object. Only detected and subset_totals are used; sums does not need to be set.
Returns
Vector of low-quality calls, of length equal to the number of cells in metrics.

◆ filter_blocked() [1/2]

template<bool overwrite = true, typename Block , typename Float , typename Integer , typename Output >
void scran::SuggestAdtQcFilters::Thresholds::filter_blocked ( size_t  n,
const Block *  block,
const PerCellAdtQcMetrics::Buffers< Float, Integer > &  buffers,
Output *  output 
) const
inline
Template Parameters
BlockInteger type for the block assignments.
FloatFloating point type for the metrics.
IntegerInteger for the metrics.
OutputBoolean type for the low-quality calls.
Parameters
nNumber of cells.
[in]blockPointer to an array of length n, containing the block assignment for each cell. This may be NULL, in which case all cells are assumed to belong to the same block.
[in]buffersPointers to arrays of length n, containing the per-cell ADT-derived metrics. These should be comparable to the values used to create this Thresholds object. Only detected and subset_totals are used; sums does not need to be set.
[out]outputPointer to an array of length n, to store the low-quality calls. Values are set to true for low-quality cells. If overwrite = true, values are set to false for high-quality cells, otherwise the existing entry is preserved.

◆ filter_blocked() [2/2]

template<typename Output = uint8_t, typename Block >
std::vector< Output > scran::SuggestAdtQcFilters::Thresholds::filter_blocked ( const PerCellAdtQcMetrics::Results metrics,
const Block *  block 
) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Template Parameters
BlockInteger type for the block assignments.
OutputBoolean type for the low-quality calls.
Parameters
metricsCollection of arrays of per-cell ADT metrics. These should be comparable to the values used to create this Thresholds object. Only detected and subset_totals are used; sums does not need to be set.
[in]blockPointer to an array of length n, containing the block assignment for each cell. This may be NULL, in which case all cells are assumed to belong to the same block.
Returns
Vector of low-quality calls, of length equal to the number of cells in metrics.

Member Data Documentation

◆ detected

std::vector<double> scran::SuggestAdtQcFilters::Thresholds::detected

Lower thresholds to define small outliers on the number of detected features. Each entry contains the threshold used for the corresponding block. For unblocked analyses, this will be of length 1 as all cells are assumed to belong to the same block.

◆ subset_totals

std::vector<std::vector<double> > scran::SuggestAdtQcFilters::Thresholds::subset_totals

Upper thresholds to define large outliers on the subset totals. Each vector corresponds to a feature subset while each entry of the inner vector corresponds to a block of cells. For unblocked analyses, all cells are assumed to belong to a single block, i.e., all inner vectors have length 1.


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