diff --git a/README.rst b/README.rst index f1588de..7fb8bec 100644 --- a/README.rst +++ b/README.rst @@ -267,7 +267,7 @@ Thanks to Mike Agostino, Padma Reddy, Kevin Arvai, `openSNP `_, and `Sano Genetics `_. ``snps`` incorporates code and concepts generated with the assistance of -`OpenAI's `_ `ChatGPT `_ (GPT-3.5). ✨ +`OpenAI's `_ `ChatGPT `_. ✨ License ------- diff --git a/src/snps/snps.py b/src/snps/snps.py index 801f5e4..3383a64 100644 --- a/src/snps/snps.py +++ b/src/snps/snps.py @@ -1418,7 +1418,11 @@ def _remapper(self, task): else: # mapping is on same (plus) strand, so just remap based on offset offset = mapped_start - orig_start - temp.loc[snp_indices, "pos"] = temp["pos"] + offset + + # Adjust pos by offset based on sign of offset (avoids OverflowError with uint32) + temp.loc[snp_indices, "pos"] = ( + temp["pos"] - abs(offset) if offset < 0 else temp["pos"] + offset + ) # mark these SNPs as remapped temp.loc[snp_indices, "remapped"] = True