Plotting utilities

Manhattan

limix.plot.plot_manhattan(df, alpha=None, null_style={‘color’: ‘DarkBlue’, ’alpha’: 0.1}, alt_style={‘color’: ‘Orange’, ’alpha’: 0.5}, ax=None)[source]

Produce a manhattan plot.

Parameters:
  • df (pandas.DataFrame) – A Pandas DataFrame containing columns pv for p-values, pos for base-pair positions, and chrom for chromossome names..
  • alpha (float) – Threshold for significance. Defaults to 0.01 significance level (bonferroni-adjusted).
  • ax (matplotlib.axes.AxesSubplot:) – The target handle for this figure. If None, the current axes is set.
Returns:

Axes object.

Return type:

matplotlib.axes.AxesSubplot

Examples

(Source code, png, hires.png, pdf)

_images/plot-1.png

QQ plot

limix.plot.qqplot(pv, label=’unknown’, distr=’log10’, alphaLevel=0.05, ax=None, color=None)[source]
Produces a Quantile-Quantile plot of the observed P value
distribution against the theoretical one under the null.
Parameters:
  • pv (array_like) – P-values.
  • distr ({'log10', 'chi2'}) – Scale of the distribution. If ‘log10’ is specified, the distribution of the -log10 P values is considered. If the distribution of the corresponding chi2-distributed test statistics is considered. Defaults to ‘log10’.
  • alphaLevel (float) – Significance bound.
  • ax (matplotlib.axes.AxesSubplot) – The target handle for this figure. If None, the current axes is set.
Returns:

Axes.

Return type:

matplotlib.axes.AxesSubplot

Examples

(Source code, png, hires.png, pdf)

_images/plot-2.png

Power plots

limix.plot.plot_power_curve(df, color=None, ax=None)[source]

Plot number of hits across significance levels.

Parameters:
  • df (pandas.DataFrame) – Data frame with pv and label columns.
  • color (dict) – Map colors to labels.
  • ax (matplotlib.axes.AxesSubplot) – The target handle for this figure. If None, the current axes is set.
Returns:

Axes.

Return type:

matplotlib.axes.AxesSubplot

Examples

(Source code, png, hires.png, pdf)

_images/plot-3.png

Kinship

limix.plot.plot_kinship(K)[source]

Plot Kinship matrix.

Parameters:K (array_like) – Kinship matrix.

Examples

(Source code)

Normal distribution

limix.plot.plot_normal(x, bins=20, nstd=2, figure=None)[source]

Plot a fit of a normal distribution to the data in x.

Parameters:
  • x (array_like) – values to be fitted.
  • bins (int) – number of histogram bins.
  • nstd (float) – standard deviation multiplier.
  • figure (matplotlib.figure.Figure) – matplotlib figure or None.
Returns:

figure to be shown.

Return type:

matplotlib.figure.Figure

Examples

(Source code, png, hires.png, pdf)

_images/plot-5.png