Skip to content

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
robomics committed Nov 7, 2024
1 parent d806811 commit a7a23cb
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 66 deletions.
3 changes: 0 additions & 3 deletions src/libnchg/include/nchg/nchg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ class NCHG {
[[nodiscard]] auto end(const hictk::Chromosome& chrom1, const hictk::Chromosome& chrom2) const
-> IteratorVariant;

[[nodiscard]] std::pair<std::vector<double>, phmap::btree_map<hictk::Chromosome, double>>
compute_expected_profile() const;

private:
[[nodiscard]] static std::shared_ptr<const ExpectedMatrixStats> init_exp_matrix(
const hictk::Chromosome& chrom1, const hictk::Chromosome& chrom2, const hictk::File& f,
Expand Down
28 changes: 0 additions & 28 deletions src/libnchg/nchg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,32 +266,4 @@ double NCHG::compute_pvalue_nchg(std::vector<double> &buffer, std::uint64_t obs,
return pvalue < 0 ? 1.0 : pvalue;
}

std::pair<std::vector<double>, phmap::btree_map<hictk::Chromosome, double>>
NCHG::compute_expected_profile() const {
SPDLOG_INFO("initializing expected matrix weights from genome-wide interactions...");

return std::visit(
[&](const auto &f)
-> std::pair<std::vector<double>, phmap::btree_map<hictk::Chromosome, double>> {
const auto [selectors, merger] = ExpectedValues::init_pixel_merger_cis(f);
if (merger.begin() == merger.end()) [[unlikely]] {
phmap::btree_map<hictk::Chromosome, double> 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<double>(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
35 changes: 0 additions & 35 deletions src/nchg/filter/filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include <future>
#include <hictk/chromosome.hpp>
#include <hictk/numeric_utils.hpp>
#include <memory>
#include <numeric>
#include <ranges>
#include <set>
Expand All @@ -47,40 +46,6 @@

namespace nchg {

struct SharedPtrStringCmp {
using is_transparent = void;
constexpr bool operator()(const std::shared_ptr<std::string>& a,
const std::shared_ptr<std::string>& b) const noexcept {
assert(!!a);
assert(!!b);
return *a < *b;
}

constexpr bool operator()(const std::string& a,
const std::shared_ptr<std::string>& b) const noexcept {
assert(!!b);
return a < *b;
}

constexpr bool operator()(const std::shared_ptr<std::string>& a,
const std::string& b) const noexcept {
assert(!!a);
return *a < b;
}

constexpr bool operator()(std::string_view a,
const std::shared_ptr<std::string>& b) const noexcept {
assert(!!b);
return a < *b;
}

constexpr bool operator()(const std::shared_ptr<std::string>& a,
std::string_view b) const noexcept {
assert(!!a);
return *a < b;
}
};

struct StringPairCmp {
using is_transparent = void;
constexpr bool operator()(const std::pair<std::string, std::string>& a,
Expand Down

0 comments on commit a7a23cb

Please sign in to comment.