Skip to content

Commit

Permalink
#61 produce a valid qstring with default value for crf models
Browse files Browse the repository at this point in the history
  • Loading branch information
iiSeymour committed Nov 12, 2020
1 parent c1ae23b commit a39bf52
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bonito/crf/basecall.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,13 @@ def basecall(model, reads, aligner=None, beamsize=40, chunksize=4000, overlap=50
basecalls = thread_map(_decode, transferred, n_thread=8, preserve_order=True)

basecalls = (
(read, {'sequence': ''.join([seq for (k, seq) in parts]), 'qstring': '*', 'mean_qscore': 0.0})
for read, parts in groupby(basecalls, lambda x: x[0][0])
(read, ''.join(seq for k, seq in parts)) for read, parts in groupby(basecalls, lambda x: x[0][0])
)
basecalls = (
(read, {'sequence': seq, 'qstring': '?' * len(seq) if qscores else '*', 'mean_qscore': 0.0})
for read, seq in basecalls
)

if aligner: return align_map(aligner, basecalls)
return basecalls

Expand Down

0 comments on commit a39bf52

Please sign in to comment.