Skip to content

Commit

Permalink
Merge pull request #38 from srcoulombe/master
Browse files Browse the repository at this point in the history
readMatrix raises ValueError
  • Loading branch information
nchernia authored Sep 3, 2019
2 parents 40eb723 + a34ae41 commit 80644d9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python/straw/straw.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ def readMatrix(req, unit, binsize):
Returns:
list containing block bin count and block column count of matrix
Raises:
ValueError if the .hic file can't be parsed with the specified resolution (binsize)
"""
c1 = struct.unpack('<i',req.read(4))[0]
c2 = struct.unpack('<i',req.read(4))[0]
Expand All @@ -263,8 +266,8 @@ def readMatrix(req, unit, binsize):
blockColumnCount = list1[2]
i=i+1
if (not found):
print("Error finding block data\n")
return -1
raise ValueError(f"Error: could not parse .hic file using specified resolution/bin-size ({binsize})" )
return [blockBinCount, blockColumnCount]

def getBlockNumbersForRegionFromBinPosition(regionIndices, blockBinCount, blockColumnCount, intra):
Expand Down

0 comments on commit 80644d9

Please sign in to comment.