Metadata-Version: 2.5
Name: plotomics
Version: 0.2.0
Summary: High-performance bioinformatics visualization widgets (volcano, heatmaps, dot plot, violin, embedding, spatial, oncoprint, lollipop, Kaplan-Meier, signature profile, UpSet, treemap, network, Hi-C, genome viewers) backed by a shared JavaScript core.
Project-URL: Homepage, https://github.com/samuelbharti/plotomics
Project-URL: Issues, https://github.com/samuelbharti/plotomics/issues
Project-URL: DOI, https://doi.org/10.5281/zenodo.21926306
Author-email: Samuel Bharti <samuelbharti.io@gmail.com>
License-Expression: MIT
Keywords: anywidget,bioinformatics,genomics,visualization,webgl
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Jupyter
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.10
Requires-Dist: anywidget>=0.9.0
Requires-Dist: numpy>=1.23
Provides-Extra: dev
Requires-Dist: anywidget[dev]; extra == 'dev'
Requires-Dist: pandas>=1.5; extra == 'dev'
Requires-Dist: pytest>=7; extra == 'dev'
Description-Content-Type: text/markdown

# plotomics (Python)

<img src="https://raw.githubusercontent.com/samuelbharti/plotomics/main/assets/logo.png" align="right" width="140" alt="" />

High-performance bioinformatics visualization widgets backed by a shared
JavaScript core, exposed to Python through [anywidget](https://anywidget.dev).

Works in Jupyter, JupyterLab, marimo, Google Colab, VS Code, Shiny for Python
and Streamlit. Large numeric columns are shipped to the browser as a single
binary buffer (not JSON), so millions of points stay interactive.

```python
import numpy as np, pandas as pd
from plotomics import Volcano

n = 200_000
df = pd.DataFrame({
    "x": np.random.randn(n),                 # log2 fold change
    "y": np.abs(np.random.randn(n)) * 3,     # -log10 p-value
    "label": [f"GENE{i}" for i in range(n)],
})
Volcano(df, fc_threshold=1.0, p_threshold=0.05)
```

## Install

```bash
pip install plotomics
```

### Shiny for Python

The widgets are anywidgets, so they render in Shiny for Python through
[`shinywidgets`](https://github.com/posit-dev/py-shinywidgets): `output_widget`
in the UI, `@render_widget` on the server:

```python
from shiny import App, ui
from shinywidgets import output_widget, render_widget
from plotomics import Volcano
import numpy as np, pandas as pd

app_ui = ui.page_fluid(output_widget("plot"))

def server(input, output, session):
    @render_widget
    def plot():
        n = 100_000
        df = pd.DataFrame({"x": np.random.randn(n), "y": np.abs(np.random.randn(n)) * 3})
        return Volcano(df)

app = App(app_ui, server)
```

## Development

The widget JS is built from the monorepo root and copied into
`src/plotomics/static/`:

```bash
pnpm dist          # build JS + sync bundles into this package
pip install -e ".[dev]"
pytest
```
