Skip to content

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

@nefclan

Description

@nefclan

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions