Skip to main content

Multi-track circular and linear Manhattan plot generation for GWAS summary statistics

Project description

pycmplot

Multi-track circular and linear Manhattan plot generation for GWAS summary statistics.

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
|  PACKAGE FOR CIRCULAR AND LINEAR MANHATTAN PLOTTING  |
|                    Kevin Esoh, 2026                  |
|                    kesohku1@jh.edu                   |
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

Installation

From PyPI

pip install pycmplot

From GitHub

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

cd pycmplot

pip install -e .

# or

pip install -e . --break-system-packages

Use python virtual environment if local installation is not possible

python -m venv ~/bin/pycmplot

source ~/bin/pycmplot/bin/activate

pip install --upgrade pip setuptools wheel

# then follow any of the installation steps above

Test the installation

pycmplot -h

Dependencies

Package Purpose
pandas, numpy Data loading & statistics
matplotlib Plotting backend
pycirclize Circular (Circos-style) tracks
natsort Natural chromosome sorting
adjustText Label collision avoidance
pyliftover hg19 to hg38 coordinate conversion
Pillow Image utilities

Command-line usage

Linear Manhattan (default)

pycmplot \
  --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 \
  --logp \
  --signif_threshold \
  --plot_title "RBC Traits" \
  --output_dir ./results

Key options

Flag Description Default
-s, --sum_stats Comma-separated sumstats files required
-l, --labels Comma-separated track labels required
-b, --build_column Genome build column name (containing hg18/hg19/hg38) required
-m, --mode lm linear or cm circular lm
-qq, --qq_plot Also generate a QQ-plot off (coming soon...)
--logp Plot -log10(p) off
-sig, --signif_threshold Genome-wide significance threshold off (auto 0.05/N)
-sigl, --signif_line Value for genome-wide significance line if different from -sig -sig
-sug, --suggest_threshold Suggestive significance line off
-hl, --highlight Highlight significant loci off
-a, --annotate Annotate with SNP or GENE SNP
-tp, --trim_pval Trim variants above this p-value for speed off
-st, --sort_track Sort tracks by label or chrom_len input order
-od, --output_dir Output directory .
-of, --output_format Output format (png, pdf, svg, jpg) png

Run pycmplot -h for the full option list.


Python API

from pycmplot import plot_linear
import pandas as pd

df1 = pd.read_csv("HbF.tsv.gz", sep="\t")
df2 = pd.read_csv("MCV.tsv.gz", sep="\t")

plot_linear(
    tracks=[df1, df2],
    track_labels=["HbF", "MCV"],
    chr_col="CHR",
    pos_col="POS",
    p_col="P",
    logp=True,
    highlight=True,
    plot_title="results/HbF_MCV.png",
    figsize=(15, 8),
)

Under development

Project details


Download files

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

Source Distribution

pycmplot-0.1.3.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

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

pycmplot-0.1.3-py3-none-any.whl (1.7 MB view details)

Uploaded Python 3

File details

Details for the file pycmplot-0.1.3.tar.gz.

File metadata

  • Download URL: pycmplot-0.1.3.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for pycmplot-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ce7aadc13188c5a015d06f7e7209a88e435570897349667863ca1060ba570f01
MD5 385952fda9f5b010cf1044be2a399c6a
BLAKE2b-256 fcfcdd0439ee82e96d169cfe90db83bdf28337a14d7f4a20991354aacf2f29e7

See more details on using hashes here.

File details

Details for the file pycmplot-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: pycmplot-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for pycmplot-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bae06783cb031a4dd73bf4b4ce24d3e988f2de9658a4a3949880967afb9ce936
MD5 78cdb7f05d2ea68ce893072f1a9c5417
BLAKE2b-256 baa65a367619e96766401a3769241a69276613ffbe0e6c67b9d3dd90693daf20

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