gunz_cm.converters package

Submodules

gunz_cm.converters.coo module

Module for converting contact matrix data from standard formats (like .hic or .cool) into a tabular, sparse COO (Coordinate List) text format.

Examples

>>> from gunz_cm.converters.coo import convert_to_cm_coo
>>> convert_to_cm_coo("sample.cool", "output.csv", resolution=10000)

gunz_cm.converters.gnz module

gunz_cm.converters.memmap module

Module for converting various contact matrix formats into a memory-mapped (memmap) file for efficient, on-disk matrix operations.

Examples

gunz_cm.converters.memmap.convert_to_memmap(data: Path | DataFrame | Tuple[_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str], ...], output_fpath: Path, **kwargs) None

Converts contact matrix data to a NumPy memory-mapped file (memmap).

This is a polymorphic function that dispatches to the appropriate implementation based on the type of the data argument.

datapathlib.Path or pd.DataFrame or tuple

The input data to convert. Can be: - A path to a standard contact matrix file (.hic, .cool, etc.). - A pandas DataFrame in COO format. - A tuple of (rows, cols, values) arrays.

output_fpathpathlib.Path

The base path for the output memmap file.

**kwargs :

Additional arguments specific to the conversion type, such as resolution, balancing, output_full_matrix, etc.

Examples

Module contents