Sovereign 8s.is mirror of standardgalactic/CenPlot
  • Python 98.7%
  • Awk 0.7%
  • Makefile 0.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Keith Oshima 7b5c229139
Some checks failed
docs / build (push) Has been cancelled
docs / deploy (push) Has been cancelled
CI / build (push) Has been cancelled
CI / test (push) Has been cancelled
Merge pull request #37 from logsdon-lab/bugfix/bed-clip-not-filter
bugfix: clip BED regions instead of filtering
2026-02-19 13:58:54 -05:00
.github/workflows Try to fix pysam. 2025-06-06 05:41:05 -04:00
cenplot Fix filter not working for all conditions. 2026-02-19 12:06:25 -05:00
docs Add more documentation on testing and added citation. Removed smaller LFS example files and bgzipped the rest. Renamed example plots so easier to find. 2025-12-18 16:46:35 -05:00
examples Add more documentation on testing and added citation. Removed smaller LFS example files and bgzipped the rest. Renamed example plots so easier to find. 2025-12-18 16:46:35 -05:00
test Add option to rescale self-identity triangle so always a right isosceles triangle if plot height allows. 2025-11-20 10:30:41 -05:00
.gitattributes Add more documentation on testing and added citation. Removed smaller LFS example files and bgzipped the rest. Renamed example plots so easier to find. 2025-12-18 16:46:35 -05:00
.gitignore Allow plotting multiple images. Updated example plots. 2025-02-10 22:00:04 -05:00
.pre-commit-config.yaml Rename read_once_cen_tracks to read_tracks. Rename plot_one_cen to plot_tracks. Change plot_tracks type signature and allow optional output directory and chrom name. Add stricter typing checks. Change x-axis labeling to add first tick. Expose read_track api. Fix invalid df/lf type in read_bed9. Add TrackType.settings to get default settings. Bump version. 2025-09-03 03:49:29 -04:00
LICENSE Add MIT license. Fix imports. 2025-01-26 05:21:12 -05:00
Makefile Make requirements less strict. 2025-09-01 02:40:35 -04:00
mypy.ini Rename PlotOption.Value to PlotOption.Bar. Refactor so settings in track.settings dataclasses. 2025-01-28 14:58:21 -05:00
pyproject.toml Clip BED regions rather than filter. 2026-02-19 11:26:19 -05:00
README.md Add more documentation on testing and added citation. Removed smaller LFS example files and bgzipped the rest. Renamed example plots so easier to find. 2025-12-18 16:46:35 -05:00
requirements.txt Make requirements less strict. 2025-09-01 02:40:35 -04:00

CenPlot

PyPI - Version CI docs

A Python library for producing centromere figures.

CDR plot.
HOR plot.
Combined plot.
Identity plots.

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