Skip to content

Commit

Permalink
Use max value to sanitize seqnames
Browse files Browse the repository at this point in the history
  • Loading branch information
jkanche committed Sep 23, 2024
1 parent 6c8d32e commit d397f57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/genomicranges/GenomicRanges.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def _sanitize_seqnames(self, seqnames, seqinfo):
if not isinstance(seqnames, np.ndarray):
seqnames = np.asarray([self._reverse_seqindex[x] for x in seqnames])

num_uniq = len(np.unique(seqnames))
num_uniq = np.max(seqnames)
if num_uniq < 2**8:
seqnames = seqnames.astype(np.int8)
elif num_uniq < 2**16:
Expand Down

0 comments on commit d397f57

Please sign in to comment.