Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
robomics committed Sep 24, 2023
1 parent a138acd commit 4a624fe
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/libhictk/balancing/include/hictk/balancing/ice.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace hictk::balancing {

class ICE {
std::vector<std::size_t> _chrom_offsets{};
std::vector<std::uint64_t> _chrom_offsets{};
std::vector<double> _biases{};
std::vector<double> _variance{};
std::vector<double> _scale{};
Expand Down
20 changes: 6 additions & 14 deletions src/libhictk/balancing/include/hictk/balancing/impl/ice_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,10 @@ inline void ICE::balance_cis(const MatrixT& matrix, const BinTable& bins, std::s
template <typename File>
auto ICE::construct_sparse_matrix(const File& f, Type type, std::size_t num_masked_diags)
-> SparseMatrix {
switch (type) {
case Type::cis:
return construct_sparse_matrix_cis(f, num_masked_diags);
case Type::trans:
[[fallthrough]];
case Type::gw:
return construct_sparse_matrix_gw(f, num_masked_diags);
if (type == Type::cis) {
return construct_sparse_matrix_cis(f, num_masked_diags);
}
return construct_sparse_matrix_gw(f, num_masked_diags);
}

template <typename File>
Expand Down Expand Up @@ -252,14 +248,10 @@ template <typename File>
auto ICE::construct_sparse_matrix_chunked(const File& f, Type type, std::size_t num_masked_diags,
const std::filesystem::path& tmpfile,
std::size_t chunk_size) -> SparseMatrixChunked {
switch (type) {
case Type::cis:
return construct_sparse_matrix_chunked_cis(f, num_masked_diags, tmpfile, chunk_size);
case Type::trans:
[[fallthrough]];
case Type::gw:
return construct_sparse_matrix_chunked_gw(f, num_masked_diags, tmpfile, chunk_size);
if (type == Type::cis) {
return construct_sparse_matrix_chunked_cis(f, num_masked_diags, tmpfile, chunk_size);
}
return construct_sparse_matrix_chunked_gw(f, num_masked_diags, tmpfile, chunk_size);
}

template <typename File>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class SparseMatrix {
std::vector<double> _counts{};

std::uint32_t _chrom_id{}; // ID of the chromosome that is being procesed
std::vector<std::size_t> _chrom_offsets{};
std::vector<std::size_t> _bin1_offsets{};
std::vector<std::uint64_t> _chrom_offsets{};
std::vector<std::uint64_t> _bin1_offsets{};
mutable std::vector<double> _marg{};

static constexpr auto _gw_id = std::numeric_limits<std::uint32_t>::max();
Expand Down
10 changes: 4 additions & 6 deletions src/libhictk/cooler/include/hictk/cooler/cooler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,10 @@ class File {
File(File &&other) noexcept(noexcept_move_ctor()) = default; // NOLINT

// Simple constructor. Open file in read-only mode. Automatically detects pixel count type
[[nodiscard]] explicit File(std::string_view uri,
std::size_t cache_size_bytes = DEFAULT_HDF5_CACHE_SIZE,
bool validate = true);
[[nodiscard]] explicit File(RootGroup entrypoint,
std::size_t cache_size_bytes = DEFAULT_HDF5_CACHE_SIZE,
bool validate = true);
explicit File(std::string_view uri, std::size_t cache_size_bytes = DEFAULT_HDF5_CACHE_SIZE,
bool validate = true);
explicit File(RootGroup entrypoint, std::size_t cache_size_bytes = DEFAULT_HDF5_CACHE_SIZE,
bool validate = true);

[[nodiscard]] static File open_random_access(
std::string_view uri, std::size_t cache_size_bytes = DEFAULT_HDF5_CACHE_SIZE,
Expand Down

0 comments on commit 4a624fe

Please sign in to comment.