Skip to content

Commit

Permalink
Fix regression on gapped consensus
Browse files Browse the repository at this point in the history
  • Loading branch information
cjw85 committed May 20, 2019
1 parent 0530ff9 commit f162a6f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@

v0.7.1
------
Bug fix release

* Fix regression in consensus stitching when chunks do not overlap


v0.7.0
------
Feature release
Expand Down
2 changes: 1 addition & 1 deletion medaka/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
import subprocess

__version__ = '0.7.0'
__version__ = '0.7.1'


def check_minimap2_version():
Expand Down
9 changes: 8 additions & 1 deletion medaka/stitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,15 @@ def stitch_from_probs(probs_hdfs, regions=None, model_yml=None):
s2_name, s1_name
))
continue
elif s2.first_pos >= s1.last_pos:
# trigger a break
end_1_ind, start_2_ind = None, None
else:
end_1_ind, start_2_ind = medaka.common.Sample.overlap_indices(s1, s2)
try:
end_1_ind, start_2_ind = medaka.common.Sample.overlap_indices(s1, s2)
except medaka.common.OverlapException as e:
logger.info("Unhandled overlap type whilst stitching chunks.")
raise(e)

best = np.argmax(s1.label_probs[start_1_ind:end_1_ind], -1)
seq += ''.join([label_decoding[x] for x in best]).replace(medaka.common._gap_, '')
Expand Down

0 comments on commit f162a6f

Please sign in to comment.