- Python 98.7%
- Awk 0.7%
- Makefile 0.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .github/workflows | ||
| cenplot | ||
| docs | ||
| examples | ||
| test | ||
| .gitattributes | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| LICENSE | ||
| Makefile | ||
| mypy.ini | ||
| pyproject.toml | ||
| README.md | ||
| requirements.txt | ||
CenPlot
A Python library for producing centromere figures.
|
|
Getting Started
Install the package from pypi.
pip install cenplot
CLI
Generating a split HOR tracks using the cenplot draw command and an input layout.
# examples/example_cli.sh
cenplot draw \
-t examples/tracks_hor.toml \
-c "chm13_chr10:38568472-42561808" \
-p 4 \
-d plots \
-o "plot/merged_image.png"
Python API
The same HOR track can be created with a few lines of code.
# examples/example_api.py
from cenplot import plot_tracks, read_tracks
chrom = "chm13_chr10:38568472-42561808"
track_list, settings = read_tracks("examples/tracks_hor.toml", chrom=chrom)
fig, axes, _ = plot_tracks(track_list.tracks, settings)
Development
Requires Python >= 3.12 and Git LFS to pull test files.
Create a venv, build cenplot, and install it. Also, generate the docs.
which python3.12 pip
git lfs install && git lfs pull
make dev && make build && make install
pdoc ./cenplot -o docs/
The generated venv will have the cenplot script.
# source venv/bin/activate
venv/bin/cenplot -h
To run tests.
make test
Documentation
Read the documentation here.
Cite
Gao S, Oshima KK, Chuang SC, Loftus M, Montanari A, Gordon DS, Human Genome Structural Variation Consortium, Human Pangenome Reference Consortium, Hsieh P, Konkel MK, Ventura M, Logsdon GA. A global view of human centromere variation and evolution. bioRxiv. 2025. p. 2025.12.09.693231. doi:10.64898/2025.12.09.693231