// Generated by using Rcpp::compileAttributes() -> do not edit by hand
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#include <Rcpp.h>

using namespace Rcpp;

#ifdef RCPP_USE_GLOBAL_ROSTREAM
Rcpp::Rostream<true>&  Rcpp::Rcout = Rcpp::Rcpp_cout_get();
Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get();
#endif

// classify_integrated
SEXP classify_integrated(Rcpp::RObject test, Rcpp::List results, SEXP integrated_build, double quantile, bool use_fine_tune, double fine_tune_threshold, int nthreads);
RcppExport SEXP _SingleR_classify_integrated(SEXP testSEXP, SEXP resultsSEXP, SEXP integrated_buildSEXP, SEXP quantileSEXP, SEXP use_fine_tuneSEXP, SEXP fine_tune_thresholdSEXP, SEXP nthreadsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< Rcpp::RObject >::type test(testSEXP);
    Rcpp::traits::input_parameter< Rcpp::List >::type results(resultsSEXP);
    Rcpp::traits::input_parameter< SEXP >::type integrated_build(integrated_buildSEXP);
    Rcpp::traits::input_parameter< double >::type quantile(quantileSEXP);
    Rcpp::traits::input_parameter< bool >::type use_fine_tune(use_fine_tuneSEXP);
    Rcpp::traits::input_parameter< double >::type fine_tune_threshold(fine_tune_thresholdSEXP);
    Rcpp::traits::input_parameter< int >::type nthreads(nthreadsSEXP);
    rcpp_result_gen = Rcpp::wrap(classify_integrated(test, results, integrated_build, quantile, use_fine_tune, fine_tune_threshold, nthreads));
    return rcpp_result_gen;
END_RCPP
}
// classify_single
SEXP classify_single(Rcpp::RObject test, SEXP prebuilt, double quantile, bool use_fine_tune, double fine_tune_threshold, int nthreads);
RcppExport SEXP _SingleR_classify_single(SEXP testSEXP, SEXP prebuiltSEXP, SEXP quantileSEXP, SEXP use_fine_tuneSEXP, SEXP fine_tune_thresholdSEXP, SEXP nthreadsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< Rcpp::RObject >::type test(testSEXP);
    Rcpp::traits::input_parameter< SEXP >::type prebuilt(prebuiltSEXP);
    Rcpp::traits::input_parameter< double >::type quantile(quantileSEXP);
    Rcpp::traits::input_parameter< bool >::type use_fine_tune(use_fine_tuneSEXP);
    Rcpp::traits::input_parameter< double >::type fine_tune_threshold(fine_tune_thresholdSEXP);
    Rcpp::traits::input_parameter< int >::type nthreads(nthreadsSEXP);
    rcpp_result_gen = Rcpp::wrap(classify_single(test, prebuilt, quantile, use_fine_tune, fine_tune_threshold, nthreads));
    return rcpp_result_gen;
END_RCPP
}
// find_classic_markers
Rcpp::List find_classic_markers(int nlabels, int ngenes, Rcpp::List labels, Rcpp::List ref, int de_n, int nthreads);
RcppExport SEXP _SingleR_find_classic_markers(SEXP nlabelsSEXP, SEXP ngenesSEXP, SEXP labelsSEXP, SEXP refSEXP, SEXP de_nSEXP, SEXP nthreadsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< int >::type nlabels(nlabelsSEXP);
    Rcpp::traits::input_parameter< int >::type ngenes(ngenesSEXP);
    Rcpp::traits::input_parameter< Rcpp::List >::type labels(labelsSEXP);
    Rcpp::traits::input_parameter< Rcpp::List >::type ref(refSEXP);
    Rcpp::traits::input_parameter< int >::type de_n(de_nSEXP);
    Rcpp::traits::input_parameter< int >::type nthreads(nthreadsSEXP);
    rcpp_result_gen = Rcpp::wrap(find_classic_markers(nlabels, ngenes, labels, ref, de_n, nthreads));
    return rcpp_result_gen;
END_RCPP
}
// grouped_medians
Rcpp::NumericMatrix grouped_medians(Rcpp::RObject ref, Rcpp::IntegerVector groups, int ngroups, int nthreads);
RcppExport SEXP _SingleR_grouped_medians(SEXP refSEXP, SEXP groupsSEXP, SEXP ngroupsSEXP, SEXP nthreadsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< Rcpp::RObject >::type ref(refSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type groups(groupsSEXP);
    Rcpp::traits::input_parameter< int >::type ngroups(ngroupsSEXP);
    Rcpp::traits::input_parameter< int >::type nthreads(nthreadsSEXP);
    rcpp_result_gen = Rcpp::wrap(grouped_medians(ref, groups, ngroups, nthreads));
    return rcpp_result_gen;
END_RCPP
}
// train_integrated
SEXP train_integrated(Rcpp::List test_features, Rcpp::List references, Rcpp::List ref_features, Rcpp::List labels, Rcpp::List prebuilt, int nthreads);
RcppExport SEXP _SingleR_train_integrated(SEXP test_featuresSEXP, SEXP referencesSEXP, SEXP ref_featuresSEXP, SEXP labelsSEXP, SEXP prebuiltSEXP, SEXP nthreadsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< Rcpp::List >::type test_features(test_featuresSEXP);
    Rcpp::traits::input_parameter< Rcpp::List >::type references(referencesSEXP);
    Rcpp::traits::input_parameter< Rcpp::List >::type ref_features(ref_featuresSEXP);
    Rcpp::traits::input_parameter< Rcpp::List >::type labels(labelsSEXP);
    Rcpp::traits::input_parameter< Rcpp::List >::type prebuilt(prebuiltSEXP);
    Rcpp::traits::input_parameter< int >::type nthreads(nthreadsSEXP);
    rcpp_result_gen = Rcpp::wrap(train_integrated(test_features, references, ref_features, labels, prebuilt, nthreads));
    return rcpp_result_gen;
END_RCPP
}
// train_single
SEXP train_single(Rcpp::IntegerVector test_features, Rcpp::RObject ref, Rcpp::IntegerVector ref_features, Rcpp::IntegerVector labels, Rcpp::List markers, Rcpp::RObject builder, int nthreads);
RcppExport SEXP _SingleR_train_single(SEXP test_featuresSEXP, SEXP refSEXP, SEXP ref_featuresSEXP, SEXP labelsSEXP, SEXP markersSEXP, SEXP builderSEXP, SEXP nthreadsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type test_features(test_featuresSEXP);
    Rcpp::traits::input_parameter< Rcpp::RObject >::type ref(refSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type ref_features(ref_featuresSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type labels(labelsSEXP);
    Rcpp::traits::input_parameter< Rcpp::List >::type markers(markersSEXP);
    Rcpp::traits::input_parameter< Rcpp::RObject >::type builder(builderSEXP);
    Rcpp::traits::input_parameter< int >::type nthreads(nthreadsSEXP);
    rcpp_result_gen = Rcpp::wrap(train_single(test_features, ref, ref_features, labels, markers, builder, nthreads));
    return rcpp_result_gen;
END_RCPP
}
// get_ref_subset
Rcpp::IntegerVector get_ref_subset(SEXP built);
RcppExport SEXP _SingleR_get_ref_subset(SEXP builtSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< SEXP >::type built(builtSEXP);
    rcpp_result_gen = Rcpp::wrap(get_ref_subset(built));
    return rcpp_result_gen;
END_RCPP
}
// is_valid_built
Rcpp::LogicalVector is_valid_built(SEXP built);
RcppExport SEXP _SingleR_is_valid_built(SEXP builtSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< SEXP >::type built(builtSEXP);
    rcpp_result_gen = Rcpp::wrap(is_valid_built(built));
    return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
    {"_SingleR_classify_integrated", (DL_FUNC) &_SingleR_classify_integrated, 7},
    {"_SingleR_classify_single", (DL_FUNC) &_SingleR_classify_single, 6},
    {"_SingleR_find_classic_markers", (DL_FUNC) &_SingleR_find_classic_markers, 6},
    {"_SingleR_grouped_medians", (DL_FUNC) &_SingleR_grouped_medians, 4},
    {"_SingleR_train_integrated", (DL_FUNC) &_SingleR_train_integrated, 6},
    {"_SingleR_train_single", (DL_FUNC) &_SingleR_train_single, 7},
    {"_SingleR_get_ref_subset", (DL_FUNC) &_SingleR_get_ref_subset, 1},
    {"_SingleR_is_valid_built", (DL_FUNC) &_SingleR_is_valid_built, 1},
    {NULL, NULL, 0}
};

RcppExport void R_init_SingleR(DllInfo *dll) {
    R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
    R_useDynamicSymbols(dll, FALSE);
}
