bandhic.cooler_chr#

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

Read Hi-C data from a .cool or .mcool file and return a band_hic_matrix.

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

  • chrom (str) – Chromosome name.

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

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

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

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

Returns:

A band_hic_matrix object containing the Hi-C data.

Return type:

band_hic_matrix

Raises:

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

Examples

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

See also

cooler documentation Official documentation for the Cooler format and API usage.