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

Calling Cooler.pixels raises KeyError: 'nnz' if multiple processes specified in hic2cool convert #52

Open
nefclan opened this issue May 18, 2020 · 2 comments

Comments

@nefclan
Copy link

nefclan commented May 18, 2020

hic2cool 0.8.3
cooler, version 0.8.6.post0

hic2cool convert -r 10000 -p 4 $INPUT_DIR/${sample}.hic $COOLER_FILE
>>> pixels = coolfh.pixels(join=True) 
File "/xxxx/lib/python3.6/site-packages/cooler/api.py", line 286, in pixels
    cooler/api.py", line 286, in pixels
KeyError: 'nnz'

Converted cool's info.

>>> coolfh.info.keys()
dict_keys(['bin-size', 'bin-type', 'creation-date', 'format', 'format-url', 
'format-version', 'generated-by', 'genome-assembly', 'graphs', 'nbins', 
'nchroms', 'statistics', 'storage-mode'])

Manually dump juicer .hic file and convert to sparse matrix file and use

cooler load -f coo $SEG_FILE $MATRIX_FILE $COOLER_FILE
>>> coolfh.info.keys()
dict_keys(['bin-size', 'bin-type', 'creation-date', 'format', 'format-url', 
'format-version', 'generated-by', 'genome-assembly', 'metadata', 'nbins', 
'nchroms', 'nnz', 'storage-mode', 'sum'])

Looks like hic2cool didn't write 'nnz' information which should be equal to the number of total pixels (number of lines of $MATRIX_FILE).

@SooLee
Copy link
Member

SooLee commented May 18, 2020

@nefclan Thank you for reporting this. Do you get the same problem when you run it with -p 1?

@nefclan nefclan changed the title Calling Cooler.pixels raises KeyError: 'nnz' Calling Cooler.pixels raises KeyError: 'nnz' with multiple processes specified May 20, 2020
@nefclan
Copy link
Author

nefclan commented May 20, 2020

@nefclan Thank you for reporting this. Do you get the same problem when you run it with -p 1?

That's it! I ran with -p 1, this error never shows up.

@nefclan nefclan changed the title Calling Cooler.pixels raises KeyError: 'nnz' with multiple processes specified Calling Cooler.pixels raises KeyError: 'nnz' if multiple processes specified in hic2cool convert May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants