fontanka
December 3, 2025 · View on GitHub
Fountains are novel features of Hi-C maps, resembling "flares" [1], "plumes" [2] and "jets" [3]. They can be detected as inverted triangular structures along the main diagonal of Hi-C maps. Fountains are also similar to "hairpins" [4].
Fontanka aims to provide a flexible Python API and specialized CLI for calling fountains from cool Hi-C files.
Note that Chromosight [4] can be modified to do fountains calling with the binary fountain mask (see examples), although producing patterns with much sharper edges.
Installation
It is highly recommended to work in conda environment, which can be found in environment.yml:
conda env create -f environment.yml
conda activate fontanka
Note that fontanka version 0.1 runs old versions of cooltools and bioframe, as specified in the requirements and environment file.
Optionally, you may want to activate IPython kernel to work with API:
python -m ipykernel install --user --name fontanka --display-name "fontanka"
Intallation from github folder:
git clone https://github.com/agalitsyna/fontanka.git
cd fontanka
pip install -e ./
Example usage
Fontanka is cooltools-based utility [5], that requires ICE-balanced cool files as input [6].
If you start from some other format, consider cooler cload and hic2cool converters.
After conversion, run cooler balance or cooler zoomify --balance to get ICE-balanced cool file.
- Calculate expected with cooltools (v0.5.2):
cooltools expected-cis test.mcool::resolutions/10000 \
--regions test.viewframe.tsv \
-p 20 --clr-weight-name weight --ignore-diags 2 \
-o test.expected.tsv
- Store whole-genome snippets of Hi-C maps:
fontanka slice-windows test.mcool::resolutions/10000 \
output.200Kb.snips.npy \
-W 200_000 -p 20 \
--view test.viewframe.tsv --expected test.expected.tsv
- Call for the binary fountain mask:
fontanka apply-binary-fountain-mask test.mcool::resolutions/10000 \
output.fountains.tsv \
-A 0.7854 \
-W 200_000 \
-p 20 \
--snips output.binary.fountains.npy \
--regions chromosome.regions.txt
- Call for custom mask:
fontanka apply-fountain-mask test.mcool::resolutions/10000 \
output.fountains.tsv \
-M test.fountain.mask.npy \
-W 200_000 \
-p 20 \
--snips output.mask.fountains.npy \
--regions chromosome.regions.txt
For running fontanka as done in Galitsyna et al. 2023, see the notebook in the "examples/".
Running fontanka as API
You can also use fontanka as a Python API. Example notebooks can be found in the "notebooks/" folder of the project https://github.com/agalitsyna/embryonic-chromatin (code for Galitsyna et al. 2023).
Running tests
To run the tests, make sure all the dependencies are installed and development requirements are met:
pip install -r requirements-dev.txt
Then run the tests using pytest:
pytest tests/