Skip to main content

pycmplot

Multi-track circular and linear Manhattan plotting in Python.

Python License: MIT Status Static Badge


Install

From PyPI

pip install pycmplot

From GitHub

git clone https://github.com/esohkevin/pycmplot.git

# or with most recent updates from development branch
# git clone -b dev https://github.com/esohkevin/pycmplot.git

cd pycmplot

pip install -e .

# or

wget https://github.com/esohkevin/pycmplot/archive/refs/tags/v0.4.2.tar.gz
tar zxvf v0.4.2.tar.gz
cd pycmplot-v0.4.2
pip install -e . 

# if you get package dependency error, use
pip install -e . --break-system-packages

Python virtual environment

Use python virtual environment if local installation is not possible

python -m venv ~/envs/pycmplot
source ~/envs/pycmplot/bin/activate

pip install --upgrade pip setuptools wheel
pip install pycmplot

Test the installation

pycmplot -V

Get Help

pycmplot -h,--help

Dependencies

Package Purpose
pandas, numpy Data loading & statistics
matplotlib Plotting backend
pycirclize Circular (Circos-style) tracks
natsort Natural chromosome sorting
adjustText Label collision avoidance
liftover hg18/hg19 to hg38 coordinate conversion
Pillow Image utilities
pyarrow, fastparquet Data load and compression engine

Command-line usage

Linear Manhattan (default)

pycmplot \
  --mode lm \
  --sum_stats HbF.tsv.gz,MCV.txt.gz,MCH.tsv.gz \
  --labels HbF,MCV,MCH \
  --logp \
  --signif_line \
  --highlight \
  --annotate GENE \
  --output_dir ./results \
  --output_format png \
  --dpi 300

Circular Manhattan

pycmplot \
  --sum_stats HbF.tsv.gz,MCV.tsv.gz \
  --labels HbF,MCV \
  --mode cm \
  --trim_pval 0.01 \
  --logp \
  --signif_threshold \
  --plot_title "RBC Traits" \
  --output_dir ./results

Mixed genome builds

pycmplot \
  --sum_stats study_hg18.tsv.gz,study_hg19.tsv.gz,study_hg38.tsv.gz \
  --labels Study_A,Study_B,Study_C \
  --build hg18,hg19,hg38 \
  --logp \
  --annotate GENE \
  --output_dir ./results

Python API

from pycmplot import prep, load, linear, circular, qq_combined, qq_overlay, qq_separate

files  = ["HbF.tsv.gz"]
labels = ["HbF"]

# 1. Resolve per-file column names and delimiters
file_info = prep(
    sum_stats=files,
    labels=labels,
)

# 2. Load data, run liftover (if needed), extract lead SNPs,
#    build the hits table, and compute merged sector sizes
result = load(
    sum_stats=files,
    labels=labels,
    logp=True,
    trim_pval=0.01,
    file_info=file_info,
    signif_threshold=5e-8,
)

# 3. Plot curcular
circular(
    sumstats_loaded=result["dfs"],
    sector_sizes=result["sectors"],
    logp=True,
    signif_lines=result["lines"],
    hits_table=result["annot"],
    annotate="GENE",
    label_col="top_gene",
    colors=["steelblue", "silver"],
    plot_title="RBC Traits",
    output_dir="./results",
)

# 4. Plot linear
linear(
    sumstats_loaded=result["dfs"],
    logp=True,
    signif_lines=result["lines"],
    hits_table=result["annot"],
    annotate="GENE",
    label_col="top_gene",
    colors=["steelblue", "silver"],
    output_dir="./results",
)

# 5. Plot QQ

# Grid of per-track QQ panels
qq_combined(
    pval_dict=result["pvals"],
    thin=True,
    max_points=50_000,
    ncols=3,
    title="RBC Traits",
    output_path="./results/rbc_qq",
    fig_format="png",
)

# All traits overlaid on one axes, with lambda in the legend
qq_overlay(
    pval_dict=result["pvals"],
    thin=True,
    max_points=50_000,
    title="RBC Traits",
    output_path="./results/rbc_qq_overlay",
    fig_format="png",
)

# One file per trait
qq_separate(
    pval_dict=result["pvals"],
    base_name="RBC",
    thin=True,
    max_points=50_000,
    output_path="./results/rbc_qq",
    fig_format="png",
)

See docs for more.


Citation

Kevin Esoh, Fujr Osman, Cesar Fortes-Lima, Gordon A Awandare, Ambroise Wonkam, pycmplot: fast, low-memory multi-track circular and linear Manhattan plotting in Python, Bioinformatics Advances, 2026;, vbag281, https://doi.org/10.1093/bioadv/vbag281


Contributing

See how to contribute here https://github.com/esohkevin/pycmplot?tab=contributing-ov-file

Metadata

Release files for pycmplot 0.4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pycmplot 0.4.3
File Size Uploaded
pycmplot-0.4.3.tar.gz 80.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pycmplot 0.4.3
File Interpreter ABI Platform
pycmplot-0.4.3-py3-none-any.whl Python 3 none any Details

Total release size: 160.0 MB

Release files / pycmplot-0.4.3.tar.gz

Download URL pycmplot-0.4.3.tar.gz
Size 80.0 MB
Tags Source
SHA-256 checksum
How to use checksums
0072b07044a37af9097850ba301e83dddca4372382a7f6baf250ab63e53dc684
BLAKE2b-256 checksum
How to use checksums
b051d03f52e07142a04fa873fb1ddab9007a5777d0243a849ff43368593ee1c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.6

Release files / pycmplot-0.4.3-py3-none-any.whl

Download URL pycmplot-0.4.3-py3-none-any.whl
Size 80.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
6c0ce304e85613bc45e419ec4068b0920658e7aa4fcb31b889629dd8ce18ce20
BLAKE2b-256 checksum
How to use checksums
bfd50068016a6c56c46e6f2c087f4cca12357cf7e2a6ed11a3ca8d29d53feba8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.6

Release history Release notifications | RSS feed

This release

0.4.3 This release

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page