Skip to content

Commit

Permalink
Fix find_nams Python binding
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelm committed Oct 2, 2024
1 parent b684bbf commit 30adee4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/python/strobealign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ NB_MODULE(strobealign_extension, m_) {
nb::bind_vector<std::vector<Nam>>(m, "NamVector");

m.def("randstrobes_query", &randstrobes_query);
m.def("find_nams", [](const QueryRandstrobeVector &query_randstrobes, const StrobemerIndex& index) -> std::vector<Nam> {
auto [nonrepetitive_fraction, n_hits, nams] = find_nams(query_randstrobes, index);
m.def("find_nams", [](const QueryRandstrobeVector &query_randstrobes, const StrobemerIndex& index, bool use_mcs) -> std::vector<Nam> {
auto [nonrepetitive_fraction, n_hits, nams] = find_nams(query_randstrobes, index, use_mcs);
return nams;
});
}, nb::arg("query_randstrobes"), nb::arg("index"), nb::arg("use_mcs"));
}
2 changes: 1 addition & 1 deletion tests/test_bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_indexing_and_nams_finding():
# Find NAMs for a single query sequence
query = "TGCGTTTATGGTACGCTGGACTTTGTGGGATACCCTCGCTTTCCTGCTCCTGTTGAGTTTATTGCTGCCG"
randstrobes = strobealign.randstrobes_query(query, index_parameters)
nams = strobealign.find_nams(randstrobes, index)
nams = strobealign.find_nams(randstrobes, index, use_mcs=False)
assert nams
for nam in nams:
ref = refs[nam.reference_index].sequence
Expand Down

0 comments on commit 30adee4

Please sign in to comment.