Skip to content

Commit

Permalink
fix vesion checks to be bakward compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
Psy-Fer committed May 15, 2024
1 parent 55c63b5 commit b274a1a
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/buttery_eel.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ def sam_header(OUT, sep='\t'):
This is taken from Bonito by Chris Seymour at ONT.
https://github.com/nanoporetech/bonito/blob/master/bonito/io.py#L103
"""
try:
basecaller_version = pybasecall_client_lib.__version__
except:
basecaller_version = pyguppy_client_lib.__version__

HD = sep.join([
'@HD',
'VN:1.5',
Expand All @@ -184,7 +189,7 @@ def sam_header(OUT, sep='\t'):
'@PG',
'ID:basecaller',
'PN:ont basecaller',
'VN:%s' % pyguppy_client_lib.__version__,
'VN:%s' % basecaller_version,
])
PG2 = sep.join([
'@PG',
Expand Down Expand Up @@ -868,7 +873,10 @@ def main():
check = True
check_major = 6
check_minor = 3
major, minor, patch = [int(i) for i in pyguppy_client_lib.__version__.split(".")]
try:
major, minor, patch = [int(i) for i in pybasecall_client_lib.__version__.split(".")]
except:
major, minor, patch = [int(i) for i in pyguppy_client_lib.__version__.split(".")]
if major < check_major:
check = False
elif major == check_major:
Expand All @@ -878,9 +886,11 @@ def main():
print("MOD CALLING VERSION CHECK: >6.3.0? {}".format(check))
print()
if not check:
print("ERROR: Please use guppy/dorado and ont-pyguppy-client-lib version 6.3.0 or higher for modification calling")
print("ERROR: Please use guppy/dorado and ont-pyguppy-client-lib/pybasecall_client_lib version 6.3.0 or higher for modification calling")
print()
sys.exit(1)



# ==========================================================================
# Start guppy_basecall_server
Expand Down

0 comments on commit b274a1a

Please sign in to comment.