Skip to main content

Python port of the R pheatmap package (tracks R pheatmap 1.0.13)

Project description

pheatmap-python

PyPI

Python version of pheatmap that runs on a faithful port of R's native grid graphics system instead of matplotlib.

  • 🎨 No matplotlib. Renders through grid_py's Cairo backend (PNG / PDF / SVG / PS / JPEG / TIFF / BMP).
  • 📐 Grammar of Graphics. Built on grid_py + gtable_py — the same primitives ggplot2 stands on.
  • 🧩 Abstract layout. Sizes stay as compound Unit expressions (1npc - rown_width - legend_width - …) and resolve at draw time.
  • 🎯 R is the gold standard. Behaviour almost like the pheatmap.r and verified against R reference renders.

Install

pip install pheatmap-python

Or, for a local development checkout:

git clone https://github.com/Bio-Babel/pheatmap-python.git
cd pheatmap_py
pip install -e ".[dev]"

Quick start

import numpy as np, pandas as pd
from pheatmap import pheatmap

test = pd.DataFrame(
    np.random.default_rng(1).standard_normal((20, 10)),
    index=[f"Gene{i+1}" for i in range(20)],
    columns=[f"Test{i+1}" for i in range(10)],
)

pheatmap(test)

See tutorials/pheatmap_tutorial.ipynb for a full walk-through.

Docs

pip install -e ".[docs]"
mkdocs serve

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pheatmap_python-1.0.13.post1-py3-none-any.whl (32.1 kB view details)

Uploaded Python 3

File details

Details for the file pheatmap_python-1.0.13.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for pheatmap_python-1.0.13.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 7c87fac4387b68382a1aacb0e62812cf7ec078bfeb06b37642dba76581063031
MD5 f5da20efc8631d0df22ab53d229cbcb5
BLAKE2b-256 4465f71c2a1ec5d5228a0fce3e7ebf58382879c98f3a46326fb0c3a7a0728624

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page