Skip to content

Commit

Permalink
Merge pull request #50 from 4dn-dcic/zlib
Browse files Browse the repository at this point in the history
partial fix for zlib decompression issue
  • Loading branch information
SooLee authored Apr 3, 2020
2 parents ccb3cac + 36d5d86 commit da46ef2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion hic2cool/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.8.2"
__version__ = "0.8.3"
18 changes: 8 additions & 10 deletions hic2cool/hic2cool_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,20 +343,18 @@ def parse_hic(req, pool, nproc, chr_key, unit, binsize, pair_footer_info,
region_indices = [0, chr_bins[c1], 0, chr_bins[c2]]
myFilePos = pair_footer_info[chr_key]
block_info, block_bins, block_cols = read_blockinfo(req, mmap_buf, myFilePos, unit, binsize)
if len(block_info) > 1:
nsplit = nproc
if nsplit > len(block_info):
nsplit = len(block_info)
mpi_result = [None] * nsplit
blocklen = len(block_info) // nsplit + 1
for mpi in range(0, nsplit):
if len(block_info) >= nproc and nproc >= 2:
mpi_result = [None] * nproc
blocklen = len(block_info) // nproc
for mpi in range(0, nproc):
block_start = mpi * blocklen
block_end = (mpi + 1) * blocklen
if block_end > len(block_info):
if mpi == nproc - 1:
block_end = len(block_info)
else:
block_end = (mpi + 1) * blocklen
mpi_result[mpi] = pool.apply_async(build_counts_chunk, (mpi, c1, c2, block_info[block_start:block_end], chr_offset_map, region_indices,))
result_all = []
for mpi in range(0, nsplit):
for mpi in range(0, nproc):
mpi_result[mpi].wait()
result_all.extend(mpi_result[mpi].get())
return np.concatenate(result_all, axis=0)
Expand Down

0 comments on commit da46ef2

Please sign in to comment.