diff --git a/src/libhictk/cooler/include/hictk/cooler/impl/multires_cooler_impl.hpp b/src/libhictk/cooler/include/hictk/cooler/impl/multires_cooler_impl.hpp index cbe072c7..544cba29 100644 --- a/src/libhictk/cooler/include/hictk/cooler/impl/multires_cooler_impl.hpp +++ b/src/libhictk/cooler/include/hictk/cooler/impl/multires_cooler_impl.hpp @@ -163,7 +163,7 @@ inline MultiResFile::operator bool() const noexcept { return !!_root_grp; } inline std::string MultiResFile::path() const { return (*_root_grp)().getFile().getName(); } inline auto MultiResFile::chromosomes() const noexcept -> const Reference& { - return open(_resolutions.back()).chromosomes(); + return _chroms; } [[nodiscard]] inline std::uint32_t MultiResFile::compute_base_resolution( diff --git a/test/units/cooler/multires_cooler_test.cpp b/test/units/cooler/multires_cooler_test.cpp index 05dad4c9..5fe76e92 100644 --- a/test/units/cooler/multires_cooler_test.cpp +++ b/test/units/cooler/multires_cooler_test.cpp @@ -19,6 +19,8 @@ TEST_CASE("MultiResCooler: open read-only", "[cooler][short]") { auto mclr = MultiResFile(path.string()); + CHECK(mclr.chromosomes().size() == 20); + CHECK(mclr.chromosomes().begin()->name() == "1"); CHECK(mclr.resolutions().size() == 7); CHECK(mclr.attributes().format == MCOOL_MAGIC); CHECK(mclr.attributes().format_version == 2);