bandhic.cooler_all_chrs#

bandhic.cooler_all_chrs(file_path, diag_num, resolution=None, cell_id=None, balance=True)[source]#

Read Hi-C data from a .cool or .mcool file for all chromosomes and return a dictionary of band_hic_matrix objects.

Parameters:
  • file_path (str) – Path to the .cool, .mcool or .scool file.

  • diag_num (int) – Number of diagonals to consider.

  • resolution (int, optional) – Resolution of the Hi-C data.

  • cell_id (str, optional) – Cell ID for .scool files.

  • balance (bool, optional) – If True, use balanced data. Default is False. This parameter is specific to cooler files.

Returns:

A dictionary mapping chromosome names to band_hic_matrix objects containing the Hi-C data.

Return type:

Dict[str, band_hic_matrix]

Raises:

ValueError – If the cooler file is invalid or parameters are incorrect.

Examples

>>> import bandhic as bh
>>> mats = bh.cooler_all_chrs('/Users/wwb/Documents/workspace/BandHiC-Master/data/yeast.10kb.cool', diag_num=10, resolution=10000)
>>> isinstance(mats['chrI'], band_hic_matrix)
True