Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Convert chromsizes to int64 in cooler tiles to prevent overflow … #157

Merged
merged 4 commits into from
Feb 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.9', '3.10']

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v0.20.2

- Convert cooler chromsizes to int64 to prevent overflow error with recent versions of h5py and numpy

v0.20.1

- Remove use of deprecated `max_chunk` argument from cooler tile fetcher.
Expand Down
2 changes: 1 addition & 1 deletion clodius/tiles/cooler.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def get_chromosome_names_cumul_lengths(c):
(names, sizes, lengths) -> (list(string), dict, np.array(int))
"""
chrom_names = c.chromnames
chrom_sizes = dict(c.chromsizes)
chrom_sizes = dict(c.chromsizes.astype(np.int64))
chrom_cum_lengths = np.r_[0, np.cumsum(c.chromsizes.values)]
return chrom_names, chrom_sizes, chrom_cum_lengths

Expand Down
2 changes: 1 addition & 1 deletion clodius/tiles/multivec.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def tileset_info(filename):
if "row_infos" in f["resolutions"][str(resolutions[0])].attrs:
row_infos = f["resolutions"][str(resolutions[0])].attrs["row_infos"]

if type(row_infos[0]) == str:
if isinstance(row_infos[0], str):
try:
tileset_info["row_infos"] = [json.loads(r) for r in row_infos]
except json.JSONDecodeError:
Expand Down