Python bindings for hictk, a blazing fast toolkit to work with .hic and .cool files.
hictkpy can be installed in various ways. The simplest method is using pip: pip install hictkpy[all]
.
Refer to Installation for alternative methods.
import hictkpy
path_to_clr = "file.mcool" # "file.hic"
clr = hictkpy.File(path_to_clr, 100_000)
sel = clr.fetch("chr1")
df = sel.to_df() # Get interactions as a pd.DataFrame
m1 = sel.to_numpy() # Get interactions as a numpy matrix
m2 = sel.to_coo() # Get interactions as a scipy.sparse.coo_matrix
For more detailed examples refer to Quickstart.
The complete documentation for hictkpy API is available here.
If you use hictkpy in you research, please cite the following publication:
Roberto Rossini, Jonas Paulsen, hictk: blazing fast toolkit to work with .hic and .cool files Bioinformatics, Volume 40, Issue 7, July 2024, btae408, https://doi.org/10.1093/bioinformatics/btae408