Metadata-Version: 2.2
Name: cenplot
Version: 0.0.9
Summary: Centromere plotting library.
Author-email: Keith Oshima <oshimak@pennmedicine.upenn.edu>
License: MIT License
Project-URL: Homepage, https://github.com/logsdon-lab/cenplot
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: matplotlib==3.10.0
Requires-Dist: polars==1.19.0
Requires-Dist: numpy==2.2.1
Requires-Dist: intervaltree==3.1.0
Requires-Dist: censtats==0.0.10
Requires-Dist: PyYAML==6.0.2

# `cenplot`
[![PyPI - Version](https://img.shields.io/pypi/v/cenplot)](https://pypi.org/project/cenplot/)
[![CI](https://github.com/logsdon-lab/cenplot/actions/workflows/main.yaml/badge.svg)](https://github.com/logsdon-lab/cenplot/actions/workflows/main.yaml)
[![docs](https://github.com/logsdon-lab/cenplot/actions/workflows/docs.yaml/badge.svg)](https://github.com/logsdon-lab/cenplot/actions/workflows/docs.yaml)

Library for producing centromere figures.

<table>
  <tr>
    <td>
        <figure float="left">
            <img align="middle" src="docs/example_cdr.png" width="100%">
            <figcaption>CDR plot.</figcaption>
        </figure>
      <figure float="left">
            <img align="middle" src="docs/example_split_hor.png" width="100%">
            <figcaption>HOR plot.</figcaption>
        </figure>
    </td>
    <td>
        <figure float="left">
            <img align="middle" src="docs/example_multiple.png" width="100%">
            <figcaption>Combined plot.</figcaption>
        </figure>
    </td>
  </tr>
</table>

## Getting Started
Install the package from `pypi`.
```bash
pip install cenplot
```

## CLI
Generating a split HOR tracks using the `cenplot draw` command.
```bash
# examples/example_cli.sh
cenplot draw \
-t tracks_hor.toml \
-p 4 \
-d plots \
-o "plot/merged_image.png"
```

## Python API
The same HOR track can be created with a few lines of code.
```python
# examples/example_api.py
from cenplot import plot_one_cen, read_one_cen_tracks

chrom = "chm13_chr10:38568472-42561808"
track_list, settings = read_one_cen_tracks("tracks_hor.toml", chrom=chrom)
fig, axes, outfile = plot_one_cen(track_list.tracks, "plots", chrom, settings)
```

## Development
Requires `Git LFS` to pull test files.
Create a `venv`, build `cenplot`, and install it. Also, generate the docs.
```bash
git lfs install && git lfs pull
make dev && make build && make install
pdoc ./cenplot -o docs/
```

## Documentation
Read the documentation [here](https://logsdon-lab.github.io/cenplot/cenplot.html).
