diff --git a/src/libhictk/hic/include/hictk/hic.hpp b/src/libhictk/hic/include/hictk/hic.hpp index 8e78e51c..3832c0fe 100644 --- a/src/libhictk/hic/include/hictk/hic.hpp +++ b/src/libhictk/hic/include/hictk/hic.hpp @@ -59,6 +59,7 @@ class File { [[nodiscard]] std::uint64_t nbins() const; [[nodiscard]] std::uint64_t nchroms() const; [[nodiscard]] const std::string &assembly() const noexcept; + [[nodiscard]] const phmap::flat_hash_map &attributes() const noexcept; [[nodiscard]] const std::vector &avail_resolutions() const noexcept; [[nodiscard]] bool has_normalization(std::string_view normalization) const; [[nodiscard]] std::vector avail_normalizations() const; diff --git a/src/libhictk/hic/include/hictk/hic/impl/hic_file_impl.hpp b/src/libhictk/hic/include/hictk/hic/impl/hic_file_impl.hpp index c8feb143..7737702a 100644 --- a/src/libhictk/hic/include/hictk/hic/impl/hic_file_impl.hpp +++ b/src/libhictk/hic/include/hictk/hic/impl/hic_file_impl.hpp @@ -94,6 +94,10 @@ inline const Reference& File::chromosomes() const noexcept { return bins().chrom inline const std::string& File::assembly() const noexcept { return _fs->header().genomeID; } +inline const phmap::flat_hash_map& File::attributes() const noexcept { + return _fs->header().attributes; +} + inline const std::vector& File::avail_resolutions() const noexcept { return _fs->header().resolutions; } diff --git a/test/units/hic/hic_file_test.cpp b/test/units/hic/hic_file_test.cpp index 1f114d7b..4f7ffac5 100644 --- a/test/units/hic/hic_file_test.cpp +++ b/test/units/hic/hic_file_test.cpp @@ -39,6 +39,7 @@ TEST_CASE("HiC: file accessors", "[hic][short]") { CHECK(f.version() == 8); CHECK(f.chromosomes().size() == 9); CHECK(f.assembly() == "dm6"); + CHECK(f.attributes().at("software") == "Juicer Tools Version 1.22.01"); CHECK(f.avail_resolutions().size() == 10); CHECK(f.avail_resolutions().front() == 1'000);