-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
235 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Copyright (C) 2023 Roberto Rossini <[email protected]> | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
#include "hictkpy/hic.hpp" | ||
|
||
#include <cstdint> | ||
#include <string> | ||
#include <string_view> | ||
|
||
#include "hictk/hic.hpp" | ||
#include "hictkpy/common.hpp" | ||
|
||
namespace py = pybind11; | ||
|
||
namespace hictkpy::hic { | ||
hictk::hic::File file_ctor(std::string_view path, std::int32_t resolution, | ||
std::string_view matrix_type, std::string_view matrix_unit) { | ||
return hictk::hic::File{std::string{path}, static_cast<std::uint32_t>(resolution), | ||
hictk::hic::ParseMatrixTypeStr(std::string{matrix_type}), | ||
hictk::hic::ParseUnitStr(std::string{matrix_unit})}; | ||
} | ||
|
||
py::object fetch(const hictk::hic::File &f, std::string_view range1, std::string_view range2, | ||
std::string_view normalization, std::string_view count_type, bool join, | ||
std::string_view query_type) { | ||
return file_fetch(f, range1, range2, normalization, count_type, join, query_type); | ||
} | ||
|
||
py::object fetch_sparse(const hictk::hic::File &f, std::string_view range1, std::string_view range2, | ||
std::string_view normalization, std::string_view count_type, | ||
std::string_view query_type) { | ||
return file_fetch_sparse(f, range1, range2, normalization, count_type, query_type); | ||
} | ||
|
||
py::object fetch_dense(const hictk::hic::File &f, std::string_view range1, std::string_view range2, | ||
std::string_view normalization, std::string_view count_type, | ||
std::string_view query_type) { | ||
return file_fetch_dense(f, range1, range2, normalization, count_type, query_type); | ||
} | ||
|
||
py::object fetch_sum(const hictk::hic::File &f, std::string_view range1, std::string_view range2, | ||
std::string_view normalization, std::string_view count_type, | ||
std::string_view query_type) { | ||
return file_fetch_sum(f, range1, range2, normalization, count_type, query_type); | ||
} | ||
|
||
std::int64_t fetch_nnz(const hictk::hic::File &f, std::string_view range1, std::string_view range2, | ||
std::string_view query_type) { | ||
return file_fetch_nnz(f, range1, range2, query_type); | ||
} | ||
} // namespace hictkpy::hic |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright (C) 2023 Roberto Rossini <[email protected]> | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
#pragma once | ||
|
||
#include <pybind11/pybind11.h> | ||
|
||
#include <cstdint> | ||
#include <string> | ||
#include <string_view> | ||
#include <vector> | ||
|
||
#include "hictk/cooler/cooler.hpp" | ||
|
||
namespace hictkpy::cooler { | ||
|
||
hictk::cooler::File file_ctor(std::string_view uri); | ||
|
||
hictk::cooler::File file_ctor(std::string_view uri, const pybind11::dict &py_chroms, | ||
std::uint32_t bin_size, bool overwrite_if_exists = false); | ||
bool is_cooler(std::string_view uri); | ||
|
||
hictk::cooler::File cooler_ctor(std::string_view uri, const pybind11::dict &py_chroms, | ||
std::uint32_t bin_size, bool overwrite_if_exists = false, | ||
bool float_pixels = false); | ||
[[nodiscard]] pybind11::dict get_cooler_attrs(const hictk::cooler::File &clr); | ||
|
||
pybind11::object fetch(const hictk::cooler::File &f, std::string_view range1, | ||
std::string_view range2, std::string_view normalization, | ||
std::string_view count_type, bool join, std::string_view query_type); | ||
pybind11::object fetch_sparse(const hictk::cooler::File &f, std::string_view range1, | ||
std::string_view range2, std::string_view normalization, | ||
std::string_view count_type, std::string_view query_type); | ||
|
||
pybind11::object fetch_dense(const hictk::cooler::File &f, std::string_view range1, | ||
std::string_view range2, std::string_view normalization, | ||
std::string_view count_type, std::string_view query_type); | ||
|
||
pybind11::object fetch_sum(const hictk::cooler::File &f, std::string_view range1, | ||
std::string_view range2, std::string_view normalization, | ||
std::string_view count_type, std::string_view query_type); | ||
std::int64_t fetch_nnz(const hictk::cooler::File &f, std::string_view range1, | ||
std::string_view range2, std::string_view query_type); | ||
|
||
} // namespace hictkpy::cooler |
Oops, something went wrong.