Skip to content
Open
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
12 changes: 10 additions & 2 deletions bdsg/cmake_bindings/bdsg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@

using ModuleGetter = std::function< pybind11::module & (std::string const &) >;

void bind_std_basic_string(std::function< pybind11::module &(std::string const &namespace_) > &M);
void bind_std_stl_function(std::function< pybind11::module &(std::string const &namespace_) > &M);
void bind_handlegraph_types(std::function< pybind11::module &(std::string const &namespace_) > &M);
void bind_handlegraph_handle_graph(std::function< pybind11::module &(std::string const &namespace_) > &M);
void bind_std_unordered_set(std::function< pybind11::module &(std::string const &namespace_) > &M);
void bind_handlegraph_path_metadata(std::function< pybind11::module &(std::string const &namespace_) > &M);
void bind_handlegraph_path_handle_graph(std::function< pybind11::module &(std::string const &namespace_) > &M);
void bind_std_bdsg_internal_binder_hook_bind(std::function< pybind11::module &(std::string const &namespace_) > &M);
Expand All @@ -29,11 +32,12 @@ void bind_bdsg_internal_eades_algorithm(std::function< pybind11::module &(std::s
void bind_bdsg_internal_base_packed_graph(std::function< pybind11::module &(std::string const &namespace_) > &M);
void bind_handlegraph_path_position_handle_graph(std::function< pybind11::module &(std::string const &namespace_) > &M);
void bind_bdsg_overlays_packed_path_position_overlay(std::function< pybind11::module &(std::string const &namespace_) > &M);
void bind_bdsg_overlays_packed_reference_path_overlay(std::function< pybind11::module &(std::string const &namespace_) > &M);
void bind_bdsg_overlays_packed_path_position_overlay_1(std::function< pybind11::module &(std::string const &namespace_) > &M);
void bind_bdsg_overlays_path_position_overlays(std::function< pybind11::module &(std::string const &namespace_) > &M);
void bind_bdsg_overlays_path_subgraph_overlay(std::function< pybind11::module &(std::string const &namespace_) > &M);
void bind_bdsg_overlays_reference_path_overlay(std::function< pybind11::module &(std::string const &namespace_) > &M);
void bind_bdsg_overlays_vectorizable_overlays(std::function< pybind11::module &(std::string const &namespace_) > &M);
void bind_bdsg_overlays_vectorizable_overlays_1(std::function< pybind11::module &(std::string const &namespace_) > &M);
void bind_handlegraph_trivially_serializable(std::function< pybind11::module &(std::string const &namespace_) > &M);
void bind_bdsg_packed_graph(std::function< pybind11::module &(std::string const &namespace_) > &M);
void bind_bdsg_snarl_distance_index(std::function< pybind11::module &(std::string const &namespace_) > &M);
Expand Down Expand Up @@ -70,8 +74,11 @@ PYBIND11_MODULE(bdsg, root_module) {

//pybind11::class_<std::shared_ptr<void>>(M(""), "_encapsulated_data_");

bind_std_basic_string(M);
bind_std_stl_function(M);
bind_handlegraph_types(M);
bind_handlegraph_handle_graph(M);
bind_std_unordered_set(M);
bind_handlegraph_path_metadata(M);
bind_handlegraph_path_handle_graph(M);
bind_std_bdsg_internal_binder_hook_bind(M);
Expand All @@ -90,11 +97,12 @@ PYBIND11_MODULE(bdsg, root_module) {
bind_bdsg_internal_base_packed_graph(M);
bind_handlegraph_path_position_handle_graph(M);
bind_bdsg_overlays_packed_path_position_overlay(M);
bind_bdsg_overlays_packed_reference_path_overlay(M);
bind_bdsg_overlays_packed_path_position_overlay_1(M);
bind_bdsg_overlays_path_position_overlays(M);
bind_bdsg_overlays_path_subgraph_overlay(M);
bind_bdsg_overlays_reference_path_overlay(M);
bind_bdsg_overlays_vectorizable_overlays(M);
bind_bdsg_overlays_vectorizable_overlays_1(M);
bind_handlegraph_trivially_serializable(M);
bind_bdsg_packed_graph(M);
bind_bdsg_snarl_distance_index(M);
Expand Down
6 changes: 5 additions & 1 deletion bdsg/cmake_bindings/bdsg.sources
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
bdsg.cpp
std/basic_string.cpp
std/stl_function.cpp
handlegraph/types.cpp
handlegraph/handle_graph.cpp
std/unordered_set.cpp
handlegraph/path_metadata.cpp
handlegraph/path_handle_graph.cpp
std/bdsg/internal/binder_hook_bind.cpp
Expand All @@ -19,11 +22,12 @@ bdsg/internal/eades_algorithm.cpp
bdsg/internal/base_packed_graph.cpp
handlegraph/path_position_handle_graph.cpp
bdsg/overlays/packed_path_position_overlay.cpp
bdsg/overlays/packed_reference_path_overlay.cpp
bdsg/overlays/packed_path_position_overlay_1.cpp
bdsg/overlays/path_position_overlays.cpp
bdsg/overlays/path_subgraph_overlay.cpp
bdsg/overlays/reference_path_overlay.cpp
bdsg/overlays/vectorizable_overlays.cpp
bdsg/overlays/vectorizable_overlays_1.cpp
handlegraph/trivially_serializable.cpp
bdsg/packed_graph.cpp
bdsg/snarl_distance_index.cpp
1 change: 1 addition & 0 deletions bdsg/cmake_bindings/bdsg/internal/base_packed_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ void bind_bdsg_internal_base_packed_graph(std::function< pybind11::module &(std:
cl.def("get_subrange", (struct std::pair<unsigned long, unsigned long> (bdsg::BasePackedGraph<bdsg::STLBackend>::*)(const struct handlegraph::path_handle_t &) const) &bdsg::BasePackedGraph<>::get_subrange, "C++: bdsg::BasePackedGraph<>::get_subrange(const struct handlegraph::path_handle_t &) const --> struct std::pair<unsigned long, unsigned long>", pybind11::arg("handle"));
cl.def("create_path", [](bdsg::BasePackedGraph<bdsg::STLBackend> &o, const enum handlegraph::PathSense & a0, const std::string & a1, const std::string & a2, const unsigned long & a3, const unsigned long & a4, const struct std::pair<unsigned long, unsigned long> & a5) -> handlegraph::path_handle_t { return o.create_path(a0, a1, a2, a3, a4, a5); }, "", pybind11::arg("sense"), pybind11::arg("sample"), pybind11::arg("locus"), pybind11::arg("haplotype"), pybind11::arg("phase_block"), pybind11::arg("subrange"));
cl.def("create_path", (struct handlegraph::path_handle_t (bdsg::BasePackedGraph<bdsg::STLBackend>::*)(const enum handlegraph::PathSense &, const std::string &, const std::string &, const unsigned long &, const unsigned long &, const struct std::pair<unsigned long, unsigned long> &, bool)) &bdsg::BasePackedGraph<>::create_path, "C++: bdsg::BasePackedGraph<>::create_path(const enum handlegraph::PathSense &, const std::string &, const std::string &, const unsigned long &, const unsigned long &, const struct std::pair<unsigned long, unsigned long> &, bool) --> struct handlegraph::path_handle_t", pybind11::arg("sense"), pybind11::arg("sample"), pybind11::arg("locus"), pybind11::arg("haplotype"), pybind11::arg("phase_block"), pybind11::arg("subrange"), pybind11::arg("is_circular"));
cl.def("for_each_path_matching", (bool (bdsg::BasePackedGraph<bdsg::STLBackend>::*)(const class std::unordered_set<enum handlegraph::PathSense> *, const class std::unordered_set<std::string > *, const class std::unordered_set<std::string > *, const class std::function<bool (const struct handlegraph::path_handle_t &)> &) const) &bdsg::BasePackedGraph<>::for_each_path_matching, "C++: bdsg::BasePackedGraph<>::for_each_path_matching(const class std::unordered_set<enum handlegraph::PathSense> *, const class std::unordered_set<std::string > *, const class std::unordered_set<std::string > *, const class std::function<bool (const struct handlegraph::path_handle_t &)> &) const --> bool", pybind11::arg("senses"), pybind11::arg("samples"), pybind11::arg("loci"), pybind11::arg("iteratee"));
cl.def("for_each_step_of_sense", (bool (bdsg::BasePackedGraph<bdsg::STLBackend>::*)(const struct handlegraph::handle_t &, const enum handlegraph::PathSense &, const class std::function<bool (const struct handlegraph::step_handle_t &)> &) const) &bdsg::BasePackedGraph<>::for_each_step_of_sense, "C++: bdsg::BasePackedGraph<>::for_each_step_of_sense(const struct handlegraph::handle_t &, const enum handlegraph::PathSense &, const class std::function<bool (const struct handlegraph::step_handle_t &)> &) const --> bool", pybind11::arg("visited"), pybind11::arg("sense"), pybind11::arg("iteratee"));
cl.def("get_magic_number", (unsigned int (bdsg::BasePackedGraph<bdsg::STLBackend>::*)() const) &bdsg::BasePackedGraph<>::get_magic_number, "C++: bdsg::BasePackedGraph<>::get_magic_number() const --> unsigned int");
cl.def("deserialize", (void (bdsg::BasePackedGraph<bdsg::STLBackend>::*)(const std::string &)) &bdsg::BasePackedGraph<>::deserialize, "C++: bdsg::BasePackedGraph<>::deserialize(const std::string &) --> void", pybind11::arg("filename"));
Expand Down
15 changes: 15 additions & 0 deletions bdsg/cmake_bindings/bdsg/internal/hash_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include <sstream> // __str__
#include <streambuf>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

Expand Down Expand Up @@ -967,6 +969,19 @@ struct PyCallBack_bdsg_HashGraph : public bdsg::HashGraph {
}
return PathMetadata::get_subrange(a0);
}
bool for_each_path_matching_impl(const class std::unordered_set<enum handlegraph::PathSense> * a0, const class std::unordered_set<std::string > * a1, const class std::unordered_set<std::string > * a2, const class std::function<bool (const struct handlegraph::path_handle_t &)> & a3) const override {
pybind11::gil_scoped_acquire gil;
pybind11::function overload = pybind11::get_overload(static_cast<const bdsg::HashGraph *>(this), "for_each_path_matching_impl");
if (overload) {
auto o = overload.operator()<pybind11::return_value_policy::reference>(a0, a1, a2, a3);
if (pybind11::detail::cast_is_temporary_value_reference<bool>::value) {
static pybind11::detail::override_caster_t<bool> caster;
return pybind11::detail::cast_ref<bool>(std::move(o), caster);
}
return pybind11::detail::cast_safe<bool>(std::move(o));
}
return PathMetadata::for_each_path_matching_impl(a0, a1, a2, a3);
}
bool for_each_step_of_sense_impl(const struct handlegraph::handle_t & a0, const enum handlegraph::PathSense & a1, const class std::function<bool (const struct handlegraph::step_handle_t &)> & a2) const override {
pybind11::gil_scoped_acquire gil;
pybind11::function overload = pybind11::get_overload(static_cast<const bdsg::HashGraph *>(this), "for_each_step_of_sense_impl");
Expand Down
38 changes: 17 additions & 21 deletions bdsg/cmake_bindings/bdsg/overlays/packed_path_position_overlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,19 @@ struct PyCallBack_bdsg_PackedPositionOverlay : public bdsg::PackedPositionOverla
}
return PackedPositionOverlay::get_path_handle_of_step(a0);
}
bool for_each_path_matching_impl(const class std::unordered_set<enum handlegraph::PathSense> * a0, const class std::unordered_set<std::string > * a1, const class std::unordered_set<std::string > * a2, const class std::function<bool (const struct handlegraph::path_handle_t &)> & a3) const override {
pybind11::gil_scoped_acquire gil;
pybind11::function overload = pybind11::get_overload(static_cast<const bdsg::PackedPositionOverlay *>(this), "for_each_path_matching_impl");
if (overload) {
auto o = overload.operator()<pybind11::return_value_policy::reference>(a0, a1, a2, a3);
if (pybind11::detail::cast_is_temporary_value_reference<bool>::value) {
static pybind11::detail::override_caster_t<bool> caster;
return pybind11::detail::cast_ref<bool>(std::move(o), caster);
}
return pybind11::detail::cast_safe<bool>(std::move(o));
}
return PackedPositionOverlay::for_each_path_matching_impl(a0, a1, a2, a3);
}
bool for_each_path_handle_impl(const class std::function<bool (const struct handlegraph::path_handle_t &)> & a0) const override {
pybind11::gil_scoped_acquire gil;
pybind11::function overload = pybind11::get_overload(static_cast<const bdsg::PackedPositionOverlay *>(this), "for_each_path_handle_impl");
Expand Down Expand Up @@ -731,6 +744,10 @@ void bind_bdsg_overlays_packed_path_position_overlay(std::function< pybind11::mo
{
{ // bdsg::PackedPositionOverlay file:bdsg/overlays/packed_path_position_overlay.hpp line:33
pybind11::class_<bdsg::PackedPositionOverlay, std::shared_ptr<bdsg::PackedPositionOverlay>, PyCallBack_bdsg_PackedPositionOverlay, handlegraph::PathPositionHandleGraph, handlegraph::ExpandingOverlayGraph> cl(M("bdsg"), "PackedPositionOverlay", "");
cl.def( pybind11::init( [](const class handlegraph::PathHandleGraph * a0){ return new bdsg::PackedPositionOverlay(a0); }, [](const class handlegraph::PathHandleGraph * a0){ return new PyCallBack_bdsg_PackedPositionOverlay(a0); } ), "doc");
cl.def( pybind11::init( [](const class handlegraph::PathHandleGraph * a0, const class std::unordered_set<std::string > & a1){ return new bdsg::PackedPositionOverlay(a0, a1); }, [](const class handlegraph::PathHandleGraph * a0, const class std::unordered_set<std::string > & a1){ return new PyCallBack_bdsg_PackedPositionOverlay(a0, a1); } ), "doc");
cl.def( pybind11::init<const class handlegraph::PathHandleGraph *, const class std::unordered_set<std::string > &, unsigned long>(), pybind11::arg("graph"), pybind11::arg("extra_path_names"), pybind11::arg("steps_per_index") );

cl.def( pybind11::init( [](PyCallBack_bdsg_PackedPositionOverlay const &o){ return new PyCallBack_bdsg_PackedPositionOverlay(o); } ) );
cl.def( pybind11::init( [](bdsg::PackedPositionOverlay const &o){ return new bdsg::PackedPositionOverlay(o); } ) );
cl.def("assign", (class bdsg::PackedPositionOverlay & (bdsg::PackedPositionOverlay::*)(const class bdsg::PackedPositionOverlay &)) &bdsg::PackedPositionOverlay::operator=, "C++: bdsg::PackedPositionOverlay::operator=(const class bdsg::PackedPositionOverlay &) --> class bdsg::PackedPositionOverlay &", pybind11::return_value_policy::automatic, pybind11::arg("other"));
Expand Down Expand Up @@ -770,25 +787,4 @@ void bind_bdsg_overlays_packed_path_position_overlay(std::function< pybind11::mo
cl.def("get_step_at_position", (struct handlegraph::step_handle_t (bdsg::PackedPositionOverlay::*)(const struct handlegraph::path_handle_t &, const unsigned long &) const) &bdsg::PackedPositionOverlay::get_step_at_position, "Returns the step at this position, measured in bases of sequence starting at\n the step returned by path_begin(). If the position is past the end of the\n path, returns path_end().\n\nC++: bdsg::PackedPositionOverlay::get_step_at_position(const struct handlegraph::path_handle_t &, const unsigned long &) const --> struct handlegraph::step_handle_t", pybind11::arg("path"), pybind11::arg("position"));
cl.def("get_underlying_handle", (struct handlegraph::handle_t (bdsg::PackedPositionOverlay::*)(const struct handlegraph::handle_t &) const) &bdsg::PackedPositionOverlay::get_underlying_handle, "Returns the handle in the underlying graph that corresponds to a handle in the\n overlay\n\nC++: bdsg::PackedPositionOverlay::get_underlying_handle(const struct handlegraph::handle_t &) const --> struct handlegraph::handle_t", pybind11::arg("handle"));
}
{ // bdsg::BBHashHelper file:bdsg/overlays/packed_path_position_overlay.hpp line:315
pybind11::class_<bdsg::BBHashHelper, std::shared_ptr<bdsg::BBHashHelper>> cl(M("bdsg"), "BBHashHelper", "");
cl.def( pybind11::init<const class handlegraph::PathHandleGraph *>(), pybind11::arg("graph") );

cl.def( pybind11::init( [](bdsg::BBHashHelper const &o){ return new bdsg::BBHashHelper(o); } ) );
cl.def("begin", (struct bdsg::BBHashHelper::iterator (bdsg::BBHashHelper::*)() const) &bdsg::BBHashHelper::begin, "C++ style range begin over steps\n\nC++: bdsg::BBHashHelper::begin() const --> struct bdsg::BBHashHelper::iterator");
cl.def("end", (struct bdsg::BBHashHelper::iterator (bdsg::BBHashHelper::*)() const) &bdsg::BBHashHelper::end, "C++ style range end over steps\n\nC++: bdsg::BBHashHelper::end() const --> struct bdsg::BBHashHelper::iterator");
cl.def("assign", (struct bdsg::BBHashHelper & (bdsg::BBHashHelper::*)(const struct bdsg::BBHashHelper &)) &bdsg::BBHashHelper::operator=, "C++: bdsg::BBHashHelper::operator=(const struct bdsg::BBHashHelper &) --> struct bdsg::BBHashHelper &", pybind11::return_value_policy::automatic, pybind11::arg(""));

{ // bdsg::BBHashHelper::iterator file:bdsg/overlays/packed_path_position_overlay.hpp line:325
auto & enclosing_class = cl;
pybind11::class_<bdsg::BBHashHelper::iterator, std::shared_ptr<bdsg::BBHashHelper::iterator>> cl(enclosing_class, "iterator", "");
cl.def( pybind11::init( [](bdsg::BBHashHelper::iterator const &o){ return new bdsg::BBHashHelper::iterator(o); } ) );
cl.def("assign", (struct bdsg::BBHashHelper::iterator & (bdsg::BBHashHelper::iterator::*)(const struct bdsg::BBHashHelper::iterator &)) &bdsg::BBHashHelper::iterator::operator=, "C++: bdsg::BBHashHelper::iterator::operator=(const struct bdsg::BBHashHelper::iterator &) --> struct bdsg::BBHashHelper::iterator &", pybind11::return_value_policy::automatic, pybind11::arg("other"));
cl.def("pre_increment", (struct bdsg::BBHashHelper::iterator & (bdsg::BBHashHelper::iterator::*)()) &bdsg::BBHashHelper::iterator::operator++, "C++: bdsg::BBHashHelper::iterator::operator++() --> struct bdsg::BBHashHelper::iterator &", pybind11::return_value_policy::automatic);
cl.def("dereference", (struct handlegraph::step_handle_t (bdsg::BBHashHelper::iterator::*)() const) &bdsg::BBHashHelper::iterator::operator*, "C++: bdsg::BBHashHelper::iterator::operator*() const --> struct handlegraph::step_handle_t");
cl.def("__eq__", (bool (bdsg::BBHashHelper::iterator::*)(const struct bdsg::BBHashHelper::iterator &) const) &bdsg::BBHashHelper::iterator::operator==, "C++: bdsg::BBHashHelper::iterator::operator==(const struct bdsg::BBHashHelper::iterator &) const --> bool", pybind11::arg("other"));
cl.def("__ne__", (bool (bdsg::BBHashHelper::iterator::*)(const struct bdsg::BBHashHelper::iterator &) const) &bdsg::BBHashHelper::iterator::operator!=, "C++: bdsg::BBHashHelper::iterator::operator!=(const struct bdsg::BBHashHelper::iterator &) const --> bool", pybind11::arg("other"));
}

}
}
Loading
Loading