Skip to content

Commit

Permalink
Minor BugFix for DIAMOND XML parsing < 0.9.31
Browse files Browse the repository at this point in the history
  • Loading branch information
lucventurini committed Apr 7, 2020
1 parent b3f3d7a commit e6f3be6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Mikado/serializers/blast_serializer/hit.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,12 @@ def prepare_hit(hit, query_id, target_id, off_by_one=False, as_list=False, **kwa
list(ident[(ident < 0)]),
list(ident[ident > query_array.shape[1]])))
try:
query_array[0, ident] = 1
query_array[0, ident - off_by_one] = 1
except IndexError as exc:
raise IndexError("{}, off by one: {}; min, max: {}, {}; hsp {}".format(
exc, off_by_one, ident.min(), ident.max(), hsp._items[0].__dict__))
try:
query_array[1, posit] = 1
query_array[1, posit - off_by_one] = 1
except IndexError as exc:
raise IndexError("{}, off by one: {}; min, max: {}, {}; frame: {}".format(
exc, off_by_one, posit.min(), posit.max(), hsp.query_frame))
Expand Down
2 changes: 1 addition & 1 deletion Mikado/serializers/blast_serializer/xml_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def get_off_by_one(record):
macro, minor, micro = [int(_) for _ in version.split(".")]
except (ValueError, TypeError):
return False
if macro > 0 or minor > 9 or micro > 30:
if macro > 0 or minor > 9 or (micro > 30 or micro < 25):
return False
else:
return True
Expand Down

0 comments on commit e6f3be6

Please sign in to comment.