Skip to content

Commit

Permalink
set sample_id to unset if not present in fast5
Browse files Browse the repository at this point in the history
  • Loading branch information
iiSeymour committed May 31, 2023
1 parent 53900af commit 8c96eb8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bonito/fast5.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ def __init__(self, read, filename, meta=False, do_trim=True, norm_params=None):

tracking_id = read.handle[read.global_key + 'tracking_id'].attrs

self.sample_id = tracking_id['sample_id']
try:
self.sample_id = tracking_id['sample_id']
except KeyError:
self.sample_id = 'unset'
if type(self.sample_id) in (bytes, np.bytes_):
self.sample_id = self.sample_id.decode()

Expand Down

0 comments on commit 8c96eb8

Please sign in to comment.