bandhic.straw_all_chrs#

bandhic.straw_all_chrs(hic_file, resolution, diag_num, data_type='observed', normalization='NONE', unit='BP')[source]#

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

Parameters:
  • hic_file (str) – Path to the .hic file. This file should be in the Hi-C format compatible with hicstraw. Local or remote paths are supported.

  • resolution (int) – Resolution of the Hi-C data. Such as 10000 for 10kb resolution.

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

  • data_type (str, optional) – Type of data to read from the Hi-C file. Default is ‘observed’. Other options include ‘expected’, ‘balanced’, etc. See hicstraw documentation for more details.

  • normalization (str, optional) – Normalization method to apply. Default is ‘NONE’. Other options include ‘VC’, ‘VC_SQRT’, ‘KR’, ‘SCALE’, etc. See hicstraw documentation for more details.

  • unit (str, optional) – Unit of measurement for the Hi-C data. Default is ‘BP’ (base pairs). Other options include ‘FRAG’ (fragments), etc.

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 file cannot be parsed or parameters are invalid.

Examples

>>> import bandhic as bh
>>> mats = bh.straw_all_chrs('/Users/wwb/Documents/workspace/BandHiC-Master/data/GSE130275_mESC_WT_combined_1.3B_microc.hic', resolution=10000, diag_num=200)
>>> isinstance(mats['chr1'], band_hic_matrix)
True