1#ifndef SCRAN_PER_CELL_CRISPR_QC_METRICS_HPP
2#define SCRAN_PER_CELL_CRISPR_QC_METRICS_HPP
4#include "../utils/macros.hpp"
9#include "tatami/base/Matrix.hpp"
72 template<
typename Float =
double,
typename Integer =
int>
107 template<
class Matrix,
typename Float,
typename Integer>
109 size_t NC = mat->ncol();
122 std::vector<Float> placeholder;
124 placeholder.resize(NC);
125 tmp.
total = placeholder.data();
128 general.
run(mat, {}, tmp);
180 populate_buffers(output, *
this);
190 populate_buffers(output, *
this);
195 template<
class SomeBuffer,
class Results>
196 static void populate_buffers(SomeBuffer& x,
Results& y) {
215 template<
class Matrix>
218 auto buffers = output.
buffers();
Compute a variety of per-cell quality control metrics from a count matrix.
Compute per-cell quality control metrics from a CRISPR guide count matrix.
Definition PerCellCrisprQcMetrics.hpp:41
PerCellCrisprQcMetrics & set_num_threads(int n=Defaults::num_threads)
Definition PerCellCrisprQcMetrics.hpp:57
Results run(const Matrix *mat) const
Definition PerCellCrisprQcMetrics.hpp:216
void run(const Matrix *mat, Buffers< Float, Integer > &output) const
Definition PerCellCrisprQcMetrics.hpp:108
Compute a variety of per-cell quality control metrics from a count matrix.
Definition PerCellQcMetrics.hpp:45
PerCellQcMetrics & set_num_threads(int n=Defaults::num_threads)
Definition PerCellQcMetrics.hpp:292
Results run(const Matrix *mat, const std::vector< Subset > &subsets) const
Definition PerCellQcMetrics.hpp:313
Functions for single-cell RNA-seq analyses.
Definition AggregateAcrossCells.hpp:18
Buffers for direct storage of the calculated statistics.
Definition PerCellCrisprQcMetrics.hpp:73
Float * max_proportion
Definition PerCellCrisprQcMetrics.hpp:87
Float * sums
Definition PerCellCrisprQcMetrics.hpp:77
Integer * max_index
Definition PerCellCrisprQcMetrics.hpp:92
Integer * detected
Definition PerCellCrisprQcMetrics.hpp:82
Default parameters.
Definition PerCellCrisprQcMetrics.hpp:46
static constexpr int num_threads
Definition PerCellCrisprQcMetrics.hpp:50
Result store for QC metric calculations.
Definition PerCellCrisprQcMetrics.hpp:142
std::vector< int > detected
Definition PerCellCrisprQcMetrics.hpp:161
Buffers< const double, const int > buffers() const
Definition PerCellCrisprQcMetrics.hpp:188
Buffers buffers()
Definition PerCellCrisprQcMetrics.hpp:178
std::vector< int > max_index
Definition PerCellCrisprQcMetrics.hpp:171
std::vector< double > max_proportion
Definition PerCellCrisprQcMetrics.hpp:166
std::vector< double > sums
Definition PerCellCrisprQcMetrics.hpp:156
Buffers for direct storage of the calculated statistics.
Definition PerCellQcMetrics.hpp:111
Float * max_count
Definition PerCellQcMetrics.hpp:144
Integer * max_index
Definition PerCellQcMetrics.hpp:138
std::vector< Float * > subset_total
Definition PerCellQcMetrics.hpp:152
Integer * detected
Definition PerCellQcMetrics.hpp:132
Float * total
Definition PerCellQcMetrics.hpp:126