From a7a23cb453d3f144f7f20cb114e4b7c312135e09 Mon Sep 17 00:00:00 2001 From: Roberto Rossini <71787608+robomics@users.noreply.github.com> Date: Thu, 7 Nov 2024 19:37:42 +0100 Subject: [PATCH] Remove dead code --- src/libnchg/include/nchg/nchg.hpp | 3 --- src/libnchg/nchg.cpp | 28 ------------------------- src/nchg/filter/filter.cpp | 35 ------------------------------- 3 files changed, 66 deletions(-) diff --git a/src/libnchg/include/nchg/nchg.hpp b/src/libnchg/include/nchg/nchg.hpp index f58fe55..6b1422b 100644 --- a/src/libnchg/include/nchg/nchg.hpp +++ b/src/libnchg/include/nchg/nchg.hpp @@ -111,9 +111,6 @@ class NCHG { [[nodiscard]] auto end(const hictk::Chromosome& chrom1, const hictk::Chromosome& chrom2) const -> IteratorVariant; - [[nodiscard]] std::pair, phmap::btree_map> - compute_expected_profile() const; - private: [[nodiscard]] static std::shared_ptr init_exp_matrix( const hictk::Chromosome& chrom1, const hictk::Chromosome& chrom2, const hictk::File& f, diff --git a/src/libnchg/nchg.cpp b/src/libnchg/nchg.cpp index e26ba9a..a62bd31 100644 --- a/src/libnchg/nchg.cpp +++ b/src/libnchg/nchg.cpp @@ -266,32 +266,4 @@ double NCHG::compute_pvalue_nchg(std::vector &buffer, std::uint64_t obs, return pvalue < 0 ? 1.0 : pvalue; } -std::pair, phmap::btree_map> -NCHG::compute_expected_profile() const { - SPDLOG_INFO("initializing expected matrix weights from genome-wide interactions..."); - - return std::visit( - [&](const auto &f) - -> std::pair, phmap::btree_map> { - const auto [selectors, merger] = ExpectedValues::init_pixel_merger_cis(f); - if (merger.begin() == merger.end()) [[unlikely]] { - phmap::btree_map scaling_factors{}; - std::ranges::transform( - f.chromosomes(), std::inserter(scaling_factors, scaling_factors.end()), - [](const hictk::Chromosome &chrom) { return std::make_pair(chrom, 1.0); }); - for (const auto &chrom : f.chromosomes()) { - scaling_factors.emplace(chrom, 1.0); - } - return {std::vector(f.bins().size(), 0), scaling_factors}; - } - - const hictk::transformers::JoinGenomicCoords mjsel(merger.begin(), merger.end(), - f.bins_ptr()); - - return ExpectedMatrixStats::build_expected_vector(mjsel, f.bins(), params().min_delta, - params().max_delta); - }, - _fp->get()); -} - } // namespace nchg diff --git a/src/nchg/filter/filter.cpp b/src/nchg/filter/filter.cpp index bd416ba..0946ca3 100644 --- a/src/nchg/filter/filter.cpp +++ b/src/nchg/filter/filter.cpp @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -47,40 +46,6 @@ namespace nchg { -struct SharedPtrStringCmp { - using is_transparent = void; - constexpr bool operator()(const std::shared_ptr& a, - const std::shared_ptr& b) const noexcept { - assert(!!a); - assert(!!b); - return *a < *b; - } - - constexpr bool operator()(const std::string& a, - const std::shared_ptr& b) const noexcept { - assert(!!b); - return a < *b; - } - - constexpr bool operator()(const std::shared_ptr& a, - const std::string& b) const noexcept { - assert(!!a); - return *a < b; - } - - constexpr bool operator()(std::string_view a, - const std::shared_ptr& b) const noexcept { - assert(!!b); - return a < *b; - } - - constexpr bool operator()(const std::shared_ptr& a, - std::string_view b) const noexcept { - assert(!!a); - return *a < b; - } -}; - struct StringPairCmp { using is_transparent = void; constexpr bool operator()(const std::pair& a,