Closed N-damo closed 3 years ago
Bug in ssw_init. This is the correct fix. Will push this.
diff --git a/parasail/bindings_v2.py b/parasail/bindings_v2.py
index 5994d70..b43867f 100644
--- a/parasail/bindings_v2.py
+++ b/parasail/bindings_v2.py
@@ -973,7 +973,8 @@ def ssw_profile(profile, s2, open, extend):
return None
def ssw_init(s1, matrix, score_size):
- return Profile(_lib.parasail_ssw_init(b(s1), len(s1), matrix, score_size), matrix)
+ s1b = b(s1)
+ return Profile(_lib.parasail_ssw_init(s1b, len(s1), matrix, score_size), matrix, s1b)
_lib.parasail_sequences_from_file.argtype = [ctypes.c_char_p]
_lib.parasail_sequences_from_file.restype = c_sequences_p
It's been a long time since I pushed a tagged release. Not sure how well CI will go, creating a new pypi etc, but at least if you grab the latest sources it will have this fix.
Release 1.2.1 is now available with this fixed. Thanks for reporting.
SSW Library Emulation import parasail score_size = 1 # 0, use 8-bit align; 1, use 16-bit; 2, try both profile = parasail.ssw_init("asdf", parasail.blosum62, score_size) result = parasail.ssw_profile(profile, "asdf", 10, 1) print(result.score1) print(result.cigar) print(result.ref_begin1) print(result.ref_end1) print(result.read_begin1) print(result.read_end1)
error output: TypeError: init() missing 1 required positional argument: 's1b'
possible solution: class Profile:
def init(self, pointer, matrix,s1b):
is it right?