1#ifndef SINGLEPP_CLASSIFY_SINGLE_HPP
2#define SINGLEPP_CLASSIFY_SINGLE_HPP
6#include "tatami/tatami.hpp"
8#include "annotate_cells_single.hpp"
25template<
typename Float_ = DefaultFloat>
63template<
typename Label_ = DefaultLabel,
typename Float_ = DefaultFloat>
130template<
typename Value_,
typename Index_,
typename Float_,
typename Label_>
132 const tatami::Matrix<Value_, Index_>&
test,
138 throw std::runtime_error(
"number of rows in 'test' is not the same as that used to build 'trained'");
140 internal::annotate_cells_single(
171template<
typename Value_,
typename Index_,
typename Float_,
typename Label_>
173 const tatami::Matrix<Value_, Index_>&
test,
179 throw std::runtime_error(
"number of rows in 'test' is not the same as that used to build 'trained'");
181 internal::annotate_cells_single(
201template<
typename Label_ = DefaultLabel,
typename Float_ = DefaultFloat>
207 scores.reserve(num_labels);
208 for (
size_t l = 0;
l < num_labels; ++
l) {
227 std::vector<std::vector<Float_> >
scores;
241template<
typename Label_,
typename Float_>
248 output.scores.emplace_back(
s.data());
273template<
typename Label_ = DefaultLabel,
typename Value_,
typename Index_,
typename Float_>
275 const tatami::Matrix<Value_, Index_>&
test,
300template<
typename Label_ = DefaultLabel,
typename Value_,
typename Index_,
typename Float_>
302 const tatami::Matrix<Value_, Index_>&
test,
Common definitions for singlepp.
Cell type classification using the SingleR algorithm in C++.
Definition classify_single.hpp:19
std::vector< std::vector< std::vector< Index_ > > > Markers
Definition Markers.hpp:40
void classify_single_intersect(const tatami::Matrix< Value_, Index_ > &test, const TrainedSingleIntersect< Index_, Float_ > &trained, const ClassifySingleBuffers< Label_, Float_ > &buffers, const ClassifySingleOptions< Float_ > &options)
Definition classify_single.hpp:172
void classify_single(const tatami::Matrix< Value_, Index_ > &test, const TrainedSingle< Index_, Float_ > &trained, const ClassifySingleBuffers< Label_, Float_ > &buffers, const ClassifySingleOptions< Float_ > &options)
Implements the SingleR algorithm for automated annotation of single-cell RNA-seq data.
Definition classify_single.hpp:131
Output buffers for classify_single().
Definition classify_single.hpp:64
Float_ * delta
Definition classify_single.hpp:84
Label_ * best
Definition classify_single.hpp:69
std::vector< Float_ * > scores
Definition classify_single.hpp:77
Options for classify_single() and friends.
Definition classify_single.hpp:26
bool fine_tune
Definition classify_single.hpp:49
Float_ fine_tune_threshold
Definition classify_single.hpp:43
int num_threads
Definition classify_single.hpp:55
Float_ quantile
Definition classify_single.hpp:34
Results of classify_single() and classify_single_intersect().
Definition classify_single.hpp:202
std::vector< Float_ > delta
Definition classify_single.hpp:233
std::vector< Label_ > best
Definition classify_single.hpp:220
std::vector< std::vector< Float_ > > scores
Definition classify_single.hpp:227
Train a classifier from a single reference.