Hi-C API#
- class hictkpy.hic.FileWriter#
Class representing a file handle to create .hic files.
- __init__#
Overloaded function.
__init__(self, path: str, chromosomes: dict, resolution: int, assembly: str = 'unknown', n_threads: int = 1, chunk_size: int = 10000000, tmpdir: str = '/tmp', compression_lvl: int = 9, skip_all_vs_all_matrix: bool = False) -> None
Open a .hic file for writing.
__init__(self, path: str, chromosomes: dict, resolutions: list[int], assembly: str = 'unknown', n_threads: int = 1, chunk_size: int = 10000000, tmpdir: str = '/tmp', compression_lvl: int = 9, skip_all_vs_all_matrix: bool = False) -> None
Open a .hic file for writing.
- add_pixels#
Add pixels from a pandas DataFrame containing pixels in COO or BG2 format (i.e. either with columns=[bin1_id, bin2_id, count] or with columns=[chrom1, start1, end1, chrom2, start2, end2, count].
- chromosomes#
Get chromosomes sizes as a dictionary mapping names to sizes.
- finalize#
Write interactions to file.
- path#
Get the file path.
- resolutions#
Get the list of resolutions in bp.