-
Notifications
You must be signed in to change notification settings - Fork 35
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
Possible straw.py issue for older hic versions #21
Comments
Could you do a pull request?
…On Wed, Oct 18, 2017 at 1:10 PM, carlvitzthum ***@***.***> wrote:
I'm working on developing a converter from .hic to .cool files (hic2cool)
and came across a possible issue with a test file of hic version 6. The
binX, binY, and counts values were not correct within the readBlock
function.
The file is IMR90.hic and can be found here: https://bcm.app.box.com/v/
aidenlab/folder/11235404320.
I was able to get the correct counts (i.e. ones that matched the output of juice_tools
dump) by changing the lines 323 to 325 in python/straw.py.
https://github.com/theaidenlab/straw/blob/65f0e94bf7cc11cfa6a9e7ddaf5020
5591bb6069/python/straw.py#L323.
Looking closely, the binX value == nRecords for i=0 in the loop over
range(nRecords), which explains the problem. I changed the range of bytes
read and it seems to work:
x = struct.unpack(b'<i', uncompressedBytes[(12*i+4):(12*i+8)])[0]
y = struct.unpack(b'<i', uncompressedBytes[(12*i+8):(12*i+12)])[0]
c = struct.unpack(b'<f', uncompressedBytes[(12*i+12):(12*i+16)])[0]
Just thought I would let you know in case this is a valid issue you want
to fix.
Best,
Carl
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#21>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABWiW-qCppzdE8dwlpLTeUKKhxNoOXYRks5stjEVgaJpZM4P-DMd>
.
--
Neva Cherniavsky Durand, Ph.D.
Staff Scientist, Aiden Lab
www.aidenlab.org
|
Certainly. #22 Apologies for the number of whitespace changes, which were added automatically by my linter. Only lines 323-325 were meaningfully changed. |
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm working on developing a converter from .hic to .cool files (hic2cool) and came across a possible issue with a test file of hic version 6. The binX, binY, and counts values were not correct within the readBlock function.
The file is IMR90.hic and can be found here: https://bcm.app.box.com/v/aidenlab/folder/11235404320.
I was able to get the correct counts (i.e. ones that matched the output of
juice_tools dump
) by changing the lines 323 to 325 in python/straw.py. https://github.com/theaidenlab/straw/blob/65f0e94bf7cc11cfa6a9e7ddaf50205591bb6069/python/straw.py#L323-L325Looking closely, the binX value == nRecords for i=0 in the loop over range(nRecords), which explains the problem. I changed the range of bytes read and it seems to work:
x = struct.unpack(b'<i', uncompressedBytes[(12i+4):(12i+8)])[0]
y = struct.unpack(b'<i', uncompressedBytes[(12i+8):(12i+12)])[0]
c = struct.unpack(b'<f', uncompressedBytes[(12i+12):(12i+16)])[0]
Just thought I would let you know in case this is a valid issue you want to fix.
Best,
Carl
The text was updated successfully, but these errors were encountered: