Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement bins_ptr() accessor for cooler::SingleCellFile() #298

Merged
merged 2 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/cpp_api/cooler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ Single-cell Cooler (.scool)
.. cpp:function:: [[nodiscard]] std::string path() const;
.. cpp:function:: [[nodiscard]] auto chromosomes() const noexcept -> const Reference&;
.. cpp:function:: [[nodiscard]] auto bins() const noexcept -> const BinTable&;
.. cpp:function:: [[nodiscard]] auto bins_ptr() const noexcept -> std::shared_ptr<const BinTable>;
.. cpp:function:: [[nodiscard]] std::uint32_t resolution() const noexcept;

.. cpp:function:: [[nodiscard]] constexpr const phmap::btree_set<std::string>& cells() const noexcept;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,10 @@ inline SingleCellFile::operator bool() const noexcept { return !!_root_grp; }

inline std::string SingleCellFile::path() const { return (*_root_grp)().getFile().getName(); }

inline auto SingleCellFile::bins() const noexcept -> const BinTable& { return *_bins; }
inline auto SingleCellFile::bins() const noexcept -> const BinTable& { return *bins_ptr(); }
inline auto SingleCellFile::bins_ptr() const noexcept -> std::shared_ptr<const BinTable> {
return _bins;
}
inline std::uint32_t SingleCellFile::resolution() const noexcept { return bins().resolution(); }
inline auto SingleCellFile::chromosomes() const noexcept -> const Reference& {
return bins().chromosomes();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class SingleCellFile {
[[nodiscard]] std::string path() const;
[[nodiscard]] auto chromosomes() const noexcept -> const Reference&;
[[nodiscard]] auto bins() const noexcept -> const BinTable&;
[[nodiscard]] auto bins_ptr() const noexcept -> std::shared_ptr<const BinTable>;
[[nodiscard]] std::uint32_t resolution() const noexcept;

[[nodiscard]] HighFive::File file_handle();
Expand Down
Loading