Palette).
Constructor
new
Create a Manhattan plot with default settings.ManhattanPlot
Defaults:
- Genome-wide threshold:
7.301(p = 5×10⁻⁸) - Suggestive threshold:
5.0(p = 1×10⁻⁵) - Color A:
"steelblue" - Color B:
"#5aadcb" - Point size:
2.5 - No labels, no legend
Data Input Methods
Three methods load data, each mapping(chrom, …, pvalue) onto the cumulative x-axis:
with_data
Input mode 1 — sequential integer x-coordinates.(chrom, pvalue) pairs. Chromosomes are sorted into standard genomic order (1–22, X, Y, MT); points within each chromosome receive consecutive integer x positions.
Iterator of
(chromosome_name, p_value) pairswith_data_bp
Input mode 2 — base-pair x-coordinates resolved from a reference genome build.(chrom, bp_position, pvalue) triplets. Each SNP’s x coordinate is computed as the chromosome’s cumulative offset plus its base-pair position.
Iterator of
(chromosome_name, base_pair_position, p_value) tripletsReference genome build (
Hg19, Hg38, T2T, or Custom)with_data_x
Input mode 3 — pre-computed cumulative x-coordinates.(chrom, x, pvalue) triplets where x is already in the cumulative coordinate system you want.
Iterator of
(chromosome_name, cumulative_x, p_value) tripletsThreshold Configuration
with_genome_wide
Set the genome-wide significance threshold in −log₁₀ scale.Significance threshold in −log₁₀ scale (default:
7.301 for p = 5×10⁻⁸)with_label_top labels.
with_suggestive
Set the suggestive significance threshold in −log₁₀ scale.Suggestive threshold in −log₁₀ scale (default:
5.0 for p = 1×10⁻⁵)Color Configuration
with_color_a
Set the color for even-indexed chromosomes (0, 2, 4, …).CSS color string (default:
"steelblue")Palette is set via with_palette.
with_color_b
Set the color for odd-indexed chromosomes (1, 3, 5, …).CSS color string (default:
"#5aadcb")Palette is set via with_palette.
with_palette
Override the alternating two-color scheme with a full palette.Color palette (colors cycle with modulo wrapping across chromosomes)
Point Configuration
with_point_size
Set the radius of each data point in pixels.Point radius in pixels (default:
2.5)with_pvalue_floor
Set an explicit p-value floor for the −log₁₀ transform.Minimum p-value before log transformation
pvalue == 0.0 are clamped to this value. When not set, the floor is inferred as the minimum non-zero p-value in the data.
Label Configuration
with_label_top
Label then most significant points above the genome-wide threshold.
Number of top points to label (default:
0)genome_wide.
Example:
with_label_style
Set the label placement style.Label placement style (default:
LabelStyle::Nudge)LabelStyle::Nudge— labels sorted by x and nudged vertically to reduce overlap (best default)LabelStyle::Exact— labels at exact point position; may overlapLabelStyle::Arrow { offset_x, offset_y }— labels offset by(offset_x, offset_y)px with a gray leader line
with_point_labels
Attach gene or SNP labels to individual points by(chromosome, x, label).
Iterator of
(chromosome, x_position, label) tripletsx value must match the coordinate assigned at data-load time. Matching uses a tolerance of ±0.5.
Example:
Legend
with_legend
Enable a legend showing genome-wide and suggestive threshold line entries.Legend label (must be set to enable the legend)
GenomeBuild Enum
Reference genome chromosome sizes used for cumulative x-coordinate layout.Variants
GenomeBuild::Hg19— GRCh37 / hg19 (24 chromosomes: 1–22, X, Y plus MT)GenomeBuild::Hg38— GRCh38 / hg38 (24 chromosomes: 1–22, X, Y plus MT)GenomeBuild::T2T— T2T-CHM13 v2.0 / hs1 (complete telomere-to-telomere assembly)GenomeBuild::Custom(Vec<(String, u64)>)— User-supplied(chrom_name, size_in_bp)list