From 3d3fa68041391d81c7c2dc19bc87c96736666b0d Mon Sep 17 00:00:00 2001 From: Jayaram Kancherla Date: Wed, 23 Oct 2024 11:46:38 -0700 Subject: [PATCH] change dtypes of seqnames to unsigned integers --- src/genomicranges/GenomicRanges.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/genomicranges/GenomicRanges.py b/src/genomicranges/GenomicRanges.py index d8b711a..33acc91 100644 --- a/src/genomicranges/GenomicRanges.py +++ b/src/genomicranges/GenomicRanges.py @@ -223,15 +223,15 @@ def _sanitize_seqnames(self, seqnames, seqinfo): seqnames = np.asarray([self._reverse_seqindex[x] for x in seqnames]) if len(seqnames) == 0: - seqnames = seqnames.astype(np.int8) + seqnames = seqnames.astype(np.uint8) else: num_uniq = np.max(seqnames) if num_uniq < 2**8: - seqnames = seqnames.astype(np.int8) + seqnames = seqnames.astype(np.uint8) elif num_uniq < 2**16: - seqnames = seqnames.astype(np.int16) + seqnames = seqnames.astype(np.uint16) elif num_uniq < 2**32: - seqnames = seqnames.astype(np.int32) + seqnames = seqnames.astype(np.uint32) return seqnames