bandhic.straw_chr#
- bandhic.straw_chr(hic_file, chrom, resolution, diag_num, data_type='observed', normalization='NONE', unit='BP')[source]#
Read Hi-C data from a .hic file and return a band_hic_matrix.
- 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.
chrom (str) – Chromosome name (e.g., ‘chr1’, ‘chrX’). Short names like ‘1’, ‘X’ are also accepted.
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 hicstra`w 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.
- Return type:
See also
hicstraw documentation Python interface to read Hi-C data files using .hic format.
- Returns:
A band_hic_matrix object containing the Hi-C data.
- Return type:
- Raises:
ValueError – If the file cannot be parsed or parameters are invalid.
- Parameters:
hic_file (str)
chrom (str)
resolution (int)
diag_num (int)
data_type (str)
normalization (str)
unit (str)
Examples
>>> import bandhic as bh >>> mat = bh.straw_chr('/Users/wwb/Documents/workspace/BandHiC-Master/data/GSE130275_mESC_WT_combined_1.3B_microc.hic', 'chr1', resolution=10000, diag_num=200) >>> isinstance(mat, band_hic_matrix) True