Chromoplot
Flexible genome visualization toolkit for publication-ready figures.
Features
- Track-based composition: Stack multiple data types vertically
- Format-agnostic: BED, GFF, PAF, BAM, VCF, bedGraph, bigWig
- Multiple layouts: Single region, whole genome, comparative synteny
- Publication-ready: Clean defaults optimized for print
- Fully customizable: Themes, colors, and per-track styling
Installation
pip install chromoplot
# With optional dependencies for BAM/bigWig support
pip install chromoplot[full]
Quick Start
Single Region
import chromoplot as cp
fig = cp.GenomeFigure("genome.fa.fai", region="chr1:1-10000000")
fig.add_track(cp.IdeogramTrack())
fig.add_track(cp.GeneTrack("genes.gff3", label="Genes"))
fig.add_track(cp.HaplotypeTrack("haplotypes.bed", label="Haplotypes"))
fig.add_track(cp.ScaleBarTrack())
fig.save("figure.pdf")
Whole Genome
import chromoplot as cp
coords = cp.GenomeCoordinates.from_fai("genome.fa.fai")
layout = cp.GenomeLayout(coords, arrangement='grid', n_cols=5)
layout.add_track(cp.IdeogramTrack())
layout.add_track(cp.HaplotypeTrack("haplotypes.bed"))
layout.save("genome_wide.pdf")
Comparative Synteny
import chromoplot as cp
ref_coords = cp.GenomeCoordinates.from_fai("ref.fa.fai")
query_coords = cp.GenomeCoordinates.from_fai("query.fa.fai")
layout = cp.ComparativeLayout(
ref_coords, query_coords,
ref_region="chr1", query_region="chr1"
)
layout.add_ref_track(cp.IdeogramTrack())
layout.add_ref_track(cp.GeneTrack("ref_genes.gff3"))
layout.add_synteny_track(cp.SyntenyTrack("alignment.paf"))
layout.add_query_track(cp.GeneTrack("query_genes.gff3"))
layout.add_query_track(cp.IdeogramTrack())
layout.save("synteny.pdf")
Command Line
# Single region plot
chromoplot plot -r genome.fa.fai --region chr1:1-10000000 \
--gff genes.gff3 --haplotypes haplotypes.bed -o figure.pdf
# Whole genome plot
chromoplot genome -r genome.fa.fai --haplotypes haplotypes.bed -o genome.pdf
# Comparative synteny plot
chromoplot comparative --ref-fai ref.fa.fai --query-fai query.fa.fai \
--synteny alignment.paf --ref-region chr1 --query-region chr1 -o synteny.pdf
# From YAML config
chromoplot from-config config.yaml -o figure.pdf
Available Tracks
| Track | Description | Input Formats |
|---|---|---|
IdeogramTrack |
Chromosome backbone | (none) |
GeneTrack |
Gene models with exons | GFF3, GTF |
FeatureTrack |
Generic features | BED |
HaplotypeTrack |
Haplotype blocks | BED (phaser output) |
AlignmentTrack |
Sequence alignments | PAF |
DepthTrack |
Read coverage | BAM, bedGraph, bigWig |
SignalTrack |
Continuous signal | bedGraph, bigWig |
VariantTrack |
Variant positions | VCF |
SyntenyTrack |
Synteny ribbons | PAF, SyRI, MCScanX |
ScaleBarTrack |
Scale reference | (none) |
AnnotationTrack |
Text labels | TSV |
Themes
# Built-in themes
fig = cp.GenomeFigure(..., theme='publication') # Default
fig = cp.GenomeFigure(..., theme='presentation')
fig = cp.GenomeFigure(..., theme='minimal')
fig = cp.GenomeFigure(..., theme='dark')
# Custom theme
my_theme = cp.Theme(
figure_facecolor='white',
title_fontsize=14,
label_fontsize=10,
)
cp.register_theme('my_theme', my_theme)
Color Palettes
# Get palette
colors = cp.get_palette('categorical', n=5)
colors = cp.get_palette('founder_default')
colors = cp.get_palette('maize_heterotic')
# Founder colors for haplotype tracks
color_map = cp.founder_colors(['B73', 'Mo17', 'W22'])
# Maize NAM colors (by heterotic group)
color_map = cp.maize_nam_colors(['B73', 'Mo17', 'CML247'])
License
MIT License
Metadata
Release files for chromoplot 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| chromoplot-0.1.0.tar.gz | 49.6 kB | Without provenance | Details for chromoplot-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| chromoplot-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for chromoplot-0.1.0-py3-none-any.whl |
Total release size: 109.8 kB
Release files / chromoplot-0.1.0.tar.gz
| Download URL | chromoplot-0.1.0.tar.gz |
|---|---|
| Size | 49.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fe2225ec4c3ee80db2f4a6af5cd9acc259dc9217c4dc1cdd4e9fcd4cb68b9d8c
|
|
BLAKE2b-256 checksum How to use checksums |
33b5098509700a988184d4828eceab12a8679715650b7683e8d41366f67b0d7c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / chromoplot-0.1.0-py3-none-any.whl
| Download URL | chromoplot-0.1.0-py3-none-any.whl |
|---|---|
| Size | 60.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0d24004a88d4cd26b497415de2cc489dabe2d067edd59c920fdb7365ca835961
|
|
BLAKE2b-256 checksum How to use checksums |
1909d27b7d7938f966c72ba87501ede57b6545f08e791b4cedec194b86bc0e70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Security for chromoplot 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.