Skip to content

Commit

Permalink
Fix off by 1 error; avoid crash if a strand has no reads
Browse files Browse the repository at this point in the history
  • Loading branch information
baraaorabi authored Mar 21, 2023
1 parent 1e009cd commit b46cb42
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scTagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def parse_args():
s, e = -e, -s + 1
else:
assert False, (strand)
for i in np.arange(s, e):
for i in np.arange(s, e+1):
assert not i in ranges_dicts[ranges_idx], (
ranges_idx, i, ranges_dicts[ranges_idx])
ranges_dicts[ranges_idx][i] = len(ranges[ranges_idx])
Expand Down Expand Up @@ -198,6 +198,8 @@ def get_alns(seq):

def get_ranges(data):
ranges = list()
if len(data) == 0:
return ranges
min_l = min(data)
max_l = max(data)
L = np.arange(min_l, max_l+1)
Expand Down

0 comments on commit b46cb42

Please sign in to comment.