Skip to content

Commit

Permalink
Update c-core to v0.13.12 and add cut_ga parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
horta committed Nov 27, 2023
1 parent 0980e71 commit 4d1b5d8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion python-core/build_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class Ext:
Ext(
"EBI-Metagenomics",
"deciphon",
"c-core-v0.13.11",
"c-core-v0.13.12",
"./c-core",
CMAKE_OPTS + CPM_OPTS,
),
Expand Down
3 changes: 2 additions & 1 deletion python-core/deciphon_core/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ struct params
int num_threads;
bool multi_hits;
bool hmmer3_compat;
bool cut_ga;
};
int params_setup(struct params *, int num_threads, bool multi_hits, bool hmmer3_compat);
int params_setup(struct params *, int num_threads, bool multi_hits, bool hmmer3_compat, bool cut_ga);

// Press
struct press *press_new(void);
Expand Down
8 changes: 6 additions & 2 deletions python-core/deciphon_core/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@


class Params:
def __init__(self, num_threads: int, multi_hits: bool, hmmer3_compat: bool):
def __init__(
self, num_threads: int, multi_hits: bool, hmmer3_compat: bool, cut_ga: bool
):
self._cptr = ffi.new("struct params *")
if self._cptr == ffi.NULL:
raise MemoryError()

if rc := lib.params_setup(self._cptr, num_threads, multi_hits, hmmer3_compat):
if rc := lib.params_setup(
self._cptr, num_threads, multi_hits, hmmer3_compat, cut_ga
):
raise DeciphonError(rc)

@property
Expand Down
2 changes: 1 addition & 1 deletion python-core/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "deciphon-core"
version = "0.18.12"
version = "0.18.13"
description = "Python wrapper around the Deciphon C library"
authors = ["Danilo Horta <[email protected]>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion python-core/tests/test_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_scan(tmp_path, files_path: Path):

hmmfile = H3File(hmm)
hmmfile.ensure_pressed()
params = Params(num_threads=1, multi_hits=True, hmmer3_compat=False)
params = Params(num_threads=1, multi_hits=True, hmmer3_compat=False, cut_ga=True)
snapfile = NewSnapFile(path=Path("snap.dcs").absolute())

with SchedContext(hmmfile) as sched:
Expand Down

0 comments on commit 4d1b5d8

Please sign in to comment.