Skip to content

Commit

Permalink
Merge pull request #178 from sanogenetics/hotfix/fix-overflow-error
Browse files Browse the repository at this point in the history
Fix OverflowError
  • Loading branch information
apriha authored Jul 19, 2024
2 parents 83888db + 91c4949 commit c2635c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ Thanks to Mike Agostino, Padma Reddy, Kevin Arvai, `openSNP <https://opensnp.org
`Open Humans <https://www.openhumans.org>`_, and `Sano Genetics <https://sanogenetics.com>`_.

``snps`` incorporates code and concepts generated with the assistance of
`OpenAI's <https://openai.com>`_ `ChatGPT <https://chat.openai.com>`_ (GPT-3.5). ✨
`OpenAI's <https://openai.com>`_ `ChatGPT <https://chat.openai.com>`_. ✨

License
-------
Expand Down
6 changes: 5 additions & 1 deletion src/snps/snps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c2635c4

Please sign in to comment.