bandhic.band_hic_matrix.tocoo#

band_hic_matrix.tocoo(drop_zeros=True)[source]#

Convert the matrix to COO format.

Parameters:

drop_zeros (bool, optional) – If True, zero entries will be dropped from the COO format. Default is True.

Returns:

The matrix in scipy COO sparse format.

Return type:

coo_array

Examples

>>> import bandhic as bh
>>> mat = bh.ones((3,3), diag_num=2)
>>> coo = mat.tocoo()
>>> coo.shape
(3, 3)