Skip to content

Sumstats — Plot

Visualization methods on a loaded mysumstats object. Parameter lists match the visualization registry (help(mysumstats.plot_region)).

For top-level gl.plot_* functions, see Plotting.

plot_daf

plot_daf(**kwargs: Any) -> typing.Tuple[typing.Any, typing.Any]

Parameters:

Name Type Description Default
daf str

Discovery allele frequency column.

'DAF'
eaf str

Effect allele frequency column for DAF comparison plot.

'EAF'
fig_kwargs dict

Figure kwargs for plot.

{'figsize': [8, 4], 'dpi': 300}
font_kwargs dict

Font configuration kwargs.

{'fontsize': 9}
helper_line_kwargs dict

45-degree helper line styling for AF comparison.

{'color': 'black', 'linestyle': '-', 'lw': 1}
histplot_kwargs dict

Histogram plotting kwargs for AF distribution.

{'log_scale': [False, False]}
is_45_helper_line bool

Draw 45-degree helper line.

True
is_reg Any

Enable regression line computation.

required
is_threshold Any

Draw threshold line.

required
legend1 Any

Toggle first legend block.

required
legend2 Any

Toggle second legend block.

required
r2 bool

Show R-squared value.

False
r2_kwargs dict

Text kwargs for R^2 annotation in AF comparison.

{'va': 'bottom', 'ha': 'right'}
raf str

Reference allele frequency column.

'RAF'
reg_line_kwargs dict

Regression line styling for AF comparison.

{'color': '#cccccc', 'linestyle': '--'}
save bool

Boolean or output filepath; when boolean, uses default naming.

required
save_kwargs dict

Save kwargs for GW heatmap.

required
scatter_kwargs dict

Extra kwargs passed to the main scatter layer (matplotlib Axes.scatter). Use marker_size for point sizes, not s/size.

{'s': 1}
scatter_kwargs_outlier dict

Scatter kwargs for outlier points in AF comparison.

{'s': 3, 'c': 'red'}
threshold Any

AF difference threshold.

required
threshold_line_kwargs dict

Threshold helper line styling for AF comparison.

{'color': '#cccccc', 'linestyle': 'dotted'}
verbose bool

Verbose logging toggle.

True
xlabel Any

X-axis label.

required
ylabel Any

Y-axis label.

required

plot_gwheatmap

plot_gwheatmap(**kwargs: Any) -> typing.Any

Genome-wide association heatmap across traits or loci. Additional Manhattan-style kwargs are forwarded via mqq_kwargs inside the implementation.

Parameters:

Name Type Description Default
add_b bool

Add Manhattan panel below.

False
alpha float

Alpha for markers.

0.5
check bool

Enable input QC and normalization.

True
chr_dict Any

Chromosome number/name mapping.

required
chrom str

Chromosome column used to position variants and x-axis layout.

'CHR'
cis_windowsizekb int

Cis-window half-width (kb) for rows in the GWAS heatmap.

100
colors list

Color palette or list.

['#597FBD', '#74BAD3']
ea str

Effect allele column.

'EA'
eaf str

Effect allele frequency column.

'EAF'
fig_kwargs dict

Figure kwargs for plot.

required
font_family str

Font family, e.g., 'Arial', for consistent styling.

'Arial'
fontsize int

Font size for ticks, labels, etc.

12
grid_linecolor str

Grid line color.

'grey'
grid_linewidth int

Grid linewidth.

1
group str

Grouping column for axes.

'CIS/TRANS'
mlog10p str

Negative log10 p-value column; improves performance and stability if provided.

'MLOG10P'
nea str

Non-effect allele column.

'NEA'
p str

P-value column.

'P'
pos str

Base-pair position column used with chrom for plotting.

'POS'
ref_chrom str

Reference chromosome column.

'REF_CHR'
ref_pos str

Reference position column.

'REF_START'
save bool

Boolean or output filepath; when boolean, uses default naming.

True
save_kwargs dict

Save kwargs for GW heatmap.

required
scaled bool

Auto-detected when scaled effect columns exist; not a direct plot kwarg.

False
scatter_kwargs dict

Scatter kwargs for GWAS heatmap points.

required
sizes Any

Size list for style mapping.

required
snpid str

SNP identifier column.

'SNPID'
use_rank bool

Use rank for chrom indexing.

False
verbose bool

Verbose logging toggle.

True
xchrpad int

Chrom padding for x grouping.

0
xtick_chr_dict Any

X-axis tick chromosome mapping.

required
ychrpad int

Chrom padding for y grouping.

0
ytick_chr_dict Any

Map chromosome numbers to y-axis tick labels on GW heatmap.

required

plot_mqq

plot_mqq(build: Optional[str] = None, **kwargs: Any) -> typing.Any

Combined Manhattan–QQ plot by default; set mode for other layouts. For mode-specific parameter lists use plot_manhattan(), plot_qq(), plot_region(), or plot_snp_density().

Parameters:

Name Type Description Default
mode str

Plot layout mode. Values depend on the plot function; see ctx_desc.

'mqq'
build str

Genome build (e.g., '19'/'38') for annotation/coordinate resources.

None
sig_level float

Significance threshold for reference line and marker sizing.

5e-08
anno_sig_level float

Significance level for extracting lead variants to annotate. Can be set independently from sig_level.

5e-08
skip int

Minimum -log10(P) for variants shown on the plot (variants below this are omitted).

0
cut int

Cap variant -log10(P) display above this value (squashes extreme peaks for layout).

0
marker_size list

Scatter marker size. Use an int for fixed size, or a (small, large) tuple for variants below/above sig_level.

[5, 20]
additional_line Any

Additional reference lines.

required
additional_line_color str or list

Colors for additional lines.

required
anno DataFrame or list

Annotation source or column (e.g., 'GENENAME', True, or column name).

required
anno_adjust bool

Enable annotation position adjustment.

False
anno_alias dict

Mapping from SNPID to custom annotation label.

{}
anno_d dict

Per-annotation positioning options (e.g., left/right).

{}
anno_fixed_arm_length Any

Fixed arm length for annotations.

required
anno_fontsize int

Font size for annotation text.

9
anno_gtf_path str

Custom GTF path for annotations.

required
anno_height int

Height for annotations.

1
anno_kwargs dict

Default styling kwargs for annotations.

{}
anno_kwargs_single dict

Per-SNP styling kwargs for annotations.

{}
anno_max_iter int

Maximum iterations for text repulsion algorithm.

100
anno_max_rows int

Maximum number of annotation rows to display. If more variants are provided, they will be sorted by p-value or -log10(p-value) and only the top ones will be shown.

40
anno_set list

Set of variant IDs to annotate.

[]
anno_source str

Annotation source backend (e.g., 'ensembl', 'refseq').

'ensembl'
anno_style str

Annotation style ('right', 'tight', 'expand').

'right'
anno_xshift Any

X-axis shift applied to annotations.

required
arm_offset Any

Offset for annotation arms.

required
arm_scale int

Scaling factor for arm length.

1
arm_scale_d dict

Per-annotation arm scaling dict.

{}
arrow_kwargs dict

Arrow styling kwargs for annotations.

{}
bwindowsizekb int

Window size in kilobases for density computation.

100
check bool

Enable input QC and normalization.

True
chr_dict Any

Chromosome number/name mapping.

required
chrom str

Chromosome column used to position variants and x-axis layout.

'CHR'
chrpad float

Chromosome padding proportion.

0.03
colors list

Color palette or list.

['#597FBD', '#74BAD3']
cut_line_color str or list

Color for shrink line.

required
cut_log bool

Use log scale for cut line.

False
cutfactor int

Factor for shrink line.

10
density_color str or list

Density palette or boolean to control density track colors.

required
density_palette str

Density palette.

'Reds'
density_range Any

Density value range.

required
density_threshold int

Threshold for density highlighting.

5
density_tpalette str

Palette for threshold coloring.

'Blues'
density_trange list

Threshold range.

[0, 10]
dpi int

Figure DPI.

200
drop_chr_start bool

Drop chromosome start.

False
ea str

Effect allele column.

'EA'
eaf str

Effect allele frequency column.

'EAF'
expected_min_mlog10p int

Expected minimum -log10(P) adjustment.

0
fig_kwargs dict

Figure kwargs for plot.

{'figsize': [15, 5], 'dpi': 200}
figax Any

Existing figure/axes tuple to draw on.

required
font_family str

Font family, e.g., 'Arial', for consistent styling.

'Arial'
fontfamily str

Font family alias.

'Arial'
fontsize int

Font size for ticks, labels, etc.

10
gc bool

Compute genomic control lambda.

True
highlight list

List of focal variants to highlight.

[]
highlight_anno_kwargs dict

Annotation style kwargs for highlighted variants.

{}
highlight_chrpos bool

Highlight by chromosome position flag.

False
highlight_color str or list

Highlight color.

required
highlight_lim Any

Custom highlight limits.

required
highlight_lim_mode str

Highlight limit mode ('absolute'|'relative').

'absolute'
highlight_windowkb int

Highlight window size (kb).

500
include_chrXYMT bool

Include sex/MT chromosomes in QQ.

True
jagged bool

Enable jagged axis break markers.

False
jagged_len float

Jagged marker length.

0.01
jagged_wid float

Jagged marker width.

0.01
maf_bin_colors str or list

Colors for MAF bins.

required
maf_bins list

MAF bin definitions for stratified QQ.

[[0, 0.01], [0.01, 0.05], [0.05, 0.25], [0.25, 0.5]]
math_fontfamily str

Math text font family.

'dejavusans'
mlog10p str

-log10(P) values driving Manhattan heights and QQ distribution.

'MLOG10P'
mqqratio int

Layout ratio for combined Manhattan-QQ plot.

3
mtitle Any

Manhattan title.

required
mtitle_pad float

Manhattan title padding.

1.08
nea str

Non-effect allele column.

'NEA'
p str

P-value column.

'P'
pinpoint list

Variants to pinpoint.

[]
pinpoint_color str or list

Color for pinpoint.

required
pos str

Base-pair position column used with chrom for plotting.

'POS'
qq_line_color str or list

Reference line color for QQ plot (e.g., 'grey').

required
qq_scatter_kwargs dict

Style dict for QQ scatter (e.g., marker, s, edgecolor).

{}
qq_xlabels Any

Custom x-axis tick labels for QQ plot.

required
qq_xlim Any

X-axis limits for QQ plot, e.g., (min, max).

required
qqscatterargs Any

QQ scatter kwargs alias.

required
qtitle Any

Manhattan/QQ combined title.

required
qtitle_pad float

QQ title padding.

1.08
repel_force float

Text repulsion force parameter.

0.03
save bool

Boolean or output filepath; when boolean, uses default naming.

required
save_kwargs dict

Save kwargs for GW heatmap.

required
sc_linewidth int

Line width for significance lines.

2
scaled bool

Auto-detected when scaled effect columns exist; not a direct plot kwarg.

False
scatter_kwargs dict

Extra kwargs passed to the main scatter layer (matplotlib Axes.scatter). Use marker_size for point sizes, not s/size. Do not set in scatter_kwargs: edgecolor, edgecolors, linewidth, ax, palette, hue, data, legend, style, size, sizes, zorder, s.

required
sig_line bool

Whether to draw significance reference line.

True
sig_line_color str or list

Significance line color.

required
snpid str

SNP identifier column.

'SNPID'
stratified bool

Enable stratified QQ by MAF.

False
suggestive_sig_level float

Suggestive threshold value, e.g., 5e-6.

5e-06
suggestive_sig_line bool

Whether to draw suggestive threshold line (e.g., 5e-6).

False
suggestive_sig_line_color str or list

Suggestive significance line color.

required
title str

Figure title text.

required
title_fontsize int

Title font size.

13
title_pad float

Title padding.

1.08
use_rank bool

Use rank for chrom indexing.

False
verbose bool

Verbose logging toggle.

True
windowsizekb int

Window size for lead variant extraction (kb).

500
xlabel Any

X-axis label.

required
xpad Any

X padding proportion.

required
xpadl Any

Left X padding.

required
xpadr Any

Right X padding.

required
xtick_chr_dict Any

X-axis tick chromosome mapping.

required
xtight bool

Tight X padding.

False
ylabel Any

Y-axis label.

required
ylabels Any

Custom y-axis labels.

required
ylim Any

Y-axis limits.

required
ystep int

Step size for y-axis.

0
ytick3 bool

Use 3 y-axis ticks.

True

Returns:

Type Description
matplotlib.figure.Figure

The created matplotlib figure object. tuple, optional (lead_snp_is, lead_snp_is_color) when _get_region_lead=True in regional mode.

Notes
- Regional plots require ``region=(chr, start, end)`` and LD data (``vcf_path`` or precomputed LD).
- Use ``skip`` to omit low-significance variants for faster genome-wide plots.
- Annotation supports gene names, custom columns, or variant IDs.

plot_manhattan

plot_manhattan(build: Optional[str] = None, **kwargs: Any) -> typing.Any

Genome-wide Manhattan plot (mode='m').

Parameters:

Name Type Description Default
mode str

Plot layout mode. Values depend on the plot function; see ctx_desc.

'mqq'
build str

Genome build (e.g., '19'/'38') for annotation/coordinate resources.

None
sig_level float

Significance threshold for reference line and marker sizing.

5e-08
anno_sig_level float

Significance level for extracting lead variants to annotate. Can be set independently from sig_level.

5e-08
skip int

Minimum -log10(P) for variants shown on the plot (variants below this are omitted).

0
cut int

Cap variant -log10(P) display above this value (squashes extreme peaks for layout).

0
marker_size list

Scatter marker size. Use an int for fixed size, or a (small, large) tuple for variants below/above sig_level.

[5, 20]
additional_line Any

Additional reference lines.

required
additional_line_color str or list

Colors for additional lines.

required
anno DataFrame or list

Annotation source or column (e.g., 'GENENAME', True, or column name).

required
anno_adjust bool

Enable annotation position adjustment.

False
anno_alias dict

Mapping from SNPID to custom annotation label.

{}
anno_d dict

Per-annotation positioning options (e.g., left/right).

{}
anno_fixed_arm_length Any

Fixed arm length for annotations.

required
anno_fontsize int

Font size for annotation text.

9
anno_gtf_path str

Custom GTF path for annotations.

required
anno_height int

Height for annotations.

1
anno_kwargs dict

Default styling kwargs for annotations.

{}
anno_kwargs_single dict

Per-SNP styling kwargs for annotations.

{}
anno_max_iter int

Maximum iterations for text repulsion algorithm.

100
anno_max_rows int

Maximum number of annotation rows to display. If more variants are provided, they will be sorted by p-value or -log10(p-value) and only the top ones will be shown.

40
anno_set list

Set of variant IDs to annotate.

[]
anno_source str

Annotation source backend (e.g., 'ensembl', 'refseq').

'ensembl'
anno_style str

Annotation style ('right', 'tight', 'expand').

'right'
anno_xshift Any

X-axis shift applied to annotations.

required
arm_offset Any

Offset for annotation arms.

required
arm_scale int

Scaling factor for arm length.

1
arm_scale_d dict

Per-annotation arm scaling dict.

{}
arrow_kwargs dict

Arrow styling kwargs for annotations.

{}
bwindowsizekb int

Window size in kilobases for density computation.

100
check bool

Enable input QC and normalization.

True
chr_dict Any

Chromosome number/name mapping.

required
chrom str

Chromosome column used to position variants and x-axis layout.

'CHR'
chrpad float

Chromosome padding proportion.

0.03
colors list

Color palette or list.

['#597FBD', '#74BAD3']
cut_line_color str or list

Color for shrink line.

required
cut_log bool

Use log scale for cut line.

False
cutfactor int

Factor for shrink line.

10
density_color str or list

Density palette or boolean to control density track colors.

required
density_palette str

Density palette.

'Reds'
density_range Any

Density value range.

required
density_threshold int

Threshold for density highlighting.

5
density_tpalette str

Palette for threshold coloring.

'Blues'
density_trange list

Threshold range.

[0, 10]
dpi int

Figure DPI.

200
drop_chr_start bool

Drop chromosome start.

False
ea str

Effect allele column.

'EA'
eaf str

Effect allele frequency column.

'EAF'
expected_min_mlog10p int

Expected minimum -log10(P) adjustment.

0
fig_kwargs dict

Figure kwargs for plot.

{'figsize': [15, 5], 'dpi': 200}
figax Any

Existing figure/axes tuple to draw on.

required
font_family str

Font family, e.g., 'Arial', for consistent styling.

'Arial'
fontfamily str

Font family alias.

'Arial'
fontsize int

Font size for ticks, labels, etc.

12
gc bool

Compute genomic control lambda.

True
highlight list

List of focal variants to highlight.

[]
highlight_anno_kwargs dict

Annotation style kwargs for highlighted variants.

{}
highlight_chrpos bool

Highlight by chromosome position flag.

False
highlight_color str or list

Highlight color.

required
highlight_lim Any

Custom highlight limits.

required
highlight_lim_mode str

Highlight limit mode ('absolute'|'relative').

'absolute'
highlight_windowkb int

Highlight window size (kb).

500
include_chrXYMT bool

Include sex/MT chromosomes in QQ.

True
jagged bool

Enable jagged axis break markers.

False
jagged_len float

Jagged marker length.

0.01
jagged_wid float

Jagged marker width.

0.01
maf_bin_colors str or list

Colors for MAF bins.

required
maf_bins list

MAF bin definitions for stratified QQ.

[[0, 0.01], [0.01, 0.05], [0.05, 0.25], [0.25, 0.5]]
math_fontfamily str

Math text font family.

'dejavusans'
mlog10p str

Negative log10 p-value column; improves performance and stability if provided.

'MLOG10P'
mqqratio int

Layout ratio for combined Manhattan-QQ plot.

3
mtitle Any

Manhattan title.

required
mtitle_pad float

Manhattan title padding.

1.08
nea str

Non-effect allele column.

'NEA'
p str

P-value column.

'P'
pinpoint list

Variants to pinpoint.

[]
pinpoint_color str or list

Color for pinpoint.

required
pos str

Base-pair position column used with chrom for plotting.

'POS'
qq_line_color str or list

Reference line color for QQ plot (e.g., 'grey').

required
qq_scatter_kwargs dict

Style dict for QQ scatter (e.g., marker, s, edgecolor).

{}
qq_xlabels Any

Custom x-axis tick labels for QQ plot.

required
qq_xlim Any

X-axis limits for QQ plot, e.g., (min, max).

required
qqscatterargs Any

QQ scatter kwargs alias.

required
qtitle Any

Manhattan/QQ combined title.

required
qtitle_pad float

QQ title padding.

1.08
repel_force float

Text repulsion force parameter.

0.03
save bool

Boolean or output filepath; when boolean, uses default naming.

required
save_kwargs dict

Save kwargs for GW heatmap.

required
sc_linewidth int

Line width for significance lines.

2
scaled bool

Auto-detected when scaled effect columns exist; not a direct plot kwarg.

False
scatter_kwargs dict

Extra kwargs passed to the main scatter layer (matplotlib Axes.scatter). Use marker_size for point sizes, not s/size. Do not set in scatter_kwargs: edgecolor, edgecolors, linewidth, ax, palette, hue, data, legend, style, size, sizes, zorder, s.

required
sig_line bool

Whether to draw significance reference line.

True
sig_line_color str or list

Significance line color.

required
snpid str

SNP identifier column.

'SNPID'
stratified bool

Enable stratified QQ by MAF.

False
suggestive_sig_level float

Suggestive threshold value, e.g., 5e-6.

5e-06
suggestive_sig_line bool

Whether to draw suggestive threshold line (e.g., 5e-6).

False
suggestive_sig_line_color str or list

Suggestive significance line color.

required
title str

Figure title text.

required
title_fontsize int

Title font size.

13
title_pad float

Title padding.

1.08
use_rank bool

Use rank for chrom indexing.

False
verbose bool

Verbose logging toggle.

True
windowsizekb int

Window size for lead variant extraction (kb).

500
xlabel Any

X-axis label.

required
xpad Any

X padding proportion.

required
xpadl Any

Left X padding.

required
xpadr Any

Right X padding.

required
xtick_chr_dict Any

X-axis tick chromosome mapping.

required
xtight bool

Tight X padding.

False
ylabel Any

Y-axis label.

required
ylabels Any

Custom y-axis labels.

required
ylim Any

Y-axis limits.

required
ystep int

Step size for y-axis.

0
ytick3 bool

Use 3 y-axis ticks.

True

Returns:

Type Description
matplotlib.figure.Figure

The created matplotlib figure object. tuple, optional (lead_snp_is, lead_snp_is_color) when _get_region_lead=True in regional mode.

Notes
- Regional plots require ``region=(chr, start, end)`` and LD data (``vcf_path`` or precomputed LD).
- Use ``skip`` to omit low-significance variants for faster genome-wide plots.
- Annotation supports gene names, custom columns, or variant IDs.

plot_snp_density

plot_snp_density(build: Optional[str] = None, **kwargs: Any) -> typing.Any

Brisbane-style SNP density plot.

Parameters:

Name Type Description Default
mode str

Brisbane SNP-density layout (mode is forced to b).

'mqq'
build str

Genome build (e.g., '19'/'38') for annotation/coordinate resources.

None
sig_level float

Significance threshold for reference line and marker sizing.

5e-08
anno_sig_level float

Significance level for extracting lead variants to annotate. Can be set independently from sig_level.

5e-08
skip int

Minimum -log10(P) for variants shown on the plot (variants below this are omitted).

0
cut int

Cap variant -log10(P) display above this value (squashes extreme peaks for layout).

0
marker_size list

Scatter marker size. Use an int for fixed size, or a (small, large) tuple for variants below/above sig_level.

[5, 20]
additional_line Any

Additional reference lines.

required
additional_line_color str or list

Colors for additional lines.

required
anno DataFrame or list

Annotation source or column (e.g., 'GENENAME', True, or column name).

required
anno_adjust bool

Enable annotation position adjustment.

False
anno_alias dict

Mapping from SNPID to custom annotation label.

{}
anno_d dict

Per-annotation positioning options (e.g., left/right).

{}
anno_fixed_arm_length Any

Fixed arm length for annotations.

required
anno_fontsize int

Font size for annotation text.

9
anno_gtf_path str

Custom GTF path for annotations.

required
anno_height int

Height for annotations.

1
anno_kwargs dict

Default styling kwargs for annotations.

{}
anno_kwargs_single dict

Per-SNP styling kwargs for annotations.

{}
anno_max_iter int

Maximum iterations for text repulsion algorithm.

100
anno_max_rows int

Maximum number of annotation rows to display. If more variants are provided, they will be sorted by p-value or -log10(p-value) and only the top ones will be shown.

40
anno_set list

Set of variant IDs to annotate.

[]
anno_source str

Annotation source backend (e.g., 'ensembl', 'refseq').

'ensembl'
anno_style str

Annotation style ('right', 'tight', 'expand').

'right'
anno_xshift Any

X-axis shift applied to annotations.

required
arm_offset Any

Offset for annotation arms.

required
arm_scale int

Scaling factor for arm length.

1
arm_scale_d dict

Per-annotation arm scaling dict.

{}
arrow_kwargs dict

Arrow styling kwargs for annotations.

{}
bwindowsizekb int

Window size in kilobases for density computation.

100
check bool

Enable input QC and normalization.

True
chr_dict Any

Chromosome number/name mapping.

required
chrom str

Chromosome column used to position variants and x-axis layout.

'CHR'
chrpad float

Chromosome padding proportion.

0.03
colors list

Color palette or list.

['#597FBD', '#74BAD3']
cut_line_color str or list

Color for shrink line.

required
cut_log bool

Use log scale for cut line.

False
cutfactor int

Factor for shrink line.

10
density_color str or list

Density palette or boolean to control density track colors.

required
density_palette str

Density palette.

'Reds'
density_range Any

Density value range.

required
density_threshold int

Threshold for density highlighting.

5
density_tpalette str

Palette for threshold coloring.

'Blues'
density_trange list

Threshold range.

[0, 10]
dpi int

Figure DPI.

200
drop_chr_start bool

Drop chromosome start.

False
ea str

Effect allele column.

'EA'
eaf str

Effect allele frequency column.

'EAF'
expected_min_mlog10p int

Expected minimum -log10(P) adjustment.

0
fig_kwargs dict

Figure kwargs for plot.

{'figsize': [15, 5], 'dpi': 200}
figax Any

Existing figure/axes tuple to draw on.

required
font_family str

Font family, e.g., 'Arial', for consistent styling.

'Arial'
fontfamily str

Font family alias.

'Arial'
fontsize int

Font size for ticks, labels, etc.

12
highlight list

List of focal variants to highlight.

[]
highlight_anno_kwargs dict

Annotation style kwargs for highlighted variants.

{}
highlight_chrpos bool

Highlight by chromosome position flag.

False
highlight_color str or list

Highlight color.

required
highlight_lim Any

Custom highlight limits.

required
highlight_lim_mode str

Highlight limit mode ('absolute'|'relative').

'absolute'
highlight_windowkb int

Highlight window size (kb).

500
include_chrXYMT bool

Include sex/MT chromosomes in QQ.

True
jagged bool

Enable jagged axis break markers.

False
jagged_len float

Jagged marker length.

0.01
jagged_wid float

Jagged marker width.

0.01
maf_bin_colors str or list

Colors for MAF bins.

required
maf_bins list

MAF bin definitions for stratified QQ.

[[0, 0.01], [0.01, 0.05], [0.05, 0.25], [0.25, 0.5]]
math_fontfamily str

Math text font family.

'dejavusans'
mlog10p str

Negative log10 p-value column; improves performance and stability if provided.

'MLOG10P'
mqqratio int

Layout ratio for combined Manhattan-QQ plot.

3
mtitle Any

Manhattan title.

required
mtitle_pad float

Manhattan title padding.

1.08
nea str

Non-effect allele column.

'NEA'
p str

P-value column.

'P'
pinpoint list

Variants to pinpoint.

[]
pinpoint_color str or list

Color for pinpoint.

required
pos str

Base-pair position column used with chrom for plotting.

'POS'
qqscatterargs Any

QQ scatter kwargs alias.

required
repel_force float

Text repulsion force parameter.

0.03
save bool

Boolean or output filepath; when boolean, uses default naming.

required
save_kwargs dict

Save kwargs for GW heatmap.

required
sc_linewidth int

Line width for significance lines.

2
scaled bool

Auto-detected when scaled effect columns exist; not a direct plot kwarg.

False
scatter_kwargs dict

Extra kwargs passed to the main scatter layer (matplotlib Axes.scatter). Use marker_size for point sizes, not s/size.

required
sig_line bool

Whether to draw significance reference line.

True
sig_line_color str or list

Significance line color.

required
snpid str

SNP identifier column.

'SNPID'
suggestive_sig_level float

Suggestive threshold value, e.g., 5e-6.

5e-06
suggestive_sig_line bool

Whether to draw suggestive threshold line (e.g., 5e-6).

False
suggestive_sig_line_color str or list

Suggestive significance line color.

required
title str

Figure title text.

required
title_fontsize int

Title font size.

13
title_pad float

Title padding.

1.08
use_rank bool

Use rank for chrom indexing.

False
verbose bool

Verbose logging toggle.

True
windowsizekb int

Window size for lead variant extraction (kb).

500
xlabel Any

X-axis label.

required
xpad Any

X padding proportion.

required
xpadl Any

Left X padding.

required
xpadr Any

Right X padding.

required
xtick_chr_dict Any

X-axis tick chromosome mapping.

required
xtight bool

Tight X padding.

False
ylabel Any

Y-axis label.

required
ylabels Any

Custom y-axis labels.

required
ylim Any

Y-axis limits.

required
ystep int

Step size for y-axis.

0
ytick3 bool

Use 3 y-axis ticks.

True

Returns:

Type Description
matplotlib.figure.Figure

The created matplotlib figure object. tuple, optional (lead_snp_is, lead_snp_is_color) when _get_region_lead=True in regional mode.

Notes
- Regional plots require ``region=(chr, start, end)`` and LD data (``vcf_path`` or precomputed LD).
- Use ``skip`` to omit low-significance variants for faster genome-wide plots.
- Annotation supports gene names, custom columns, or variant IDs.

plot_qq

plot_qq(build: Optional[str] = None, **kwargs: Any) -> typing.Any

Quantile–quantile plot.

Parameters:

Name Type Description Default
skip int

Minimum -log10(P) for variants shown on the plot (variants below this are omitted).

0
cut int

Cap variant -log10(P) display above this value (squashes extreme peaks for layout).

0
marker_size list

Scatter marker size. Use an int for fixed size, or a (small, large) tuple for variants below/above sig_level.

required
colors list

Color palette or list.

['#597FBD', '#74BAD3']
cut_log bool

Use log scale for cut line.

False
cutfactor int

Factor for shrink line.

10
fig_kwargs dict

Figure kwargs for plot.

required
figax Any

Existing figure/axes tuple to draw on.

required
font_family str

Font family, e.g., 'Arial', for consistent styling.

'Arial'
fontsize int

Font size for ticks, labels, etc.

12
gc bool

Compute genomic control lambda.

True
highlight list

List of focal variants to highlight.

[]
mlog10p str

Observed -log10(P) used against expected under null in QQ plot.

'MLOG10P'
p str

P-value column.

'P'
pinpoint list

Variants to pinpoint.

[]
qq_line_color str or list

Reference line color for QQ plot (e.g., 'grey').

required
qq_scatter_kwargs dict

Style dict for QQ scatter (e.g., marker, s, edgecolor).

{}
qq_xlabels Any

Custom x-axis tick labels for QQ plot.

required
qq_xlim Any

X-axis limits for QQ plot, e.g., (min, max).

required
qtitle Any

Manhattan/QQ combined title.

required
qtitle_pad float

QQ title padding.

1.08
save bool

Boolean or output filepath; when boolean, uses default naming.

required
save_kwargs dict

Save kwargs for GW heatmap.

required
title str

Figure title text.

required
verbose bool

Verbose logging toggle.

True
ylabels Any

Custom y-axis labels.

required
ystep int

Step size for y-axis.

0
ytick3 bool

Use 3 y-axis ticks.

True

Returns:

Type Description
matplotlib.figure.Figure

The created matplotlib figure object. tuple, optional (lead_snp_is, lead_snp_is_color) when _get_region_lead=True in regional mode.

Notes
- Regional plots require ``region=(chr, start, end)`` and LD data (``vcf_path`` or precomputed LD).
- Use ``skip`` to omit low-significance variants for faster genome-wide plots.
- Annotation supports gene names, custom columns, or variant IDs.

plot_region

plot_region(build: Optional[str] = None, **kwargs: Any) -> typing.Any

Regional association plot with optional LD, recombination, and gene tracks.

Parameters:

Name Type Description Default
mode str

Plot layout mode. Values depend on the plot function; see ctx_desc.

required
region tuple or str

Required locus for plot_region(). Example: (7, 156538803, 157538803). Use get_region_start_and_end() to derive windows.

required
build str

Genome build (e.g., '19'/'38') for annotation/coordinate resources.

None
sig_level float

Significance threshold for reference line and marker sizing.

5e-08
anno_sig_level float

Significance level for extracting lead variants to annotate. Can be set independently from sig_level.

5e-08
skip int

Minimum -log10(P) for variants shown on the plot (variants below this are omitted).

0
cut int

Cap variant -log10(P) display above this value (squashes extreme peaks for layout).

0
marker_size list

Tuple (small, large) for non-lead vs lead/significant tiers on the locus scatter; reference overlay uses ~1.5× max.

[40, 65]
vcf_path str

Required for LD-colored scatter, ld_block, and ld_link unless ld_path is provided. Biallelic unphased VCF is supported.

required
ld_block bool

Requires vcf_path (or ld_path) and region. Controlled with ld_block_grid/anno_* options.

False
ld_link bool

Draws pairs with r² ≥ region_ld_threshold[0]. Line color follows region_ld_colors bins (same as markers); alpha scales by r² × ld_link_alpha_scale. Filter pairs with ld_link_sig_level.

False
additional_line Any

Additional reference lines.

required
additional_line_color str or list

Colors for additional lines.

required
anno DataFrame or list

Annotation source or column (e.g., 'GENENAME', True, or column name).

required
anno_adjust bool

Enable annotation position adjustment.

False
anno_alias dict

Mapping from SNPID to custom annotation label.

{}
anno_cell bool

Used with ld_block=True; format via anno_cell_fmt.

False
anno_cell_fmt str

Format string for LD cell annotations (e.g., '{:.2f}' for 2 decimal places).

'{:.2f}'
anno_cell_kwargs Any

Additional keyword arguments for LD cell text annotations (e.g., {'fontsize': 10, 'weight': 'bold', 'color': 'white'}).

required
anno_d dict

Per-annotation positioning options (e.g., left/right).

{}
anno_fixed_arm_length Any

Fixed arm length for annotations.

required
anno_fontsize int

Font size for annotation text.

9
anno_gtf_path str

Custom GTF path for annotations.

required
anno_height int

Height for annotations.

1
anno_kwargs dict

Default styling kwargs for annotations.

{}
anno_kwargs_single dict

Per-SNP styling kwargs for annotations.

{}
anno_max_iter int

Maximum iterations for text repulsion algorithm.

100
anno_max_rows int

Maximum number of annotation rows to display. If more variants are provided, they will be sorted by p-value or -log10(p-value) and only the top ones will be shown.

40
anno_set list

Set of variant IDs to annotate.

[]
anno_source str

Annotation source backend (e.g., 'ensembl', 'refseq').

'ensembl'
anno_style str

Annotation style ('right', 'tight', 'expand').

'right'
anno_xshift Any

X-axis shift applied to annotations.

required
arm_offset Any

Offset for annotation arms.

required
arm_scale int

Scaling factor for arm length.

1
arm_scale_d dict

Per-annotation arm scaling dict.

{}
arrow_kwargs dict

Arrow styling kwargs for annotations.

{}
cbar_bbox_to_anchor list

Colorbar bbox_to_anchor.

[0, 0, 1, 1]
cbar_borderpad Any

Colorbar border padding.

required
cbar_downward_offset float

Colorbar downward offset.

1.3
cbar_equal_aspect bool

Equal aspect for colorbar.

True
cbar_font_family str

Colorbar font family.

'Arial'
cbar_fontsize int

Colorbar font size.

12
cbar_h_scale int

Colorbar height scale.

1
cbar_scale bool

Scale colorbar.

True
cbar_title str

Shown when region_ld_legend=True; LaTeX r² supported in default.

'LD $\\mathregular{r^2}$ with variant'
cbar_w_scale int

Colorbar width scale.

1
check bool

Enable input QC and normalization.

True
chr_dict Any

Chromosome number/name mapping.

required
chrom str

Chromosome column used to position variants and x-axis layout.

'CHR'
chrpad float

Chromosome padding proportion.

0.03
colors list

Color palette or list.

['#597FBD', '#74BAD3']
cut_line_color str or list

Color for shrink line.

required
cut_log bool

Use log scale for cut line.

False
cutfactor int

Factor for shrink line.

10
dpi int

Figure DPI.

200
drop_chr_start bool

Drop chromosome start.

False
ea str

Effect allele column.

'EA'
eaf str

Effect allele frequency column.

'EAF'
fig_kwargs dict

Figure kwargs for plot.

{'figsize': [15, 15], 'dpi': 200}
figax Any

Existing figure/axes tuple to draw on.

required
font_family str

Font family, e.g., 'Arial', for consistent styling.

'Arial'
fontfamily str

Font family alias.

'Arial'
fontsize int

Font size for ticks, labels, etc.

12
gtf_chr_dict Any

GTF chromosome dictionary.

required
gtf_gene_name Any

GTF gene name column.

required
gtf_path str

'default' uses built-in annotation for build. Filter protein-coding with region_protein_coding.

'default'
ld_block_anno bool

Left-side variant labels on the LD triangle; True uses chr:pos, or pass a column name (SNPID, rsID).

False
ld_block_anno_kwargs Any

Additional keyword arguments for left-side annotations (e.g., {'fontsize': 8, 'color': 'black'}).

required
ld_block_anno_max_rows int

Maximum number of variants to annotate. If the number of variants to annotate exceeds this limit, annotations will be skipped.

100
ld_block_anno_set Any

List of SNPIDs to annotate. If None, annotates all variants. Variants are matched by SNPID column.

required
ld_block_grid bool

Style via ld_block_grid_kwargs; panel requires ld_block=True.

False
ld_block_grid_kwargs Any

Additional keyword arguments for LD block grid lines (e.g., {'color': 'gray', 'linewidth': 0.5, 'alpha': 0.5}).

required
ld_fmt str

LD format identifier (e.g., 'npz').

'npz'
ld_if_add_T bool

Add transpose when composing LD.

False
ld_if_square bool

Treat LD matrix as square.

False
ld_link_alpha_scale float

Higher values make high-LD links more opaque.

0.2
ld_link_color str or list

Currently unused—line colors match region_ld_threshold/region_ld_colors bins.

required
ld_link_linewidth float

Fixed width; color/alpha still reflect LD bin and r².

1.0
ld_link_sig_level Any

Defaults to sig_level when None. Independent from anno_sig_level.

required
ld_link_thr float

Currently not read by the implementation—minimum link r² is region_ld_threshold[0]; set bins via region_ld_threshold instead.

0.8
ld_map_kwargs Any

Extra kwargs for LD map loader.

required
ld_map_path str

Path to LD map file.

required
ld_map_rename_dic Any

Rename dictionary for LD map columns.

required
ld_path str

When set with ld_fmt, skips VCF LD calculation.

required
math_fontfamily str

Math text font family.

'dejavusans'
mlog10p str

-log10(P) values for y-axis in regional plot.

'MLOG10P'
nea str

Non-effect allele column.

'NEA'
p str

P-value column.

'P'
pos str

Base-pair position column used with chrom for plotting.

'POS'
qqscatterargs Any

QQ scatter kwargs alias.

required
region_anno_bbox_kwargs dict

Annotation bbox kwargs for region.

{'ec': 'None', 'fc': 'None'}
region_flank_factor float

Expands (start, end) symmetrically before plotting.

0.05
region_grid bool

Styled with region_grid_line.

False
region_grid_line dict

Grid line style for regional plot.

{'linewidth': 2, 'linestyle': '--'}
region_hspace float

Matplotlib hspace between ax1/ax3/ax4 panels.

0.02
region_ld_colors str or list

List length = len(region_ld_threshold)+3. Index 0: no/missing LD; indices 1…N: LD intervals between thresholds; last index: reference/lead variant. Default 7 colors for 4 thresholds. ld_link reuses these colors.

required
region_ld_colors_m list

When len(region_ref)>1, each color builds a white→color gradient across the same bins as region_ld_threshold. Variant shape comes from region_marker_shapes[1+] per reference, not from LD tier.

['#E51819', '#367EB7', 'green', '#F07818', '#AD5691', 'yellow', 'purple']
region_ld_legend bool

True when vcf_path or ld_path supplies LD; uses region_ld_threshold/colors legend.

True
region_ld_threshold list

Ascending r² boundaries, e.g. [0.2, 0.4, 0.6, 0.8]. Bins: missing/0, (0→t0], (t0→t1], …, (t_last→1], plus reference/lead. Pair with region_ld_colors (len = len(thresholds)+3). ld_link draws pairs with r² ≥ thresholds[0].

[0.2, 0.4, 0.6, 0.8]
region_lead_grid bool

Styled with region_lead_grid_line (default red dashed).

True
region_lead_grid_line dict

Default: red dashed, alpha 0.5, linewidth 2. Used when region_lead_grid=True.

{'alpha': 0.5, 'linewidth': 2, 'linestyle': '--', 'color': '#FF0000'}
region_legend_marker bool

Uses region_marker_shapes[2] (single-ref) inside the colorbar when True.

True
region_marker_shapes list

Shape by index; LD r² controls color via region_ld_threshold/region_ld_colors, not shape. Index 0: missing LD (default 'X'). Index 1: variants with LD data. Index 2+: reference variant(s)—single-ref uses index 2; multi-ref uses 2, 3, … Do not set scatter_kwargs['marker'].

['X', 'o', '^', 's', 'D', '*', 'P', 'h', '8']
region_protein_coding bool

Applies when gtf_path is set (or 'default').

True
region_recombination bool

Uses rr_path, rr_lim, rr_ylabel; disable to hide the RR panel.

True
region_ref Any

SNPID or rsID list, e.g. ['rs123']. None or [None] auto-picks the lead variant. Up to 7 refs; multi-ref switches to region_ld_colors_m.

required
region_ref_alias Any

Dict {variant_id: label} for colorbar/legend text.

required
region_ref_second Any

Deprecated pattern—include all references in region_ref instead.

required
region_step int

Default 21 tick steps across the plotted window.

21
region_title Any

None auto-builds from region and lead variant; pass through region_title_args/kwargs.

required
region_title_kwargs dict

Regional plot title styling args.

{'family': 'Arial'}
repel_force float

Text repulsion force parameter.

0.03
rr_chr_dict Any

Recombination rate chrom dict.

required
rr_header_dict Any

Recombination rate header dict.

required
rr_lim list

Tuple (min, max); default (0, 100).

[0, 100]
rr_path str

Used when region_recombination=True; y-axis limits from rr_lim.

'default'
rr_ylabel bool

Applies to the RR panel when region_recombination=True.

True
save bool

Boolean or output filepath; when boolean, uses default naming.

required
save_kwargs dict

Save kwargs for GW heatmap.

required
sc_linewidth int

Line width for significance lines.

2
scaled bool

Auto-detected when scaled effect columns exist; not a direct plot kwarg.

False
scatter_kwargs dict

Extra kwargs for locus scatter points. Do not set 's' (use marker_size) or 'marker' (use region_marker_shapes). Do not set in scatter_kwargs: edgecolor, edgecolors, linewidth, ax, palette, hue, data, legend, style, size, sizes, zorder, s.

required
show_ld_score bool

LD score = sum of r² to other variants; requires vcf_path or ld_path.

False
sig_line bool

Whether to draw significance reference line.

True
sig_line_color str or list

Significance line color.

required
snpid str

SNP identifier column.

'SNPID'
suggestive_sig_level float

Suggestive threshold value, e.g., 5e-6.

5e-06
suggestive_sig_line bool

Whether to draw suggestive threshold line (e.g., 5e-6).

False
suggestive_sig_line_color str or list

Suggestive significance line color.

required
tabix Any

Tabix index path for fast IO.

required
taf list

Track arrangement factors.

[4, 0, 0.95, 1, 1]
title str

Figure title text.

required
title_fontsize int

Title font size.

13
title_pad float

Title padding.

1.08
track_exon_ratio int

Exon track ratio.

1
track_font_family str

Font family for region tracks.

'Arial'
track_fontsize_ratio float

Track fontsize ratio.

0.95
track_n int

Genes beyond this limit are omitted; adjust track_n_offset for spacing.

4
track_n_offset int

Track offset.

0
track_text_offset int

Track text offset.

1
use_rank bool

Use rank for chrom indexing.

False
vcf_chr_dict Any

Chromosome mapping for VCF resource.

required
verbose bool

Verbose logging toggle.

True
windowsizekb int

Window size for lead variant extraction (kb).

500
xlabel Any

X-axis label.

required
xpad Any

X padding proportion.

required
xpadl Any

Left X padding.

required
xpadr Any

Right X padding.

required
xtick_chr_dict Any

X-axis tick chromosome mapping.

required
xtight bool

Tight X padding.

False
ylabel Any

Y-axis label.

required
ylabels Any

Custom y-axis labels.

required
ylim Any

Y-axis limits.

required
ystep int

Step size for y-axis.

0
ytick3 bool

Use 3 y-axis ticks.

True

Returns:

Type Description
matplotlib.figure.Figure

The created matplotlib figure object. tuple, optional (lead_snp_is, lead_snp_is_color) when _get_region_lead=True in regional mode.

Notes
- Regional plots require ``region=(chr, start, end)`` and LD data (``vcf_path`` or precomputed LD).
- Use ``skip`` to omit low-significance variants for faster genome-wide plots.
- Annotation supports gene names, custom columns, or variant IDs.

plot_trumpet

plot_trumpet(build: Optional[str] = None, **kwargs: Any) -> typing.Any

Trumpet plot for quantitative (mode='q') or binary (mode='b') traits. Binary-only parameters: prevalence, ncase, ncontrol, or_to_rr.

Parameters:

Name Type Description Default
mode str

Plot layout mode. Values depend on the plot function; see ctx_desc.

'q'
build str

Genome build (e.g., '19'/'38') for annotation/coordinate resources.

None
sig_level float

Significance threshold for reference line and marker sizing.

5e-08
anno DataFrame or list

Annotation source or column (e.g., 'GENENAME', True, or column name).

required
anno_alias dict

Mapping from SNPID to custom annotation label.

{}
anno_d dict

Per-annotation positioning options (e.g., left/right).

{}
anno_kwargs dict

Default styling kwargs for annotations.

{}
anno_max_iter int

Maximum iterations for text repulsion algorithm.

100
anno_set list

Set of variant IDs to annotate.

[]
anno_source str

Annotation source backend (e.g., 'ensembl', 'refseq').

'ensembl'
anno_style str

Annotation style ('right', 'tight', 'expand').

'right'
anno_x float

Annotation x threshold.

0.01
anno_y int

Annotation y threshold.

1
arm_scale int

Scaling factor for arm length.

1
beta str

Effect size column.

'BETA'
beta_range Any

Beta range for power computation.

required
chrom str

Chromosome column used to position variants and x-axis layout.

'CHR'
cmap Any

Colormap selection.

required
eaf str

Effect allele frequency column.

'EAF'
fig_kwargs dict

Figure kwargs for plot.

required
font_family str

Font family, e.g., 'Arial', for consistent styling.

'Arial'
fontsize int

Font size for ticks, labels, etc.

12
highlight list

List of focal variants to highlight.

[]
highlight_anno_kwargs dict

Annotation style kwargs for highlighted variants.

{}
highlight_chrpos bool

Highlight by chromosome position flag.

False
highlight_color str or list

Highlight color.

required
highlight_lim Any

Custom highlight limits.

required
highlight_lim_mode str

Highlight limit mode ('absolute'|'relative').

'absolute'
highlight_windowkb int

Highlight window size (kb).

500
hue Any

Hue mapping.

required
maf str

Minor allele frequency column.

'MAF'
maf_range Any

MAF range for power computation.

required
markercolor str

Base marker color.

'#597FBD'
n Any

Sample size column (quantitative mode).

required
n_matrix int

Power curve smoothness parameter.

1000
ncase Any

Case count (binary mode).

required
ncontrol Any

Control count (binary mode).

required
or_to_rr bool

Convert OR to RR.

False
p str

P-value column.

'P'
p_level float

P-value threshold for inclusion.

5e-08
pinpoint list

Variants to pinpoint.

[]
pinpoint_color str or list

Color for pinpoint.

required
pos str

Base-pair position column used with chrom for plotting.

'POS'
prevalence Any

Disease prevalence (used for power lines in binary mode).

required
repel_force float

Text repulsion force parameter.

0.03
save bool

Boolean or output filepath; when boolean, uses default naming.

required
save_kwargs dict

Save kwargs for GW heatmap.

required
scatter_kwargs dict

Extra kwargs passed to the main scatter layer (matplotlib Axes.scatter). Use marker_size for point sizes, not s/size.

required
size Any

Size mapping.

required
sizes Any

Size list for style mapping.

required
snpid str

SNP identifier column.

'SNPID'
sort Any

Sorting key or method.

required
title str

Figure title text.

required
title_fontsize int

Title font size.

13
ts Any

Power thresholds to plot.

required
verbose bool

Verbose logging toggle.

True
xlabel Any

X-axis label.

required
xlim Any

X-axis limits.

required
xscale str

X-axis scale.

'log'
xticklabels Any

Custom x-axis tick labels.

required
xticks Any

Custom x-axis ticks.

required
ylabel Any

Y-axis label.

required
ylim Any

Y-axis limits.

required
yscale_factor int

Y scale factor.

1
yticklabels Any

Custom y-axis tick labels.

required
yticks Any

Custom y-axis ticks.

required

Returns:

Type Description
matplotlib.figure.Figure

The generated trumpet plot figure.

plot_phenogram

plot_phenogram(build: Optional[str] = None, **kwargs: Any) -> typing.Any

Create a karyotype-style phenogram with cytobands and lead variants.

Registry-aligned parameters are on ``Sumstats.plot_phenogram()``.

Returns:

Type Description
Figure

The phenogram figure.

Parameters:

Name Type Description Default
build str

Genome build (e.g., '19'/'38') for annotation/coordinate resources.

'19'
sig_level float

Significance threshold for reference line and marker sizing.

5e-08
anno_sig_level float

Significance level for extracting lead variants to annotate. Can be set independently from sig_level.

5e-08
marker_size int

Scatter marker size. Use an int for fixed size, or a (small, large) tuple for variants below/above sig_level.

81
anno DataFrame or list

Annotation source or column (e.g., 'GENENAME', True, or column name).

required
anno_alias dict

Mapping from SNPID to custom annotation label.

{}
anno_color str or list

Column name for phenogram marker color; unique values auto-mapped to marker_colors pool.

required
anno_group Any

Column name to merge multiple phenogram leads into one label.

required
anno_gtf_path str

Custom GTF path for annotations.

required
anno_kwargs dict

Default styling kwargs for annotations.

{}
anno_kwargs_single dict

Per-SNP styling kwargs for annotations.

{}
anno_max_iter int

Maximum iterations for text repulsion algorithm.

100
anno_max_len Any

Truncate phenogram annotation labels to this length.

required
anno_max_rows int

Maximum number of annotation rows to display. If more variants are provided, they will be sorted by p-value or -log10(p-value) and only the top ones will be shown.

200
anno_set list

Set of variant IDs to annotate.

[]
anno_shape Any

Column name for phenogram marker shape; unique values auto-mapped to marker_shapes pool.

required
anno_source str

Annotation source backend (e.g., 'ensembl', 'refseq').

'ensembl'
anno_style str

Annotation style ('right', 'tight', 'expand').

'expand'
anno_wrap Any

Enable text wrapping for phenogram annotations.

required
anno_wrap_chars_per_line Any

Character wrap width for phenogram annotations.

required
anno_wrap_width_pt Any

Max annotation line width in points (phenogram).

required
anno_x_pad float

Phenogram extra horizontal gap between chromosome and annotation text (data coords).

0.18
arrow_kwargs dict

Arrow styling kwargs for annotations.

{}
chr_label_pad float

chr_label_pad.

0.06
chr_width float

Phenogram chromosome width in data coordinates.

0.35
chr_x float

Phenogram chromosome left x boundary in data coordinates.

0.0
chrom str

Chromosome column used to position variants and x-axis layout.

'CHR'
cytoband_path str

cytoband_path.

required
dpi int

Figure DPI.

100
fig_kwargs dict

Figure kwargs for plot.

{'figsize': [15, 15], 'dpi': 200}
figsize list

figsize.

[20, 48]
group_label_box_pad_pt float

Extra padding around phenogram label text for overlap calculations, in points.

1.5
group_marker_to_marker_gap_pt int

Minimum spacing between marker rows of adjacent phenogram groups, in points.

3
group_min_vertical_gap_pt float

Minimum vertical spacing between phenogram group annotation blocks, in points.

3.5
include_sex_chr bool

If True, include chrX and chrY after autosomes in phenogram.

False
legend_kwargs dict

Legend styling kwargs.

{}
legend_ncol int

Number of columns in phenogram figure legend.

6
marker_color_map Any

Map from phenogram anno_color values to marker colors.

required
marker_colors str or list

Pool of colors for auto phenogram color mapping.

required
marker_fontsize int

Font size for phenogram marker-mode text labels.

11
marker_gap_pt int

Horizontal gap between phenogram markers within a group, in points.

3
marker_label_align str

Horizontal alignment of phenogram marker label relative to marker row (center, left, right).

'center'
marker_label_bbox bool

If True, draw phenogram marker labels with a white text outline (no filled box).

True
marker_label_gap_pt float

Vertical gap between phenogram marker row and text label below, in points.

2.75
marker_linewidth float

Edge linewidth for phenogram marker scatter points.

0.6
marker_max_per_row int

marker_max_per_row.

4
marker_row_gap_pt float

marker_row_gap_pt.

2.5
marker_shape_map Any

Map from phenogram anno_shape values to matplotlib marker codes.

required
marker_shapes Any

Pool of matplotlib marker codes for auto phenogram shape mapping.

required
mlog10p str

Negative log10 p-value column; improves performance and stability if provided.

'MLOG10P'
ncols int

ncols.

11
only_anno_chr bool

If True, plot only chromosomes containing phenogram lead or annotation rows.

False
p str

P-value column.

'P'
pos str

Base-pair position column used with chrom for plotting.

'POS'
repel_force float

Text repulsion force parameter.

0.03
save bool

Boolean or output filepath; when boolean, uses default naming.

False
save_kwargs dict

Save kwargs for GW heatmap.

required
show_legend bool

Show figure-level legend below phenogram.

True
snpid str

SNP identifier column.

'SNPID'
use_lead_extraction bool

If True, extract lead variants via _get_sig(); if False, use every input row.

True
verbose bool

Verbose logging toggle.

True
windowsizekb int

Window size for lead variant extraction (kb).

500

Returns:

Type Description
matplotlib.figure.Figure

The phenogram figure.

plot_ld_block

plot_ld_block(**kwargs: Any) -> typing.Any

Plot the upper triangle of an LD matrix as a 45°-rotated inverted triangle.

This function supports two modes:
1. **Standalone mode**: Creates its own figure and plots LD block independently.
2. **Regional mode**: Plots on provided axes (typically from plot_mqq) and aligns
   x-axis with regional plot using "i" coordinate system.

Returns:

Name Type Description
fig Figure

Figure object.

ax Axes

Axes object.

Parameters:

Name Type Description Default
mode str

Plot layout mode. Values depend on the plot function; see ctx_desc.

required
region tuple or str

Genomic locus as (chr, start, end) in base pairs.

required
vcf_path str

Reference-panel VCF for LD r² computation.

required
anno_cell bool

Annotate LD block matrix cells with r² values.

False
anno_cell_fmt str

Format string for LD cell annotations (e.g., '{:.2f}' for 2 decimal places).

'{:.2f}'
anno_cell_kwargs Any

Additional keyword arguments for LD cell text annotations (e.g., {'fontsize': 10, 'weight': 'bold', 'color': 'white'}).

required
ax Any

ax.

required
ax_pos Any

ax_pos.

required
cbar bool

cbar.

True
cbar_kwargs Any

cbar_kwargs.

required
cbar_label str

cbar_label.

'LD $\\mathregular{r^2}$ with variant'
cmap Any

Colormap selection.

required
ea_col str

ea_col.

'EA'
fig_kwargs dict

Figure kwargs for plot.

required
font_family str

Font family, e.g., 'Arial', for consistent styling.

'Arial'
fontsize int

Font size for ticks, labels, etc.

10
ld Any

ld.

required
ld_block_anno bool

Whether to add annotations on the left side of the LD block triangle. If True, uses 'chr:pos' format. If a string (e.g., 'SNPID', 'rsID'), uses that column for annotation text. Annotations are styled like axis ticks and labels, with right-aligned text.

False
ld_block_anno_kwargs Any

Additional keyword arguments for left-side annotations (e.g., {'fontsize': 8, 'color': 'black'}).

required
ld_block_anno_max_rows int

Maximum number of variants to annotate. If the number of variants to annotate exceeds this limit, annotations will be skipped.

100
ld_block_anno_set Any

List of SNPIDs to annotate. If None, annotates all variants. Variants are matched by SNPID column.

required
ld_block_grid bool

Draw grid lines on the LD matrix triangle panel.

False
ld_block_grid_kwargs Any

Additional keyword arguments for LD block grid lines (e.g., {'color': 'gray', 'linewidth': 0.5, 'alpha': 0.5}).

required
lead_snp_is Any

lead_snp_is.

required
lead_snp_is_color str or list

lead_snp_is_color.

required
mapper Any

mapper.

required
nea_col str

nea_col.

'NEA'
pos str

Base-pair position column used with chrom for plotting.

'POS'
pos_col str

pos_col.

'POS'
position_bar_bg bool

position_bar_bg.

True
region_step int

Number of major tick intervals on the locus x-axis.

21
save bool

Boolean or output filepath; when boolean, uses default naming.

required
save_kwargs dict

Save kwargs for GW heatmap.

required
sumstats Any

Sumstats or DataFrame for LD block when using vcf_path+region.

required
tabix Any

Tabix index path for fast IO.

required
title str

Figure title text.

required
verbose bool

Verbose logging toggle.

True
vmax float

vmax.

1.0
vmin float

vmin.

0.0
xlabel str

X-axis label.

'Genomic position'

Returns:

Type Description
matplotlib.figure.Figure

Figure object. matplotlib.axes.Axes Axes object.

plot_effect

plot_effect(**kwargs: Any) -> None

Plot effect sizes with optional EAF and SNPR2 side panels.

Registry-aligned parameters are on ``Sumstats.plot_effect()``.

Returns:

Type Description
Figure

The generated figure object.

Parameters:

Name Type Description Default
eaf str

Effect allele frequency column.

'EAF'
eaf_kwargs dict

Styling kwargs for EAF panel.

{}
eaf_label Any

Label for EAF panel.

required
eaf_panel Any

Toggle EAF panel.

required
effect_label Any

Label for effect size panel.

required
err_kwargs dict

Errorbar styling kwargs.

{'ecolor': '#cccccc', 'linewidth': 0, 'zorder': 90, 'elinewidth': 1}
fig_kwargs dict

Figure kwargs for plot.

{'figsize': [8, 8], 'dpi': 200}
font_family str

Font family, e.g., 'Arial', for consistent styling.

'Arial'
font_kwargs dict

Font configuration kwargs.

{'fontsize': 9}
fontsize int

Font size for ticks, labels, etc.

12
gap float

Panel gap or spacing.

0.3
group Any

Grouping column for axes.

required
hue Any

Hue mapping.

required
legend_mode int

Legend layout: int code (plot_effect) or string mode (compare_effect).

1
ncol int

Number of columns in legend.

2
rename_dic Any

Rename dictionary for labels.

required
save bool

Boolean or output filepath; when boolean, uses default naming.

required
save_kwargs dict

Save kwargs for GW heatmap.

required
scatter_kwargs dict

Extra kwargs passed to the main scatter layer (matplotlib Axes.scatter). Use marker_size for point sizes, not s/size.

{'s': 20}
se str

Standard error column.

'SE'
size Any

Size mapping.

required
snpr2 Any

SNP r2 column.

required
snpr2_kwargs dict

Styling kwargs for SNP r2 panel.

{'color': '#74BAD3'}
snpr2_label Any

Label for SNP r2 panel.

required
snpvar_panel Any

Toggle SNP variance panel.

required
sort_kwargs Any

Sorting kwargs.

required
style_col Any

style_col.

required
title str

Figure title text.

required
verbose bool

Verbose logging toggle.

True
x Any

X variable/column name.

required
xlim_eaf Any

X limits for EAF panel.

required
xlim_snpr2 Any

X limits for SNP r2 panel.

required
y Any

Y variable/column name.

required
y_sort Any

Y sorting key.

required
ylabel Any

Y-axis label.

required

Returns:

Type Description
matplotlib.figure.Figure

The generated figure object.

plot_associations

plot_associations(**kwargs)

Plot trait associations as a heatmap (GCV2 format).

Parameters:

Name Type Description Default
annot bool

annot.

True
cbar bool

cbar.

True
cbar_kws Any

cbar_kws.

required
center Any

center.

required
cmap str

Colormap selection.

'RdBu'
fig_kwargs dict

Figure kwargs for plot.

required
fmt str

fmt.

'.2f'
font_family str

Font family, e.g., 'Arial', for consistent styling.

'Arial'
fontsize int

Font size for ticks, labels, etc.

12
heatmap_kwargs Any

heatmap_kwargs.

required
save bool

Boolean or output filepath; when boolean, uses default naming.

required
save_kwargs dict

Save kwargs for GW heatmap.

required
sort str

Sorting key or method.

'P_GCV2'
title str

Figure title text.

required
values str

Value to plot in associations heatmap.

'Beta'
verbose bool

Verbose logging toggle.

True
vmax Any

vmax.

required
vmin Any

vmin.

required
xlabel str

X-axis label.

'rsID - Gene Name'
xticklabel_kwargs dict

X ticklabel kwargs.

{'rotation': 45, 'horizontalalignment': 'left', 'verticalalignment': 'bottom', 'fontsize': 10, 'fontfamily': 'Arial'}
ylabel str

Y-axis label.

'Traits'
yticklabel_kwargs dict

Matplotlib kwargs for LDSC rg heatmap y-axis tick labels (rotation, fontsize, …).

{'fontsize': 10, 'fontfamily': 'Arial'}

Returns:

Type Description
matplotlib.figure.Figure or None

Heatmap figure, or None when required columns are missing. matplotlib.axes.Axes or None Axes containing the heatmap.

plot_sankey

plot_sankey(**kwargs: Any) -> typing.Any

Sankey diagram across ordered categorical stages. Pass stage names via columns (list of column or preset names).

Parameters:

Name Type Description Default
beta_bins Any

beta_bins.

required
color_by str

color_by.

'first'
colors list

Color palette or list.

['#597FBD', '#74BAD3']
column_map Any

column_map.

required
dropna bool

dropna.

True
fig_kwargs dict

Figure kwargs for plot.

{'figsize': [10, 6], 'dpi': 300}
font_family str

Font family, e.g., 'Arial', for consistent styling.

'Arial'
fontsize int

Font size for ticks, labels, etc.

12
gap_frac float

gap_frac.

0.02
link_alpha float

link_alpha.

0.55
node_color_mode str

node_color_mode.

'stacked'
node_width float

node_width.

0.025
palette str

Color palette name or list.

'auto'
ribbon_curvature float

ribbon_curvature.

0.5
save bool

Boolean or output filepath; when boolean, uses default naming.

False
save_kwargs dict

Save kwargs for GW heatmap.

{'dpi': 300, 'facecolor': 'white'}
stage_labels Any

stage_labels.

required
title str

Figure title text.

required
verbose bool

Verbose logging toggle.

True
weight str

weight.

'count'

Returns:

Type Description
tuple

(fig, ax, tables) where tables contains nodes, links, node_bands, flow_colors, stages, and work. Returns (None, None, tables) when no rows remain after filtering.

plot_pipcs

plot_pipcs(region=None, locus=None, **kwargs)

Plot fine-mapping credible sets in a regional view.

Parameters:

Name Type Description Default
region tuple or str

Genomic locus as (chr, start, end) in base pairs.

None
marker_size int

Scatter marker size. Use an int for fixed size, or a (small, large) tuple for variants below/above sig_level.

40
chrom str

Chromosome column used to position variants and x-axis layout.

'CHR'
cs str

Credible-set index column.

'CREDIBLE_SET_INDEX'
cs_category str

Column name for credible-set category label.

'CS_CATEGORY'
fig_kwargs dict

Figure kwargs for plot.

required
figax Any

Existing figure/axes tuple to draw on.

required
font_family str

Font family, e.g., 'Arial', for consistent styling.

'Arial'
fontsize int

Font size for ticks, labels, etc.

12
legend_title Any

Legend title.

required
locus Any

Locus label for credible sets.

None
onlycs bool

When True, plot only CS-assigned variants.

False
pip str

PIP column in finemapping results.

'PIP'
pos str

Base-pair position column used with chrom for plotting.

'POS'
save bool

Boolean or output filepath; when boolean, uses default naming.

required
save_kwargs dict

Save kwargs for GW heatmap.

required
scatter_kwargs dict

Extra kwargs passed to the main scatter layer (matplotlib Axes.scatter). Use marker_size for point sizes, not s/size.

required
title str

Figure title text.

required
title_kwargs Any

Title styling kwargs (e.g., family, fontsize, weight).

required
verbose bool

Verbose logging toggle.

True
xtick_chr_dict Any

X-axis tick chromosome mapping.

required

Returns:

Type Description
matplotlib.figure.Figure

The credible-set regional figure.