1#ifndef SCRAN_QC_FIND_MEDIAN_MAD_H
2#define SCRAN_QC_FIND_MEDIAN_MAD_H
10#include "tatami_stats/tatami_stats.hpp"
41template<
typename Float_>
78template<
typename Index_,
typename Float_>
80 static_assert(std::is_floating_point<Float_>::value);
98 }
else if (*
copy == 0) {
99 *
copy = -std::numeric_limits<double>::infinity();
101 throw std::runtime_error(
"cannot log-transform negative values");
107 auto median = tatami_stats::medians::direct<Float_>(
metrics,
num,
false);
109 if (
options.median_only || std::isnan(median)) {
112 }
else if (std::isinf(median)) {
129 auto mad = tatami_stats::medians::direct<Float_>(
metrics,
num,
false);
152template<
typename Float_ =
double,
typename Index_,
typename Value_>
154 std::unique_ptr<std::vector<Float_> >
xbuffer;
156 xbuffer = std::make_unique<std::vector<Float_> >(
num);
171template<
typename Float_,
typename Index_>
181 template<
typename Block_>
198 template<
typename Block_>
260template<
typename Output_ =
double,
typename Index_,
typename Value_,
typename Block_>
268 std::unique_ptr<FindMedianMadWorkspace<Output_, Index_> >
xworkspace;
274 std::vector<FindMedianMadResults<Output_> >
output;
Simple quality control for single-cell data.
Definition adt_quality_control.hpp:20
FindMedianMadResults< Float_ > find_median_mad(Index_ num, Float_ *metrics, const FindMedianMadOptions &options)
Definition find_median_mad.hpp:79
std::vector< FindMedianMadResults< Output_ > > find_median_mad_blocked(Index_ num, const Value_ *metrics, const Block_ *block, FindMedianMadWorkspace< Output_, Index_ > *workspace, const FindMedianMadOptions &options)
Definition find_median_mad.hpp:261