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
-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.2.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.2-py3-none-any.whl (1.7 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pycmplot-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 d6fd96ddff5165140c0bf92fe617156d74d20b169c127f2d8dbb96c4ca57fbd7
MD5 b0463ead51f90d5a6551563634ccb644
BLAKE2b-256 2ab6185cd0badb841fc3b898cdf357e8fd8af32f9640f9ef206fc03594e314f3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycmplot-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 68a6ec551757d4ad44bad0dc4ba46528eca23665ca339dca49c38dc7756496c5
MD5 2221402e82bc2f86b6f752ea3d60ec1e
BLAKE2b-256 3de49cf9e63e97e8aa5daffe19d95c3b4f6d5b3a0e75a2ebe1f810efdf7cf8b5

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