From 4d1b5d84271104a16e1f9cb312c5e167f8dc638c Mon Sep 17 00:00:00 2001 From: Danilo Horta Date: Mon, 27 Nov 2023 16:25:54 +0000 Subject: [PATCH] Update c-core to v0.13.12 and add cut_ga parameter --- python-core/build_ext.py | 2 +- python-core/deciphon_core/interface.h | 3 ++- python-core/deciphon_core/params.py | 8 ++++++-- python-core/pyproject.toml | 2 +- python-core/tests/test_scan.py | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/python-core/build_ext.py b/python-core/build_ext.py index 15e64bb..8e68ebe 100644 --- a/python-core/build_ext.py +++ b/python-core/build_ext.py @@ -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, ), diff --git a/python-core/deciphon_core/interface.h b/python-core/deciphon_core/interface.h index 1777b20..6748756 100644 --- a/python-core/deciphon_core/interface.h +++ b/python-core/deciphon_core/interface.h @@ -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); diff --git a/python-core/deciphon_core/params.py b/python-core/deciphon_core/params.py index 904a536..ccaaf0d 100644 --- a/python-core/deciphon_core/params.py +++ b/python-core/deciphon_core/params.py @@ -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 diff --git a/python-core/pyproject.toml b/python-core/pyproject.toml index 9b71828..47327ac 100644 --- a/python-core/pyproject.toml +++ b/python-core/pyproject.toml @@ -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 "] license = "MIT" diff --git a/python-core/tests/test_scan.py b/python-core/tests/test_scan.py index 611616e..518e255 100644 --- a/python-core/tests/test_scan.py +++ b/python-core/tests/test_scan.py @@ -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: