83 SizeFactors_ size_factors,
88 for (
auto& x : size_factors) {
94 static_assert(std::is_floating_point<OutputValue_>::value);
95 if (
static_cast<size_t>(size_factors.size()) !=
static_cast<size_t>(counts->ncol())) {
96 throw std::runtime_error(
"length of 'size_factors' should be equal to the number of columns of 'counts'");
99 auto div = std::make_shared<tatami::DelayedUnaryIsometricOperation<OutputValue_, InputValue_, Index_> >(
101 std::make_shared<tatami::DelayedUnaryIsometricDivideVectorHelper<true, OutputValue_, InputValue_, Index_, SizeFactors_> >(std::move(size_factors),
false)
108 if (current_pseudo == 1) {
109 return std::make_shared<tatami::DelayedUnaryIsometricOperation<OutputValue_, OutputValue_, Index_> >(
111 std::make_shared<tatami::DelayedUnaryIsometricLog1pHelper<OutputValue_, OutputValue_, Index_, OutputValue_> >(options.
log_base)
114 auto add = std::make_shared<tatami::DelayedUnaryIsometricOperation<OutputValue_, OutputValue_, Index_> >(
116 std::make_shared<tatami::DelayedUnaryIsometricAddScalarHelper<OutputValue_, OutputValue_, Index_, OutputValue_> >(current_pseudo)
118 return std::make_shared<tatami::DelayedUnaryIsometricOperation<OutputValue_, OutputValue_, Index_> >(
120 std::make_shared<tatami::DelayedUnaryIsometricLogHelper<OutputValue_, OutputValue_, Index_, OutputValue_> >(options.
log_base)
std::shared_ptr< tatami::Matrix< OutputValue_, Index_ > > normalize_counts(std::shared_ptr< const tatami::Matrix< InputValue_, Index_ > > counts, SizeFactors_ size_factors, const NormalizeCountsOptions &options)
Definition normalize_counts.hpp:81